Problem
When Codex delegates work to an external process, it cannot suspend its turn and resume automatically when that process finishes.
The manager must either:
- Poll repeatedly for a completion artifact, consuming context and producing unnecessary tool traffic.
- End the turn and depend on the user to manually check progress and send another message.
This makes long-running agent-manager workflows inefficient and unnecessarily user-dependent.
Requested Feature
Add a suspend-and-resume mechanism that lets Codex wait for an external completion signal without keeping the active turn running.
Example API:
wait_for:
type: file
path: /path/to/some_file.md
timeout: 2h
Other useful signal types:
- File creation or modification
- Process
- Command exit
- Webhook event
- Scheduled time
- MCP resource change
When the signal occurs, codex should automatically resume the suspended task with its existing context and notify the user.
Expected Behavior
- Codex delegates a long-running task.
- Codex registers a completion signal.
- The current turn suspends without polling.
- No model context or compute is consumed while waiting.
- The external process continues independently.
- Codex resumes when the signal occurs or the timeout expires.
- Codex reviews the result and continues the workflow.
Why It Matters
This would improve:
- Multi-agent orchestration
- Long builds and test suites
- Deployment monitoring
- File-based task queues
- Human approval workflows
- Context efficiency
- Reliability of unattended development tasks
Workaround
The current workaround is to end the turn and ask the user to manually send another message when the completion artifact appears. This avoids polling but prevents autonomous continuation.