Event-driven background task callbacks
Open 💬 2 comments Opened Jul 16, 2026 by xyjigsaw
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
Please allow Codex CLI to start a background process and return the session to idle. Waiting should require no model calls or token usage.
When the process exits, Codex should automatically notify and resume the original thread with its exit code and output. If another turn is active, the event can be queued until that turn finishes.
Desired flow:
Start background task → session becomes idle → zero-token waiting → task exits → original thread wakes up → Codex continues automatically
Claude Code references:
- Background Bash commands (https://code.claude.com/docs/en/interactive-mode#background-bash-commands)
- Scheduled tasks and Monitor (https://code.claude.com/docs/en/scheduled-tasks)
- Background task completion notifications (https://code.claude.com/docs/en/agent-sdk/python#tasknotificationmessage)
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The flow described here — idle during wait, zero-token waiting, auto-resume with exit code and output, queue-if-turn-active — exists as a working implementation, currently in production soak. Mechanism discussion (why stock drops the completion today, cited to lines) and implementation status are on the older, deeper-scoped #32188: https://github.com/openai/codex/issues/32188#issuecomment-4998087054. Flagging so subscribers here can follow the main thread.