feat(core): persist subagent agentId in tool call records (#25092)

This commit is contained in:
Abhi
2026-04-10 12:47:25 -04:00
committed by GitHub
parent f6c08a114b
commit 7d1de3bccc
6 changed files with 43 additions and 2 deletions

View File

@@ -536,6 +536,34 @@ describe('ChatRecordingService', () => {
.toolCalls,
).toHaveLength(1);
});
it('should record agentId when provided', async () => {
chatRecordingService.recordMessage({
type: 'gemini',
content: '',
model: 'gemini-pro',
});
const toolCall: ToolCallRecord = {
id: 'tool-1',
name: 'testTool',
args: {},
status: CoreToolCallStatus.Success,
timestamp: new Date().toISOString(),
agentId: 'test-agent-id',
};
chatRecordingService.recordToolCalls('gemini-pro', [toolCall]);
const sessionFile = chatRecordingService.getConversationFilePath()!;
const conversation = (await loadConversationRecord(
sessionFile,
)) as ConversationRecord;
const geminiMsg = conversation.messages[0] as MessageRecord & {
type: 'gemini';
};
expect(geminiMsg.toolCalls).toHaveLength(1);
expect(geminiMsg.toolCalls![0].agentId).toBe('test-agent-id');
});
});
describe('deleteSession', () => {

View File

@@ -45,6 +45,7 @@ export interface ToolCallRecord {
result?: PartListUnion | null;
status: Status;
timestamp: string;
agentId?: string;
// UI-specific fields for display purposes
displayName?: string;
description?: string;