Skip to content

Commit ccd37d1

Browse files
simurg79Bertan Ariedelauna
authored
test(e2e-mock): fix flaky subtasks fixture collision and task identity prompt (#561) (#563)
* test(e2e-mock): fix flaky subtasks fixture collision and task identity prompt (#561) * test(e2e): updating subtask text fixture pattern --------- Co-authored-by: Bertan Ari <bertanari@microsoft.com> Co-authored-by: Elliott de Launay <edelauna@gmail.com>
1 parent 991130a commit ccd37d1

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

apps/vscode-e2e/fixtures/task-hello-world.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"fixtures": [
33
{
44
"match": {
5-
"userMessage": "Hello world, what is your name? Respond with 'My name is ...'"
5+
"userMessage": "TASK_HELLO_WORLD_SMOKE"
66
},
77
"response": {
88
"toolCalls": [
99
{
1010
"name": "attempt_completion",
11-
"arguments": "{\"result\":\"My name is Zoo! I'm your AI coding assistant, here to help you with development tasks.\"}",
11+
"arguments": "{\"result\":\"My name is Zoo.\"}",
1212
"id": "call_task_hello_world_001"
1313
}
1414
]

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,13 @@ export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
177177
},
178178
})
179179

180+
// Issue #561: parent prompt embeds SAME_CHILD_MARKER verbatim, so parent-resume turns
181+
// also match a bare substring check. Exclude the parent marker to let them fall through.
180182
mock.addFixture({
181183
match: {
182-
userMessage: new RegExp(SUBTASK_XPROFILE_SAME_CHILD_MARKER),
184+
predicate: (req) =>
185+
requestContains(req, [SUBTASK_XPROFILE_SAME_CHILD_MARKER]) &&
186+
!requestContains(req, [SUBTASK_XPROFILE_PARENT_MARKER]),
183187
},
184188
response: {
185189
toolCalls: [
@@ -212,6 +216,8 @@ export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
212216
},
213217
})
214218

219+
// Safe as bare regex: DIFFERENT_CHILD_MARKER is NOT embedded in SUBTASK_XPROFILE_PARENT_PROMPT,
220+
// so parent-resume turns never contain it. If that ever changes, add an exclusion predicate.
215221
mock.addFixture({
216222
match: {
217223
userMessage: new RegExp(SUBTASK_XPROFILE_DIFFERENT_CHILD_MARKER),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ suite("Roo Code Task", function () {
2121

2222
const taskId = await api.startNewTask({
2323
configuration: { mode: "ask", alwaysAllowModeSwitch: true, autoApprovalEnabled: true },
24-
text: "Hello world, what is your name? Respond with 'My name is ...'",
24+
text: "TASK_HELLO_WORLD_SMOKE: what is your name?",
2525
})
2626

2727
await waitUntilCompleted({ api, taskId })

0 commit comments

Comments
 (0)