diff --git a/hive-subagent-mcp/src/session.rs b/hive-subagent-mcp/src/session.rs index 8d116c3d..0699dc36 100644 --- a/hive-subagent-mcp/src/session.rs +++ b/hive-subagent-mcp/src/session.rs @@ -45,6 +45,14 @@ use hive_claude::{Attach, Cancel, Claude, Config, NoopSink, SessionStore}; /// reviewer caught in the original check-then-insert version: checking "is /// `name` free" and committing to it are two different lock acquisitions /// unless the check *is* the reservation — see `reserve`. +/// +/// ⚠️ This concurrency guard is keyed by `name` alone — a `start`/`continue` +/// for `name` with a *different* `dir` than one already in flight under +/// that name is refused as "already running," even though the two would +/// resolve to entirely separate on-disk sessions. Deliberate: `name` is the +/// caller's one chosen identity for a subagent, not `(name, dir)` — reuse a +/// name across directories at your own risk, the tool doesn't disambiguate +/// it (flagged in review when `dir` was added). pub struct State { running: Mutex>>, dirs: Mutex>,