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