Add blocking commands back optionally
What variant of Codex are you using?
CLI
What feature would you like to see?
Originally all Codex CLI interactions were blocking, until the optional experimental background tasks feature was added. Since then, this has been made the default, and AFAIK the option to disable has been removed.
This is proving extremely difficult for many of my projects. I have quite a few builds and test suites which take a long time to run, think 10 minutes upwards of a few hours. This never used to be a problem, but these days, the agents constantly poll them. Firstly, this wastes tokens, but secondly, I find they nearly always get impatient and end up self sabotaging, trying stupid tricks to speed up the process, stopping and restarting them. I just need them to be blocked until the process finishes. Its thousands of source files compiling, it just needs to wait.
It would be nice to reintroduce the option to disable background tasks. Or even better, add a filter list of blocking commands, so I could make known long executions like cmake, ctest, waiting for CI through MCPs, block, but preserve the current background task behaviour for other tasks.
Especially with 5.4, it is painful watching Codex constantly fidgeting and compromising long running commands.
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I think this issue can be addressed with a relatively small runtime change.
I suggest adding an optional field to
exec_command, for example:The default would be
false, so existing behavior stays unchanged.Proposed semantics
When
wait_until_exit = true:exec_commandkeeps waiting until one of the following happens:When
wait_until_exit = false:Design split
The responsibilities can be separated cleanly:
wait_until_exitThat keeps the execution primitive and the command-selection policy separate.
High-level implementation shape
At a high level, this seems fairly localized:
exec_commandExpected tests
If this direction is acceptable, I think the minimum test coverage would be:
wait_until_exit = truewaits until process completionwait_until_exit = truedoes not convert the command into a background sessionIf maintainers think this direction makes sense, I’d be happy to help refine the implementation boundaries further in-thread.
This feature request hasn't received enough upvotes, so it is being closed automatically. If you still feel this feature is needed, please open a new feature request with an updated title and description.