feat(copilot): fix context / json parsing edge cases #4581
Annotations
6 errors
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
|
The logs for this run have expired and are no longer available.
Loading