From 2f722e0cc50c552389c2257ff0c26dadf34dd2c2 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 9 Apr 2026 22:37:50 -0700 Subject: [PATCH 1/2] fix(agent): include model in structured response output --- apps/sim/executor/handlers/agent/agent-handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sim/executor/handlers/agent/agent-handler.ts b/apps/sim/executor/handlers/agent/agent-handler.ts index 9926e4d5b14..6df3c7e9c6f 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.ts @@ -1070,19 +1070,20 @@ export class AgentBlockHandler implements BlockHandler { private processStandardResponse(result: any): BlockOutput { return { content: result.content, - model: result.model, ...this.createResponseMetadata(result), ...(result.interactionId && { interactionId: result.interactionId }), } } private createResponseMetadata(result: { + model?: string tokens?: { input?: number; output?: number; total?: number } toolCalls?: Array timing?: any cost?: any }) { return { + model: result.model, tokens: result.tokens || { input: DEFAULTS.TOKENS.PROMPT, output: DEFAULTS.TOKENS.COMPLETION, From b8251a4effdc7d81d4fb59d7b6eba50739e4b7b1 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 9 Apr 2026 22:43:45 -0700 Subject: [PATCH 2/2] fix(agent): update test expectation for model in structured response --- apps/sim/executor/handlers/agent/agent-handler.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/sim/executor/handlers/agent/agent-handler.test.ts b/apps/sim/executor/handlers/agent/agent-handler.test.ts index d4987de9606..437dc69121d 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.test.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.test.ts @@ -667,6 +667,7 @@ describe('AgentBlockHandler', () => { expect(result).toEqual({ result: 'Success', score: 0.95, + model: 'mock-model', tokens: { input: 10, output: 20, total: 30 }, toolCalls: { list: [], count: 0 }, providerTiming: { total: 100 },