Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions apps/vscode-e2e/fixtures/deepseek-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@
]
}
},
{
"match": {
"model": "deepseek-v4-flash",
"toolCallId": "call_dsv4_flash_on_read"
},
"response": {
"toolCalls": [
{
"name": "attempt_completion",
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_on\"}",
"id": "call_dsv4_flash_on_done"
}
]
}
},
{
"match": {
"model": "deepseek-v4-flash",
Expand All @@ -49,21 +34,6 @@
]
}
},
{
"match": {
"model": "deepseek-v4-flash",
"toolCallId": "call_dsv4_flash_off_read"
},
"response": {
"toolCalls": [
{
"name": "attempt_completion",
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_off\"}",
"id": "call_dsv4_flash_off_done"
}
]
}
},
{
"match": {
"model": "deepseek-v4-pro",
Expand All @@ -82,21 +52,6 @@
]
}
},
{
"match": {
"model": "deepseek-v4-pro",
"toolCallId": "call_dsv4_pro_on_read"
},
"response": {
"toolCalls": [
{
"name": "attempt_completion",
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_on\"}",
"id": "call_dsv4_pro_on_done"
}
]
}
},
{
"match": {
"model": "deepseek-v4-pro",
Expand All @@ -112,21 +67,6 @@
}
]
}
},
{
"match": {
"model": "deepseek-v4-pro",
"toolCallId": "call_dsv4_pro_off_read"
},
"response": {
"toolCalls": [
{
"name": "attempt_completion",
"arguments": "{\"result\":\"DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_off\"}",
"id": "call_dsv4_pro_off_done"
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion apps/vscode-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@roo-code/config-eslint": "workspace:^",
"@roo-code/config-typescript": "workspace:^",
"@roo-code/types": "workspace:^",
"@copilotkit/aimock": "1.15.1",
"@copilotkit/aimock": "1.35.0",
"@types/mocha": "10.0.10",
"@types/node": "20.19.43",
"@types/vscode": "1.100.0",
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/apply-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export function addApplyDiffResultFixtures(mock: InstanceType<typeof LLMock>) {
for (const fixture of fixtures) {
mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
},
response: {
Expand Down
15 changes: 11 additions & 4 deletions apps/vscode-e2e/src/fixtures/cold-shell-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ export function addColdShellInitFixtures(mock: InstanceType<typeof LLMock>) {
// second attempt (on the now-warm terminal) captures real output.
mock.addFixture({
match: {
toolCallId: "call_cold_shell_init_001",
predicate: (req: ChatCompletionRequest) =>
// First attempt returned empty — retry the command
!anyToolResultContains(req, "cold-init-ok"),
// Only retry when the FIRST call (call_cold_shell_init_001) produced an empty result.
// If the retry call (call_cold_shell_init_003) also came back empty, don't loop —
// the tool result message says "Do not run the command again automatically."
predicate: (req: ChatCompletionRequest) => {
const messages: ChatMessage[] = Array.isArray(req?.messages) ? req.messages : []
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
return (
lastToolMsg?.tool_call_id === "call_cold_shell_init_001" &&
!anyToolResultContains(req, "cold-init-ok")
)
},
},
response: {
toolCalls: [
Expand Down
56 changes: 56 additions & 0 deletions apps/vscode-e2e/src/fixtures/deepseek-v4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { ChatCompletionRequest } from "@copilotkit/aimock"
import { LLMock } from "@copilotkit/aimock"

// Turn-2 completion fixtures for DeepSeek V4 tests.
// Uses lastToolMsg.tool_call_id to scope each fixture — aimock v1.16.4+ changed
// toolCallId matching to require the very last message to be the tool message,
// but Roo Code appends <environment_details> as a user message after tool results.
const turn2Fixtures = [
{
toolCallId: "call_dsv4_flash_on_read",
model: "deepseek-v4-flash",
result: "DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_on",
doneId: "call_dsv4_flash_on_done",
},
{
toolCallId: "call_dsv4_flash_off_read",
model: "deepseek-v4-flash",
result: "DEEPSEEK_V4_MARKER_deepseek_v4_flash_reasoning_off",
doneId: "call_dsv4_flash_off_done",
},
{
toolCallId: "call_dsv4_pro_on_read",
model: "deepseek-v4-pro",
result: "DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_on",
doneId: "call_dsv4_pro_on_done",
},
{
toolCallId: "call_dsv4_pro_off_read",
model: "deepseek-v4-pro",
result: "DEEPSEEK_V4_MARKER_deepseek_v4_pro_reasoning_off",
doneId: "call_dsv4_pro_off_done",
},
]

export function addDeepSeekV4Fixtures(mock: InstanceType<typeof LLMock>) {
for (const fixture of turn2Fixtures) {
mock.addFixture({
match: {
predicate: (req: ChatCompletionRequest) => {
const messages = Array.isArray(req?.messages) ? req.messages : []
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
return req?.model === fixture.model && lastToolMsg?.tool_call_id === fixture.toolCallId
},
},
response: {
toolCalls: [
{
name: "attempt_completion",
arguments: JSON.stringify({ result: fixture.result }),
id: fixture.doneId,
},
],
},
})
}
}
10 changes: 8 additions & 2 deletions apps/vscode-e2e/src/fixtures/execute-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ export function addExecuteCommandResultFixtures(mock: InstanceType<typeof LLMock
for (const fixture of fixtures) {
mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
predicate: (req) => {
const messages = Array.isArray(req?.messages) ? req.messages : []
const lastToolMsg = messages.filter((m) => m?.role === "tool").at(-1)
return (
lastToolMsg?.tool_call_id === fixture.toolCallId &&
toolResultContains(req, fixture.toolCallId, fixture.expected)
)
},
},
response: {
toolCalls: fixture.toolCalls.map((toolCall) => ({
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/fast-exit-shell-race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { toolResultContains } from "./tool-result"
export function addFastExitShellRaceResultFixtures(mock: InstanceType<typeof LLMock>) {
mock.addFixture({
match: {
toolCallId: "call_fast_exit_shell_race_001",
// VSCode drops onDidEndTerminalShellExecution for this command (the race under
// test), so TerminalProcess.run() only has the D marker itself as proof of
// completion, never a real exit code (see ExecuteCommandTool.ts's
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/list-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function addListFilesResultFixtures(mock: InstanceType<typeof LLMock>) {

mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
},
response: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function addLongRuningSilentCommandFixtures(mock: InstanceType<typeof LLM
// which breaks the loop via DONE_SENTINEL before the 3s idle timer fires.
mock.addFixture({
match: {
toolCallId: "call_long_running_silent_001",
predicate: (req) =>
toolResultContains(req, "call_long_running_silent_001", [
// sleep exits with code 0 — the normal exit status path
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/read-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export function addReadFileResultFixtures(mock: InstanceType<typeof LLMock>) {
for (const fixture of fixtures) {
mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) =>
isToolResultExpectation(fixture.expected[0])
? toolResultsContain(req, fixture.expected as ToolResultExpectation[])
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/search-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export function addSearchFilesResultFixtures(mock: InstanceType<typeof LLMock>)

mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
},
response: {
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/terminal-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function addTerminalProfileResultFixtures(mock: InstanceType<typeof LLMoc
for (const fixture of fixtures) {
mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
},
response: {
Expand Down
2 changes: 0 additions & 2 deletions apps/vscode-e2e/src/fixtures/terminal-reuse-shell-race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function addTerminalReuseShellRaceFixtures(mock: InstanceType<typeof LLMo
// With the temp-script fix, both commands now deliver real output.
mock.addFixture({
match: {
toolCallId: "call_terminal_reuse_001",
predicate: (req) => toolResultContains(req, "call_terminal_reuse_001", ["first", "Exit code: 0"]),
},
response: {
Expand All @@ -26,7 +25,6 @@ export function addTerminalReuseShellRaceFixtures(mock: InstanceType<typeof LLMo
// Second command on the reused terminal also completes.
mock.addFixture({
match: {
toolCallId: "call_terminal_reuse_002",
predicate: (req) => toolResultContains(req, "call_terminal_reuse_002", ["second", "Exit code: 0"]),
},
response: {
Expand Down
4 changes: 3 additions & 1 deletion apps/vscode-e2e/src/fixtures/use-mcp-tool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { LLMock } from "@copilotkit/aimock"

import { toolResultContains } from "./tool-result"

const TEST_DIR_NAME = "use-mcp-tool-fixture"
const FILESYSTEM_SERVER_NAME = "filesystem"
const READ_FILE_RELATIVE_PATH = `${TEST_DIR_NAME}/mcp-read-target.txt`
Expand Down Expand Up @@ -99,7 +101,7 @@ export function addUseMcpToolResultFixtures(mock: InstanceType<typeof LLMock>) {

mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, []),
},
response: {
toolCalls: [
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/write-to-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function addWriteToFileResultFixtures(mock: InstanceType<typeof LLMock>)
for (const fixture of fixtures) {
mock.addFixture({
match: {
toolCallId: fixture.toolCallId,
predicate: (req) => toolResultContains(req, fixture.toolCallId, fixture.expected),
},
response: {
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-e2e/src/fixtures/zero-chunk-shell-race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { toolResultContains } from "./tool-result"
export function addZeroChunkShellRaceResultFixtures(mock: InstanceType<typeof LLMock>) {
mock.addFixture({
match: {
toolCallId: "call_zero_chunk_shell_race_001",
// The multiline command is now written to a temp script file and executed
// via `sh /tmp/roo-cmd-*.sh` to avoid the VSCode { ... }-wrapping bug that
// caused the stream to be closed before read() arrived (zero chunks).
Expand Down
2 changes: 2 additions & 0 deletions apps/vscode-e2e/src/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { runTests } from "@vscode/test-electron"
import { LLMock } from "@copilotkit/aimock"

import { addApplyDiffResultFixtures } from "./fixtures/apply-diff"
import { addDeepSeekV4Fixtures } from "./fixtures/deepseek-v4"
import { addExecuteCommandResultFixtures } from "./fixtures/execute-command"
import { addFastExitShellRaceResultFixtures } from "./fixtures/fast-exit-shell-race"
import { addZeroChunkShellRaceResultFixtures } from "./fixtures/zero-chunk-shell-race"
Expand Down Expand Up @@ -127,6 +128,7 @@ async function main() {
addSubtaskFixtures(mock)
addUseMcpToolResultFixtures(mock)
addWriteToFileResultFixtures(mock)
addDeepSeekV4Fixtures(mock)

// The modes test (switch_mode → ask) triggers a second API call whose last
// user message starts with <environment_details> directly — no <user_message>
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading