From 25499ce8dff39b59dfa925a4c4bf3985730446bf Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 11 Sep 2026 21:52:19 +0200 Subject: [PATCH] subagent: note the name-only concurrency guard now that dir adds a second axis --- hive-subagent-mcp/src/session.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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>,