openai / openai/codex

Codex repeatedly wastes tokens and user time on preventable setup mistakes

Open
#38,958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug model-behavior
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

01a00ddb-00b4-7092-9a3a-1e8a225a3a70

What subscription do you have?

01a00ddb-00b4-7092-9a3a-1e8a225a3a70

What platform is your computer?

No response

What issue are you seeing?

While working on a local project, Codex repeatedly provided incorrect instructions for running verification. These failures were not caused by the project code. They occurred because the agent did not inspect the actual repository and environment state before taking action.
Specifically, Codex:
modified a handoff file before committing it, even though the verification gate required it to match HEAD exactly;
failed to account for the current workflow test and an outdated branch name;
instructed me to use a .venv without first checking whether it existed;
attempted Git operations without confirming that its sandbox could write to .git;
repeatedly asked me to rerun a lengthy full verification suite after failures caused by its own preparation mistakes rather than code failures.
As a result, a substantial number of tokens were spent diagnosing and correcting problems created by the agent itself. I also wasted time running unnecessary verification attempts.
The most frustrating issue is that this happens repeatedly: Codex acts on assumptions, encounters a predictable failure, consumes more tokens analyzing it, and only then checks the facts it should have verified beforehand.
Expected behavior:
Before issuing commands, the agent should verify file existence, the available Python interpreter, the current branch and HEAD, Git status, and sandbox restrictions.
Before asking the user to run a full verification suite, it should complete every available fast preflight check.
It should not ask the user to repeat a lengthy verification run when the previous failure was caused by the agent’s own setup mistake.
If Git operations may be blocked, it should determine this before modifying files or proposing a workflow that depends on committing.
Codex should account for token cost and avoid cycles of “assumption → failure → lengthy diagnosis → another assumption.”
Please improve Codex’s preflight reliability and its ability to validate instructions against the actual environment before acting. At present, it regularly wastes tokens and user time on preventable mistakes of its own.

What steps can reproduce the bug?

Feedback ID: 01a00ddb-00b4-7092-9a3a-1e8a225a3a70

What is the expected behavior?

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are identified. Start by reproducing the reported setup failures using feedback ID 01a00ddb-00b4-7092-9a3a-1e8a225a3a70, checking repository state, Python availability, Git permissions, and sandbox restrictions before running verification. Done means Codex performs fast preflight checks and avoids unnecessary full-suite retries after agent-caused setup failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.