File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ]
Original file line number Diff line number Diff 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 : [
You can’t perform that action at this time.
0 commit comments