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
@@ -86,6 +86,21 @@ describe('ChatRecordingService', () => {
expect(files[0]).toMatch(/^session-.*-test-ses\.json$/);
});
it('should include the conversation kind when specified', () => {
chatRecordingService.initialize(undefined, 'subagent');
chatRecordingService.recordMessage({
type: 'user',
content: 'ping',
model: 'm',
});
const sessionFile = chatRecordingService.getConversationFilePath()!;
const conversation = JSON.parse(
fs.readFileSync(sessionFile, 'utf8'),
) as ConversationRecord;
expect(conversation.kind).toBe('subagent');
});
it('should resume from an existing session if provided', () => {
const chatsDir = path.join(testTempDir, 'chats');
fs.mkdirSync(chatsDir, { recursive: true });