fix(sessions): resolve transcript paths with explicit agent context (#16288)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7cbe9deca9
Co-authored-by: robbyczgw-cla <239660374+robbyczgw-cla@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Robby
2026-02-14 19:44:51 +01:00
committed by GitHub
parent 77b89719d5
commit cab0abf52a
10 changed files with 252 additions and 12 deletions

View File

@@ -230,10 +230,12 @@ async function buildSubagentStatsLine(params: {
});
const sessionId = entry?.sessionId;
const agentId = resolveAgentIdFromSessionKey(params.sessionKey);
let transcriptPath: string | undefined;
if (sessionId && storePath) {
try {
transcriptPath = resolveSessionFilePath(sessionId, entry, {
agentId,
sessionsDir: path.dirname(storePath),
});
} catch {

View File

@@ -161,7 +161,10 @@ export function createSessionsListTool(opts?: {
transcriptPath = resolveSessionFilePath(
sessionId,
sessionFile ? { sessionFile } : undefined,
{ sessionsDir: path.dirname(storePath) },
{
agentId: resolveAgentIdFromSessionKey(key),
sessionsDir: path.dirname(storePath),
},
);
} catch {
transcriptPath = undefined;