Skip to content

Commit d71533a

Browse files
committed
fix(ci): add dedicated fixtures for abandon e2e test and add missing i18n keys
1 parent 6ac268b commit d71533a

36 files changed

Lines changed: 176 additions & 36 deletions

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

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ export const SUBTASK_INTERRUPT_PARENT_PROMPT = `${SUBTASK_INTERRUPT_PARENT_MARKE
2424
export const SUBTASK_INTERRUPT_CHILD_FOLLOWUP_ANSWER = "9"
2525
export const SUBTASK_INTERRUPT_PARENT_RESULT = "Interrupted parent resumed"
2626

27+
// Abandon-subtask scenario (#559) — separate markers to avoid sequenceIndex collisions with the
28+
// interrupted-child-resumes tests above, which exhaust the sequence count for INTERRUPT markers.
29+
const SUBTASK_ABANDON_PARENT_MARKER = "SUBTASK_PARENT_ABANDON_SEVER"
30+
const SUBTASK_ABANDON_CHILD_MARKER = "SUBTASK_CHILD_ABANDON_SEVER"
31+
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.`
32+
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.`
33+
export const SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER = "9"
34+
2735
const SUBTASK_XPROFILE_SAME_CHILD_PROMPT = `${SUBTASK_XPROFILE_SAME_CHILD_MARKER}: Complete immediately with the exact result "Same-profile child completed".`
2836
const SUBTASK_XPROFILE_DIFFERENT_CHILD_PROMPT = `${SUBTASK_XPROFILE_DIFFERENT_CHILD_MARKER}: Complete immediately with the exact result "Different-profile child completed".`
2937
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.`
@@ -354,4 +362,66 @@ export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
354362
],
355363
},
356364
})
365+
366+
// Abandon-subtask scenario (#559)
367+
mock.addFixture({
368+
match: {
369+
userMessage: new RegExp(SUBTASK_ABANDON_PARENT_MARKER),
370+
sequenceIndex: 0,
371+
},
372+
response: {
373+
toolCalls: [
374+
{
375+
name: "new_task",
376+
arguments: JSON.stringify({
377+
mode: "ask",
378+
message: SUBTASK_ABANDON_CHILD_PROMPT,
379+
}),
380+
id: "call_abandon_parent_new_task_001",
381+
},
382+
],
383+
},
384+
})
385+
386+
mock.addFixture({
387+
match: {
388+
predicate: (req: ChatCompletionRequest) =>
389+
requestContains(req, [SUBTASK_ABANDON_CHILD_MARKER]) &&
390+
!requestContains(req, ["call_abandon_child_followup_001"]) &&
391+
!requestContains(req, [`<user_message>\\n${SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER}\\n</user_message>`]),
392+
},
393+
response: {
394+
toolCalls: [
395+
{
396+
name: "ask_followup_question",
397+
arguments: JSON.stringify({
398+
question: "What is the square root of 81?",
399+
follow_up: [{ text: SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER }],
400+
}),
401+
id: "call_abandon_child_followup_001",
402+
},
403+
],
404+
},
405+
})
406+
407+
mock.addFixture({
408+
match: {
409+
predicate: (req: ChatCompletionRequest) =>
410+
toolResultContains(req, "call_abandon_child_followup_001", [SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER]) ||
411+
requestContains(req, ["call_abandon_child_followup_001", SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER]) ||
412+
requestContains(req, [
413+
SUBTASK_ABANDON_CHILD_MARKER,
414+
`<user_message>\\n${SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER}\\n</user_message>`,
415+
]),
416+
},
417+
response: {
418+
toolCalls: [
419+
{
420+
name: "attempt_completion",
421+
arguments: JSON.stringify({ result: SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER }),
422+
id: "call_abandon_child_completion_002",
423+
},
424+
],
425+
},
426+
})
357427
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ 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_ABANDON_CHILD_FOLLOWUP_ANSWER,
9+
SUBTASK_ABANDON_PARENT_PROMPT,
810
SUBTASK_CHILD_FOLLOWUP_ANSWER,
911
SUBTASK_FAST_PARENT_PROMPT,
1012
SUBTASK_INTERRUPT_CHILD_FOLLOWUP_ANSWER,
@@ -649,7 +651,7 @@ suite("Roo Code Subtasks", function () {
649651
autoApprovalEnabled: true,
650652
enableCheckpoints: false,
651653
},
652-
text: SUBTASK_INTERRUPT_PARENT_PROMPT,
654+
text: SUBTASK_ABANDON_PARENT_PROMPT,
653655
})
654656

655657
let childTaskId: string | undefined
@@ -735,7 +737,7 @@ suite("Roo Code Subtasks", function () {
735737
const completedChildTaskId = await waitUntilCompleted({
736738
api,
737739
start: async () => {
738-
await api.sendMessage(SUBTASK_INTERRUPT_CHILD_FOLLOWUP_ANSWER)
740+
await api.sendMessage(SUBTASK_ABANDON_CHILD_FOLLOWUP_ANSWER)
739741
return childTaskId!
740742
},
741743
})

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)