Scenario 1 · Process-owned orchestration
Process memory owns the agent continuation
This coordinator-worker protocol matches the core subagent pattern. The coordinator delegates bounded work, waits, and combines the results.
The application implements the protocol explicitly. This design exposes state ownership and supports local or remote agent workers.
State owner · Coordinator process
Ask the coordinator for a plan
The coordinator returns two bounded assignments. The application parses that plan before it starts each investigator.
State owner · Coordinator process
Start two investigator threads
The coordinator starts this same call for each assignment. The assignment text is inserted at the top of the investigator prompt.
State owner · Coordinator process
Keep each Codex thread ID
The Codex runner reports a thread ID after the thread starts. The process keeps that ID so later work can resume the same thread.
State owner · Coordinator process
Resume the coordinator with evidence
The application combines both reports with the failing tests. It resumes the coordinator thread to implement the fix.
State owner · Process memory
Kill the process-owned continuation
The snapshot, active joins, and thread IDs live in one process. SIGKILL
removes that orchestration state.
State owner · API supervisor
Restart from the beginning
The supervisor has no durable continuation. It creates a clean workspace and a new initial snapshot.
The failure
The continuation has the wrong owner.
The agent protocol is valid. Process memory holds the active joins and the next step, so a kill removes the continuation.
Move the run into Temporal →