Surface cross-workspace subagents in their workspaces (#2061)

* fix(workspaces): show provider subagent activity

Provider subagent lifecycle lives outside managed agent snapshots, so workspace aggregation dropped it after the parent turn finished. Count running provider subagents against the delegation root and emit workspace updates when their status changes.

* fix(workspaces): surface cross-workspace subagents
This commit is contained in:
Mohamed Boudra
2026-07-14 14:22:14 +02:00
committed by GitHub
parent c0b801b805
commit 1f5283f5a3
14 changed files with 295 additions and 38 deletions
@@ -215,4 +215,38 @@ describe("workspace subagents integration", () => {
),
).toEqual([]);
});
it("auto-opens a cross-workspace child while retaining it in the parent section", () => {
const workspaceKey = buildWorkspaceTabPersistenceKey({
serverId: SERVER_ID,
workspaceId: WORKSPACE_ID,
});
expect(workspaceKey).toBeTruthy();
const parent = makeAgent({
id: "parent-agent",
workspaceId: "ws-parent",
title: "Parent agent",
});
const child = makeAgent({
id: "child-agent",
parentAgentId: parent.id,
title: "Cross-workspace child",
});
initializeAgents([parent, child]);
reconcileWorkspaceTabs(workspaceKey!, deriveVisibilityFromSession());
expect(getWorkspaceTabIds(workspaceKey!)).toEqual(["agent_child-agent"]);
expect(
selectSubagentsForParent(
useSessionStore.getState(),
{
serverId: SERVER_ID,
parentAgentId: parent.id,
},
new Set(),
).map((row) => row.id),
).toEqual([child.id]);
});
});