Codex should treat canceled or denied tool calls as first-class context
What variant of Codex are you using?
CLI
What feature would you like to see?
Codex should treat canceled or denied tool calls as first-class context.
If a user cancels a command or rejects a tool call, the model should be able to see that event on the next turn, including that the attempted action did not complete successfully. It should not assume side effects happened unless it later verifies them.
It would also help if the UI optionally let the user provide a short reason when rejecting or canceling something, and passed that reason through to Codex as structured feedback. That would let the model pivot directly to the right resolution instead of wasting a turn recovering context.
Additional information
A concrete example from my usage:
- Codex attempted to create a PR with
gh pr create - I canceled the command
- On the next turn, Codex behaved as if the PR might already exist
- I then had to correct course manually
That makes this more than a UX paper cut. It is a reliability/state-correctness issue because Codex can incorrectly assume an external side effect happened even though the user canceled the action.
A good outcome would be:
- canceled / denied / aborted tool calls are visible to the model
- the model can distinguish between "failed", "canceled by user", and "not run"
- side effects from canceled commands are treated as unconfirmed until verified
- the UI can optionally capture a short user reason like "not that wording" or "use a different repo/branch" and pass it through to the model
Related issues:
- #5134
- #5253
I think this issue is slightly broader than either of those on their own: the main request is to preserve cancellation/denial as model-visible context, and the optional user reason is the mechanism that would make recovery much better.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗