Skip to content

feat(copilot): fix context / json parsing edge cases #4580

feat(copilot): fix context / json parsing edge cases

feat(copilot): fix context / json parsing edge cases #4580

Triggered via pull request October 4, 2025 01:49
Status Failure
Total duration 42s
Artifacts

ci.yml

on: pull_request
Test and Build  /  Test and Build
27s
Test and Build / Test and Build
Matrix: Build AMD64
Matrix: Build ARM64 (GHCR Only)
Deploy Trigger.dev  /  Deploy to Trigger.dev
Deploy Trigger.dev / Deploy to Trigger.dev
Process Docs  /  Process Documentation Embeddings
Process Docs / Process Documentation Embeddings
Matrix: Create GHCR Manifests
Fit to window
Zoom out
Zoom in

Annotations

6 errors
Test and Build / Test and Build
Process completed with exit code 1.
app/api/copilot/chat/route.test.ts > Copilot Chat API Route > POST > should use ask mode when specified: apps/sim/app/api/copilot/chat/route.test.ts#L443
AssertionError: expected "spy" to be called with arguments: [ …(2) ] Received: 1st spy call: [ "http://localhost:8000/api/chat-completion-streaming", - ObjectContaining { - "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"What is this workflow?\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"What is this workflow?\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"ask\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.0\",\"chatId\":\"chat-123\"}", + { + "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"What is this workflow?\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"What is this workflow?\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"ask\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.1\",\"chatId\":\"chat-123\"}", + "headers": { + "Content-Type": "application/json", + "x-api-key": "test-sim-agent-key", + }, + "method": "POST", }, ] Number of calls: 1 ❯ app/api/copilot/chat/route.test.ts:443:28
app/api/copilot/chat/route.test.ts > Copilot Chat API Route > POST > should include implicit feedback in messages: apps/sim/app/api/copilot/chat/route.test.ts#L345
AssertionError: expected "spy" to be called with arguments: [ …(2) ] Received: 1st spy call: [ "http://localhost:8000/api/chat-completion-streaming", - ObjectContaining { - "body": "{\"messages\":[{\"role\":\"system\",\"content\":\"User seems confused about the workflow\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"chatMessages\":[{\"role\":\"system\",\"content\":\"User seems confused about the workflow\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.0\",\"chatId\":\"chat-123\"}", + { + "body": "{\"messages\":[{\"role\":\"system\",\"content\":\"User seems confused about the workflow\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"chatMessages\":[{\"role\":\"system\",\"content\":\"User seems confused about the workflow\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.1\",\"chatId\":\"chat-123\"}", + "headers": { + "Content-Type": "application/json", + "x-api-key": "test-sim-agent-key", + }, + "method": "POST", }, ] Number of calls: 1 ❯ app/api/copilot/chat/route.test.ts:345:28
app/api/copilot/chat/route.test.ts > Copilot Chat API Route > POST > should load existing chat and include conversation history: apps/sim/app/api/copilot/chat/route.test.ts#L285
AssertionError: expected "spy" to be called with arguments: [ …(2) ] Received: 1st spy call: [ "http://localhost:8000/api/chat-completion-streaming", - ObjectContaining { - "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Previous message\"},{\"role\":\"assistant\",\"content\":\"Previous response\"},{\"role\":\"user\",\"content\":\"New message\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"Previous message\"},{\"role\":\"assistant\",\"content\":\"Previous response\"},{\"role\":\"user\",\"content\":\"New message\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.0\",\"chatId\":\"chat-123\"}", + { + "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Previous message\"},{\"role\":\"assistant\",\"content\":\"Previous response\"},{\"role\":\"user\",\"content\":\"New message\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"Previous message\"},{\"role\":\"assistant\",\"content\":\"Previous response\"},{\"role\":\"user\",\"content\":\"New message\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.1\",\"chatId\":\"chat-123\"}", + "headers": { + "Content-Type": "application/json", + "x-api-key": "test-sim-agent-key", + }, + "method": "POST", }, ] Number of calls: 1 ❯ app/api/copilot/chat/route.test.ts:285:28
app/api/copilot/chat/route.test.ts > Copilot Chat API Route > POST > should handle new chat creation and forward to sim agent: apps/sim/app/api/copilot/chat/route.test.ts#L208
AssertionError: expected "spy" to be called with arguments: [ …(2) ] Received: 1st spy call: @@ -1,9 +1,9 @@ [ "http://localhost:8000/api/chat-completion-streaming", - ObjectContaining { - "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.0\",\"chatId\":\"chat-123\"}", + { + "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"chatMessages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"workflowId\":\"workflow-123\",\"userId\":\"user-123\",\"stream\":true,\"streamToolCalls\":true,\"model\":\"claude-4.5-sonnet\",\"mode\":\"agent\",\"messageId\":\"mock-uuid-1234-5678\",\"version\":\"1.0.1\",\"chatId\":\"chat-123\"}", "headers": { "Content-Type": "application/json", "x-api-key": "test-sim-agent-key", }, "method": "POST", Number of calls: 1 ❯ app/api/copilot/chat/route.test.ts:208:28
Test and Build / Test and Build
sim#test: command (/home/runner/_work/sim/sim/apps/sim) /home/runner/.bun/bin/bun run test exited (1)