fix for subagent response handling

This commit is contained in:
Rob Colbert 2026-05-11 15:15:38 -04:00
parent 2757e55e2c
commit 6b4aad6f9f

View File

@ -265,10 +265,12 @@ class AgentService extends GadgetService {
messages.push({
createdAt: turn.createdAt,
role: "tool",
callId: toolCall.callId,
toolName: toolCall.function.name,
content: result,
role: "assistant",
content: this.formatHistoricalToolResult({
name: toolCall.function.name,
parameters: toolCall.function.arguments,
response: result,
}),
});
inputTokens += Math.ceil(toolCall.function.arguments.length / 4);
@ -616,10 +618,12 @@ class AgentService extends GadgetService {
messages.push({
createdAt: new Date(),
role: "tool",
callId: toolCall.callId,
toolName: toolCall.function.name,
content: result,
role: "assistant",
content: this.formatHistoricalToolResult({
name: toolCall.function.name,
parameters: toolArgsRaw,
response: result,
}),
});
inputTokens += Math.ceil(toolArgsRaw.length / 4);