Skip to content

Commit 0995ac2

Browse files
author
Bertan Ari
committed
test(e2e-mock): fix flaky subtasks fixture collision and task identity prompt (#561)
1 parent 991130a commit 0995ac2

2 files changed

Lines changed: 12 additions & 3 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": "what is your name"
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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,18 @@ export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
177177
},
178178
})
179179

180+
// Order-safe guard (issue #561): the parent prompt embeds the same-child marker
181+
// verbatim, so the parent's resume turn also contains SUBTASK_XPROFILE_SAME_CHILD_MARKER.
182+
// A bare substring match here (registered before the parent-resume predicate below)
183+
// could capture the parent resume and deliver a new_task-shaped body under
184+
// attempt_completion. Requiring the same-child marker while excluding the parent
185+
// marker fires only for the genuine child turn and lets the parent resume fall
186+
// through to the predicate fixture below.
180187
mock.addFixture({
181188
match: {
182-
userMessage: new RegExp(SUBTASK_XPROFILE_SAME_CHILD_MARKER),
189+
predicate: (req: ChatCompletionRequest) =>
190+
requestContains(req, [SUBTASK_XPROFILE_SAME_CHILD_MARKER]) &&
191+
!requestContains(req, [SUBTASK_XPROFILE_PARENT_MARKER]),
183192
},
184193
response: {
185194
toolCalls: [

0 commit comments

Comments
 (0)