@@ -126,7 +126,7 @@ export const ORCHESTRATOR_REPEATED_DELEGATION_CHILD_STEPS: readonly Orchestrator
126126
127127export const ORCHESTRATOR_REPEATED_DELEGATION_PARENT_PROMPT = `${ ORCHESTRATOR_REPEATED_DELEGATION_MARKER } : Run exactly three rounds. In each round, delegate exactly three children in order: ask-mode requirements, architect-mode design, then code-mode implementation. Use these exact child messages in order: ${ ORCHESTRATOR_REPEATED_DELEGATION_CHILD_STEPS . map ( ( { prompt } ) => `"${ prompt } "` ) . join ( "; " ) } . After each child returns, resume the parent before creating the next child. After all nine children return, complete with a final summary containing every round and child summary.`
128128
129- export const ORCHESTRATOR_REPEATED_DELEGATION_FINAL_RESULT = `Orchestrator repeated delegation complete:\n${ ORCHESTRATOR_REPEATED_DELEGATION_CHILD_STEPS . map ( ( { round, role, summary } ) => `- Round ${ round } ${ role } : ${ summary } ` ) . join ( "\\ n" ) } `
129+ export const ORCHESTRATOR_REPEATED_DELEGATION_FINAL_RESULT = `Orchestrator repeated delegation complete:\n${ ORCHESTRATOR_REPEATED_DELEGATION_CHILD_STEPS . map ( ( { round, role, summary } ) => `- Round ${ round } ${ role } : ${ summary } ` ) . join ( "\n" ) } `
130130
131131export const ORCHESTRATOR_NESTED_DELEGATION_GRANDCHILD_STEPS : readonly OrchestratorNestedDelegationStep [ ] = [
132132 {
@@ -166,6 +166,8 @@ export const ORCHESTRATOR_NESTED_DELEGATION_PARENT_PROMPT = `${ORCHESTRATOR_NEST
166166export const ORCHESTRATOR_NESTED_DELEGATION_FINAL_RESULT = `Nested top-level orchestrator complete:\n- B: ${ ORCHESTRATOR_NESTED_DELEGATION_CHILD_FINAL_RESULT } `
167167
168168export const ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_ANSWER = "resume recovered cancellation child"
169+ export const ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_TOOL_CALL_ID =
170+ "call_orchestrator_cancellation_child_followup_001"
169171
170172export const ORCHESTRATOR_CANCELLATION_RECOVERY_CHILD_STEP : OrchestratorCancellationRecoveryStep = {
171173 role : "cancellation-child" ,
@@ -232,23 +234,16 @@ function shouldMatchOrchestratorCancellationChildBase(rawRequest: string): boole
232234}
233235
234236export function shouldMatchOrchestratorCancellationChildRequest ( rawRequest : string ) : boolean {
235- const followupToolCallId = ORCHESTRATOR_CANCELLATION_RECOVERY_CHILD_STEP . completionToolCallId . replace (
236- "completion_002" ,
237- "followup_001" ,
237+ return (
238+ shouldMatchOrchestratorCancellationChildBase ( rawRequest ) &&
239+ ! rawRequest . includes ( ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_TOOL_CALL_ID )
238240 )
239-
240- return shouldMatchOrchestratorCancellationChildBase ( rawRequest ) && ! rawRequest . includes ( followupToolCallId )
241241}
242242
243243export function shouldMatchOrchestratorCancellationChildCompletionRequest ( rawRequest : string ) : boolean {
244- const followupToolCallId = ORCHESTRATOR_CANCELLATION_RECOVERY_CHILD_STEP . completionToolCallId . replace (
245- "completion_002" ,
246- "followup_001" ,
247- )
248-
249244 return (
250245 shouldMatchOrchestratorCancellationChildBase ( rawRequest ) &&
251- ( ( rawRequest . includes ( followupToolCallId ) &&
246+ ( ( rawRequest . includes ( ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_TOOL_CALL_ID ) &&
252247 rawRequest . includes ( ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_ANSWER ) ) ||
253248 rawRequest . includes (
254249 `<user_message>\\n${ ORCHESTRATOR_CANCELLATION_RECOVERY_FOLLOWUP_ANSWER } \\n</user_message>` ,
0 commit comments