Background task management for codex - seeking approval to submit PR
Resolved 💬 1 comment Opened Nov 8, 2025 by leoisadev1 Closed Nov 8, 2025
Hey team! I've built a feature that lets AI agents run background tasks so they can do multiple things at once, and wanted to get approval before submitting a PR (per the contributing guidelines).
The problem this solves
Right now when the AI runs a command, it blocks until that command finishes. This is a problem for:
- Starting dev servers (blocks the AI from making code changes while server runs)
- Running long builds while continuing to work on other tasks
- Monitoring logs while deploying
- Running tests in background while writing more code
What I built
A background task management system that allows the AI to:
- Start shell commands in the background (e.g.,
npm run devkeeps running while AI does other work) - Check output from background tasks anytime using
bash_outputtool - Kill background tasks when done using
kill_shelltool - View all active background tasks via TUI (Ctrl+B shows list of running tasks)
Implementation details
- Built on Tokio for async process management
- Resource limits: max 20 concurrent tasks, 10k line output buffer per task
- Clean process cleanup when task/session ends
- Full test coverage (12 tests)
- Hex-based shell IDs for easy reference
This is related to #3968 - enables the same workflow where AI can start long-running processes and continue working.
Would you be open to reviewing a PR for this?
Thanks!
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗