Skip to content

Commit 06dfb4e

Browse files
committed
fix(ci): add dedicated fixtures for abandon e2e test and add missing i18n keys
1 parent ab989dd commit 06dfb4e

36 files changed

Lines changed: 177 additions & 37 deletions

apps/vscode-e2e/src/fixtures/subtasks.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ export const SUBTASK_API_HANG_RESUME_MESSAGE = "Continue after provider hang."
3232
export const SUBTASK_API_HANG_CHILD_RESULT = "Hung child completed"
3333
export const SUBTASK_API_HANG_PARENT_RESULT = "API hang parent resumed"
3434

35+
// Abandon-subtask scenario (#559) — separate markers to avoid sequenceIndex collisions with the
36+
// interrupted-child-resumes tests above, which exhaust the sequence count for INTERRUPT markers.
37+
const SUBTASK_ABANDON_PARENT_MARKER = "SUBTASK_PARENT_ABANDON_SEVER"
38+
const SUBTASK_ABANDON_CHILD_MARKER = "SUBTASK_CHILD_ABANDON_SEVER"
39+
const SUBTASK_ABANDON_CHILD_PROMPT = `${SUBTASK_ABANDON_CHILD_MARKER}: Ask the user exactly this follow-up question: What is the square root of 81? After the user answers, complete with only the answer.`
40+
export const SUBTASK_ABANDON_PARENT_PROMPT = `${SUBTASK_ABANDON_PARENT_MARKER}: Use the new_task tool exactly once. Create an ask-mode subtask with this exact message: "${SUBTASK_ABANDON_CHILD_PROMPT}" Do not answer directly.`
41+
export const SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER = "9"
42+
3543
const SUBTASK_XPROFILE_SAME_CHILD_PROMPT = `${SUBTASK_XPROFILE_SAME_CHILD_MARKER}: Complete immediately with the exact result "Same-profile child completed".`
3644
const SUBTASK_XPROFILE_DIFFERENT_CHILD_PROMPT = `${SUBTASK_XPROFILE_DIFFERENT_CHILD_MARKER}: Complete immediately with the exact result "Different-profile child completed".`
3745
export const SUBTASK_XPROFILE_PARENT_PROMPT = `${SUBTASK_XPROFILE_PARENT_MARKER}: First use new_task to create a code-mode subtask with this exact message: "${SUBTASK_XPROFILE_SAME_CHILD_PROMPT}" After it returns, create an ask-mode subtask with the next instructions you receive.`
@@ -437,4 +445,66 @@ export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
437445
],
438446
},
439447
})
448+
449+
// Abandon-subtask scenario (#559)
450+
mock.addFixture({
451+
match: {
452+
userMessage: new RegExp(SUBTASK_ABANDON_PARENT_MARKER),
453+
sequenceIndex: 0,
454+
},
455+
response: {
456+
toolCalls: [
457+
{
458+
name: "new_task",
459+
arguments: JSON.stringify({
460+
mode: "ask",
461+
message: SUBTASK_ABANDON_CHILD_PROMPT,
462+
}),
463+
id: "call_abandon_parent_new_task_001",
464+
},
465+
],
466+
},
467+
})
468+
469+
mock.addFixture({
470+
match: {
471+
predicate: (req: ChatCompletionRequest) =>
472+
requestContains(req, [SUBTASK_ABANDON_CHILD_MARKER]) &&
473+
!requestContains(req, ["call_abandon_child_followup_001"]) &&
474+
!requestContains(req, [`<user_message>\\n${SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER}\\n</user_message>`]),
475+
},
476+
response: {
477+
toolCalls: [
478+
{
479+
name: "ask_followup_question",
480+
arguments: JSON.stringify({
481+
question: "What is the square root of 81?",
482+
follow_up: [{ text: SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER }],
483+
}),
484+
id: "call_abandon_child_followup_001",
485+
},
486+
],
487+
},
488+
})
489+
490+
mock.addFixture({
491+
match: {
492+
predicate: (req: ChatCompletionRequest) =>
493+
toolResultContains(req, "call_abandon_child_followup_001", [SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER]) ||
494+
requestContains(req, ["call_abandon_child_followup_001", SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER]) ||
495+
requestContains(req, [
496+
SUBTASK_ABANDON_CHILD_MARKER,
497+
`<user_message>\\n${SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER}\\n</user_message>`,
498+
]),
499+
},
500+
response: {
501+
toolCalls: [
502+
{
503+
name: "attempt_completion",
504+
arguments: JSON.stringify({ result: SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER }),
505+
id: "call_abandon_child_completion_002",
506+
},
507+
],
508+
},
509+
})
440510
}

apps/vscode-e2e/src/suite/subtasks.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import { RooCodeEventName, type ClineMessage } from "@roo-code/types"
55
import { setDefaultSuiteTimeout } from "./test-utils"
66
import { sleep, waitFor, waitUntilCompleted } from "./utils"
77
import {
8-
SUBTASK_API_HANG_CHILD_RESULT,
8+
SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER,
9+
SUBTASK_ABANDON_PARENT_PROMPT,
910
SUBTASK_API_HANG_CHILD_MARKER,
11+
SUBTASK_API_HANG_CHILD_RESULT,
1012
SUBTASK_API_HANG_PARENT_MARKER,
1113
SUBTASK_API_HANG_PARENT_PROMPT,
1214
SUBTASK_API_HANG_PARENT_RESULT,
@@ -801,7 +803,7 @@ suite("Roo Code Subtasks", function () {
801803
autoApprovalEnabled: true,
802804
enableCheckpoints: false,
803805
},
804-
text: SUBTASK_INTERRUPT_PARENT_PROMPT,
806+
text: SUBTASK_ABANDON_PARENT_PROMPT,
805807
})
806808

807809
let childTaskId: string | undefined
@@ -887,7 +889,7 @@ suite("Roo Code Subtasks", function () {
887889
const completedChildTaskId = await waitUntilCompleted({
888890
api,
889891
start: async () => {
890-
await api.sendMessage(SUBTASK_INTERRUPT_CHILD_FOLLOWUP_ANSWER)
892+
await api.sendMessage(SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER)
891893
return childTaskId!
892894
},
893895
})

webview-ui/src/i18n/locales/ca/chat.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/ca/history.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/chat.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/history.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/es/chat.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/es/history.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/chat.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/history.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)