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:
user
2026-01-11 05:52:33 +00:00
committed by Peter Steinberger
parent 580791088c
commit dc3c733612

View File

@@ -416,7 +416,9 @@ export async function agentCommand(
catalog: catalogForThinking,
});
}
const sessionFile = resolveSessionFilePath(sessionId, sessionEntry);
const sessionFile = resolveSessionFilePath(sessionId, sessionEntry, {
agentId: sessionAgentId,
});
const startedAt = Date.now();
let lifecycleEnded = false;