fix(cli): filter subagent sessions from resume history (#19698)

This commit is contained in:
Abhi
2026-02-21 12:41:27 -05:00
committed by GitHub
parent dfd7721e69
commit d2d345f41a
7 changed files with 116 additions and 9 deletions

View File

@@ -276,6 +276,12 @@ export const getAllSessionFiles = async (
return { fileName: file, sessionInfo: null };
}
// Skip subagent sessions - these are implementation details of a tool call
// and shouldn't be surfaced for resumption in the main agent history.
if (content.kind === 'subagent') {
return { fileName: file, sessionInfo: null };
}
const firstUserMessage = extractFirstUserMessage(content.messages);
const isCurrentSession = currentSessionId
? file.includes(currentSessionId.slice(0, 8))