Skip to content

Commit db2a991

Browse files
chore(deps): update dependency @copilotkit/aimock to v1.35.0 (Zoo-Code-Org#820)
* chore(deps): update dependency @copilotkit/aimock to v1.35.0 * fix(e2e): update fixtures for aimock v1.35.0 toolCallId breaking change --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Elliott de Launay <edelauna@gmail.com>
1 parent e07d776 commit db2a991

18 files changed

Lines changed: 87 additions & 85 deletions

apps/vscode-e2e/fixtures/deepseek-v4.json

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,6 @@
1818
]
1919
}
2020
},
21-
{
22-
"match": {
23-
"model": "deepseek-v4-flash",
24-
"toolCallId": "call_dsv4_flash_on_read"
25-
},
26-
"response": {
27-
"toolCalls": [
28-
{
29-
"name": "attempt_completion",
30-
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_on\"}",
31-
"id": "call_dsv4_flash_on_done"
32-
}
33-
]
34-
}
35-
},
3621
{
3722
"match": {
3823
"model": "deepseek-v4-flash",
@@ -49,21 +34,6 @@
4934
]
5035
}
5136
},
52-
{
53-
"match": {
54-
"model": "deepseek-v4-flash",
55-
"toolCallId": "call_dsv4_flash_off_read"
56-
},
57-
"response": {
58-
"toolCalls": [
59-
{
60-
"name": "attempt_completion",
61-
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_off\"}",
62-
"id": "call_dsv4_flash_off_done"
63-
}
64-
]
65-
}
66-
},
6737
{
6838
"match": {
6939
"model": "deepseek-v4-pro",
@@ -82,21 +52,6 @@
8252
]
8353
}
8454
},
85-
{
86-
"match": {
87-
"model": "deepseek-v4-pro",
88-
"toolCallId": "call_dsv4_pro_on_read"
89-
},
90-
"response": {
91-
"toolCalls": [
92-
{
93-
"name": "attempt_completion",
94-
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_on\"}",
95-
"id": "call_dsv4_pro_on_done"
96-
}
97-
]
98-
}
99-
},
10055
{
10156
"match": {
10257
"model": "deepseek-v4-pro",
@@ -112,21 +67,6 @@
11267
}
11368
]
11469
}
115-
},
116-
{
117-
"match": {
118-
"model": "deepseek-v4-pro",
119-
"toolCallId": "call_dsv4_pro_off_read"
120-
},
121-
"response": {
122-
"toolCalls": [
123-
{
124-
"name": "attempt_completion",
125-
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_off\"}",
126-
"id": "call_dsv4_pro_off_done"
127-
}
128-
]
129-
}
13070
}
13171
]
13272
}

apps/vscode-e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@roo-code/config-eslint": "workspace:^",
1616
"@roo-code/config-typescript": "workspace:^",
1717
"@roo-code/types": "workspace:^",
18-
"@copilotkit/aimock": "1.15.1",
18+
"@copilotkit/aimock": "1.35.0",
1919
"@types/mocha": "10.0.10",
2020
"@types/node": "20.19.43",
2121
"@types/vscode": "1.100.0",

apps/vscode-e2e/src/fixtures/apply-diff.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function addApplyDiffResultFixtures(mock: InstanceType<typeof LLMock>) {
4646
for (const fixture of fixtures) {
4747
mock.addFixture({
4848
match: {
49-
toolCallId: fixture.toolCallId,
5049
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
5150
},
5251
response: {

apps/vscode-e2e/src/fixtures/cold-shell-init.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ export function addColdShellInitFixtures(mock: InstanceType<typeof LLMock>) {
1919
// second attempt (on the now-warm terminal) captures real output.
2020
mock.addFixture({
2121
match: {
22-
toolCallId: "call_cold_shell_init_001",
23-
predicate: (req: ChatCompletionRequest) =>
24-
// First attempt returned empty — retry the command
25-
!anyToolResultContains(req, "cold-init-ok"),
22+
// Only retry when the FIRST call (call_cold_shell_init_001) produced an empty result.
23+
// If the retry call (call_cold_shell_init_003) also came back empty, don't loop —
24+
// the tool result message says "Do not run the command again automatically."
25+
predicate: (req: ChatCompletionRequest) => {
26+
const messages: ChatMessage[] = Array.isArray(req?.messages) ? req.messages : []
27+
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
28+
return (
29+
lastToolMsg?.tool_call_id === "call_cold_shell_init_001" &&
30+
!anyToolResultContains(req, "cold-init-ok")
31+
)
32+
},
2633
},
2734
response: {
2835
toolCalls: [
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import type { ChatCompletionRequest } from "@copilotkit/aimock"
2+
import { LLMock } from "@copilotkit/aimock"
3+
4+
// Turn-2 completion fixtures for DeepSeek V4 tests.
5+
// Uses lastToolMsg.tool_call_id to scope each fixture — aimock v1.16.4+ changed
6+
// toolCallId matching to require the very last message to be the tool message,
7+
// but Roo Code appends <environment_details> as a user message after tool results.
8+
const turn2Fixtures = [
9+
{
10+
toolCallId: "call_dsv4_flash_on_read",
11+
model: "deepseek-v4-flash",
12+
result: "DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_on",
13+
doneId: "call_dsv4_flash_on_done",
14+
},
15+
{
16+
toolCallId: "call_dsv4_flash_off_read",
17+
model: "deepseek-v4-flash",
18+
result: "DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_off",
19+
doneId: "call_dsv4_flash_off_done",
20+
},
21+
{
22+
toolCallId: "call_dsv4_pro_on_read",
23+
model: "deepseek-v4-pro",
24+
result: "DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_on",
25+
doneId: "call_dsv4_pro_on_done",
26+
},
27+
{
28+
toolCallId: "call_dsv4_pro_off_read",
29+
model: "deepseek-v4-pro",
30+
result: "DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_off",
31+
doneId: "call_dsv4_pro_off_done",
32+
},
33+
]
34+
35+
export function addDeepSeekV4Fixtures(mock: InstanceType<typeof LLMock>) {
36+
for (const fixture of turn2Fixtures) {
37+
mock.addFixture({
38+
match: {
39+
predicate: (req: ChatCompletionRequest) => {
40+
const messages = Array.isArray(req?.messages) ? req.messages : []
41+
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
42+
return req?.model === fixture.model && lastToolMsg?.tool_call_id === fixture.toolCallId
43+
},
44+
},
45+
response: {
46+
toolCalls: [
47+
{
48+
name: "attempt_completion",
49+
arguments: JSON.stringify({ result: fixture.result }),
50+
id: fixture.doneId,
51+
},
52+
],
53+
},
54+
})
55+
}
56+
}

apps/vscode-e2e/src/fixtures/execute-command.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ export function addExecuteCommandResultFixtures(mock: InstanceType<typeof LLMock
8686
for (const fixture of fixtures) {
8787
mock.addFixture({
8888
match: {
89-
toolCallId: fixture.toolCallId,
90-
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
89+
predicate: (req) => {
90+
const messages = Array.isArray(req?.messages) ? req.messages : []
91+
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
92+
return (
93+
lastToolMsg?.tool_call_id === fixture.toolCallId &&
94+
toolResultContains(req, fixture.toolCallId, fixture.expected)
95+
)
96+
},
9197
},
9298
response: {
9399
toolCalls: fixture.toolCalls.map((toolCall) => ({

apps/vscode-e2e/src/fixtures/fast-exit-shell-race.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { toolResultContains } from "./tool-result"
55
export function addFastExitShellRaceResultFixtures(mock: InstanceType<typeof LLMock>) {
66
mock.addFixture({
77
match: {
8-
toolCallId: "call_fast_exit_shell_race_001",
98
// VSCode drops onDidEndTerminalShellExecution for this command (the race under
109
// test), so TerminalProcess.run() only has the D marker itself as proof of
1110
// completion, never a real exit code (see ExecuteCommandTool.ts's

apps/vscode-e2e/src/fixtures/list-files.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export function addListFilesResultFixtures(mock: InstanceType<typeof LLMock>) {
7070

7171
mock.addFixture({
7272
match: {
73-
toolCallId: fixture.toolCallId,
7473
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
7574
},
7675
response: {

apps/vscode-e2e/src/fixtures/long-running-silent-command.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export function addLongRuningSilentCommandFixtures(mock: InstanceType<typeof LLM
1212
// which breaks the loop via DONE_SENTINEL before the 3s idle timer fires.
1313
mock.addFixture({
1414
match: {
15-
toolCallId: "call_long_running_silent_001",
1615
predicate: (req) =>
1716
toolResultContains(req, "call_long_running_silent_001", [
1817
// sleep exits with code 0 — the normal exit status path

apps/vscode-e2e/src/fixtures/read-file.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export function addReadFileResultFixtures(mock: InstanceType<typeof LLMock>) {
7676
for (const fixture of fixtures) {
7777
mock.addFixture({
7878
match: {
79-
toolCallId: fixture.toolCallId,
8079
predicate: (req) =>
8180
isToolResultExpectation(fixture.expected[0])
8281
? toolResultsContain(req, fixture.expected as ToolResultExpectation[])

0 commit comments

Comments
 (0)