diff --git a/gadget-drone/src/services/agent.ts b/gadget-drone/src/services/agent.ts index b755552..7ef60e1 100644 --- a/gadget-drone/src/services/agent.ts +++ b/gadget-drone/src/services/agent.ts @@ -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);