Skip to content

Commit 7b229eb

Browse files
committed
Name spawned workers' trace dirs after their session id
read_agent_trace's descendant-scoping check resolves a worker's parent chain from its trace directory name, so spawn_agent must pass the session-store id the same way task-tool.ts does.
1 parent a69fe2a commit 7b229eb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/subagent/agent-fleet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ export function createSpawnAgentTool(deps: AgentFleetDeps): AgentTool {
415415

416416
const catalog = deps.catalog !== undefined ? resolveDep(deps.catalog) : undefined;
417417
const params: RunSubAgentParams = {
418+
// Name the trace directory after the session-store id so the
419+
// descendant-scoping check behind read_agent_trace can resolve this
420+
// worker's parent chain (matches task-tool.ts).
421+
id: session.id,
418422
permissionGate: deps.permissionGate,
419423
...(deps.inheritMcpTools !== undefined ? { inheritMcpTools: deps.inheritMcpTools } : {}),
420424
...(deps.shellTimeout !== undefined ? { shellTimeout: deps.shellTimeout } : {}),

0 commit comments

Comments
 (0)