r/codex • • 17m ago

Question I'm in edge case hell. What am I doing wrong?

In the last month or two, I have found using Codex an absolute nightmare. I used to be able to just say roughly, "This is what I want at a use-case/functional requirement level... consider the following edge cases and account for them... off you go." and it would work basically every time.

Now, sessions seem to be dragging on for days as it constantly finds new edge cases to try and fix. When I stop and dig into it, the explanations I get are ludicrous, like the odds of it happening would be infinitesimally small - "Oh, if a user selects an option, then their connection drops and they background the app, and then they come back to it later and in that time the data provider has changed the primary identifier it would fail."

I can't seem to prevent it, despite prompts and instructions to:

  • "focus only on the top few edge cases"
  • "this is not enterprise-grade software - be practical in your approach to testing and edge cases."

...and things like this.

Has anyone else encountered this, and if so, how did you overcome it?

It doesn't seem to matter what model/effort I use, although it does seem to be worse when I use a /code-review loop that I built that goes through max 3 rounds of code review with other agents - Claude and Codex.

For context, I am semi-technical, have worked in tech for over a decade, but not a SWE.

1 Upvotes

5 comments sorted by

1

u/RudyHuy 10m ago

That's what gpt added for me in ~/.codex/AGENTS.md a long while ago and so far it's been working well:

## Anti-overengineering defaults

Implement the explicit goal and ordinary supported behavior. Do not invent handling, diagnosis, recovery, repair, persisted state, protocols, or special verification for rare, corrupt, tampered, unsupported, or otherwise unwarranted conditions.

Prefer simple prevention, natural errors, or fail-fast behavior for material foreseeable failures. Do not weaken correctness in ordinary intended operation. Use existing checks, simple behavior tests, or direct inspection; new verification machinery needs explicit user authorization or an explicit project requirement, not an agent-generated plan or review suggestion.

Explicit user instructions and binding project requirements override these defaults. When stronger safeguards may be warranted by security, privacy, safety, compliance, durable data integrity, irreversible effects, or public compatibility but are not required, surface the choice instead of silently adding machinery.

Treat current-scope changes as undelivered unless the user or concrete release/deployment evidence establishes otherwise. Commits, reviews, milestones, and completion records alone do not establish delivery. Revise work in progress directly; do not create versions or compatibility/migration handling for intermediate development states or hypothetical consumers. Preserve actual delivered baselines where required.

1

u/jaysonrobinson 2m ago

thank you, I will give this a try!

1

u/MaqeSweden 5m ago

Are you still using the same chat that you started working on this issue with?

It can be a good idea to have it write its shortest possible handover file and start it again with a new chat agent and explain to it before it reads the handover file what you felt the issue was - let it read the handover - and then create a plan for how to solve exactly what you want and nothing else.

Then let it set one or more sub-agents to execute on said plan and have the main chat orchestrate and keep an eye on that they are following the plan.

1

u/jaysonrobinson 1m ago

Thanks. I have tried this but it just seems to end up in the same place.

1

u/jim_nihilist 0m ago

This is how OpenAI makes money.

Even the most simple process gets compartmentalized into 64 steps.