mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-19 01:30:42 -07:00
feat(core): persist subagent agentId in tool call records (#25092)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user