From c04d3442dd48b48fa560b55b69639ee49533847e Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 22 Mar 2026 16:11:38 +0000 Subject: [PATCH] fix(monitor): use full workspace path as dedup key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit filepath.Base gave just "main" — every branch-based workspace collided in seenCompleted map. Now uses relative path like "core/go/main" for unique deduplication. Co-Authored-By: Virgil --- pkg/monitor/monitor.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index 57021ce..0289ece 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -324,7 +324,12 @@ func (m *Subsystem) checkCompletions() string { continue } - wsName := filepath.Base(filepath.Dir(entry)) + // Use full relative path as dedup key — "core/go/main" not just "main" + wsDir := filepath.Dir(entry) + wsName := wsDir + if len(wsDir) > len(wsRoot)+1 { + wsName = wsDir[len(wsRoot)+1:] + } switch st.Status { case "completed": @@ -548,8 +553,13 @@ func (m *Subsystem) agentStatusResource(ctx context.Context, req *mcp.ReadResour if json.Unmarshal([]byte(entryData), &st) != nil { continue } + entryDir := filepath.Dir(entry) + entryName := entryDir + if len(entryDir) > len(wsRoot)+1 { + entryName = entryDir[len(wsRoot)+1:] + } workspaces = append(workspaces, wsInfo{ - Name: filepath.Base(filepath.Dir(entry)), + Name: entryName, Status: st.Status, Repo: st.Repo, Agent: st.Agent,