fix(agent): use session key agentId for transcript path
Cross-agent subagent spawns wrote transcripts to the spawner's agent directory instead of the target agent's directory. For example, when main spawned a codex subagent with session key agent:codex:subagent:..., the transcript went to agents/main/sessions/ instead of agents/codex/sessions/. Pass sessionAgentId to resolveSessionFilePath so transcripts are written to the correct agent's session directory.
This commit is contained in:
@@ -416,7 +416,9 @@ export async function agentCommand(
|
|||||||
catalog: catalogForThinking,
|
catalog: catalogForThinking,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const sessionFile = resolveSessionFilePath(sessionId, sessionEntry);
|
const sessionFile = resolveSessionFilePath(sessionId, sessionEntry, {
|
||||||
|
agentId: sessionAgentId,
|
||||||
|
});
|
||||||
|
|
||||||
const startedAt = Date.now();
|
const startedAt = Date.now();
|
||||||
let lifecycleEnded = false;
|
let lifecycleEnded = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user