fix: subagent tool call messages

This commit is contained in:
mingholy.lmh
2025-11-04 20:29:38 +08:00
parent 14ad26f27e
commit a962e10406
14 changed files with 2011 additions and 1079 deletions

View File

@@ -9,6 +9,7 @@ import type {
ToolCallConfirmationDetails,
ToolConfirmationOutcome,
} from '../tools/tools.js';
import type { Part } from '@google/genai';
export type SubAgentEvent =
| 'start'
@@ -72,7 +73,7 @@ export interface SubAgentToolResultEvent {
name: string;
success: boolean;
error?: string;
resultDisplay?: string;
responseParts?: Part[];
durationMs?: number;
timestamp: number;
}

View File

@@ -619,11 +619,7 @@ export class SubAgentScope {
name: toolName,
success,
error: errorMessage,
resultDisplay: call.response.resultDisplay
? typeof call.response.resultDisplay === 'string'
? call.response.resultDisplay
: JSON.stringify(call.response.resultDisplay)
: undefined,
responseParts: call.response.responseParts,
durationMs: duration,
timestamp: Date.now(),
} as SubAgentToolResultEvent);