Codex Stalls on a Merge Conflict or Resolves It the Wrong Way
Codex hits conflict markers and either stops, picks the wrong side, or hand-edits the markers into the file. Pre-rebase setup.sh and explicit AGENTS.md rules fix it.
Articles tagged with #Codex
Codex hits conflict markers and either stops, picks the wrong side, or hand-edits the markers into the file. Pre-rebase setup.sh and explicit AGENTS.md rules fix it.
Codex edits package.json but never ran npm install, so package-lock.json diverges. How to enforce lockfile updates via setup.sh, CI, and AGENTS.md.
Codex defines a fresh User or ApiResponse type when an identical one lives elsewhere. How to make the agent search first via AGENTS.md, indexes, and ts-morph.
Codex ran git commit --amend or interactive rebase from an old README, rewriting shared history. How to lock the agent to forward-only commits.
Codex emits a one-line PR body with no detail. How to force a structured description with before/after, why, and test plan via templates and AGENTS.md.
Codex reports green tests but the failing cases were filtered out, marked .skip, or bailed early. How to force honest test reporting before merge.
Codex hits a context or token cap mid-task and stops with a partial diff. How to scope tasks smaller, split across PRs, or move to a larger-context model.
Codex outputs API patterns deprecated years ago because its training data is dated. How to lock it to modern APIs via AGENTS.md, ESLint deprecation rules, and reference docs.
Codex ran git commit on whatever branch was checked out — sometimes main, sometimes a leftover branch from the previous task. How to force a clean per-task branch.
Codex's PR is green in CI — every test passes — but the app crashes in staging. Why agent fixes that target the test surface miss the runtime, and how to close the gap.
Two strong models, two different shapes of PM work. Here is the side-by-side on PRDs, JIRA grooming, and doc cleanup.
Codex writes a file, Prettier reformats it on save, and now the diff is huge. Fix by running Prettier inside the agent loop and aligning agent style hints to your .prettierrc.
On 500k+ line codebases Codex loses track halfway. Fix by scoping the working set, using directory summaries, and forcing the agent to read AGENTS.md before scanning.
Codex silently skips PNGs, PDFs, sqlite DBs, compiled artifacts. The fix is allowlisting text extensions, hashing binaries instead of reading, and giving Codex a binary-aware tool.
Codex re-reads the same file 8 times and re-greps the same query 5 times. Fix by pre-feeding context, requiring a plan first, and capping reads via tool restrictions.
Codex halts halfway through a multi-step task with no visible failure — usually a context window, sandbox timeout, or stop-condition issue. Diagnose by checking the last tool call and turn budget.
A complete Codex keyboard shortcut reference for the terminal TUI, desktop app, input editing, session control, mode switching, background tasks, and failure cases.
A complete Codex skills guide: what a skill is, how /skills discovery works, how to invoke skills, how to write SKILL.md, and how built-in, plugin, and custom skills differ.
"unable to clone" — usually the Codex GitHub App isn't installed on the org, the repo isn't in its allowlist, or your OAuth token expired.
Setup script bails before Codex can touch code — usually Node/Python version mismatch, private registry auth, or a slow install hitting the sandbox timeout.
50 files, 1500 lines, nobody can review it. Cap diff size at the prompt + AGENTS.md level; split refactors into shippable chunks.
What Codex does, how it runs sandboxed cloud tasks, and when to use it. Setup, the spin-off workflow, and the mistakes that bite first-time users.
Use Codex as a pre-review pair — catches issues before humans see them.
Use Codex to spot-check sitemap correctness, freshness, and coverage.
You asked Codex for an audit; got a 50-bullet report mixing typos with architecture. Re-scope by dimension, cap output size, force file:line.
Codex stops mid-patch — broken imports, half-converted types, untouched call sites. Bind "done" to a verifier, not a vibe.
Codex creates `utils.v2.ts` next to `utils.ts` instead of editing in place. Force in-place edits with explicit AGENTS.md rules + git as the safety net.
Codex skips the build, misreads the output, or trusts a truncated tail. Use machine-readable verifiers + exit codes, not prose summaries.
The reported bug is gone, two adjacent features regressed. Cap blast radius, enumerate call sites, prefer caller-side guards over shared-util changes.
New files land in `/src/` when your repo uses `/app/`; deps go to the root `package.json` in a monorepo; tests use a framework you don't have. Fix with AGENTS.md + canonical-example pointers.
Codex confidently uses a column that doesn't exist, an env var with the wrong shape, or a function signature it never read. Force quote-before-write grounding.
Codex uses `getUserById` when your codebase uses `findUserById`. Codify each convention as `rule + canonical example` in AGENTS.md.
"Patch hunk failed to apply" — file moved between Codex's read and write. Refresh state, normalize whitespace, or split the patch.
"Consider error handling" / "add tests" — bullets that work on any PR. Fix with specific review questions tied to file:line.
Functionally correct but reads like a stranger wrote it — async/await mixed with .then(), wrong import ordering, comment style off. Anchor to a canonical file + enforce with lint.
"Test happy path and error path" — useless in 2026. Force tests bound to the function's actual signature, edge cases, and bug history.
Codex creates files in the wrong place or with wrong conventions — constrain with AGENTS.md and explicit refs.
Keep AI agents on-spec for multi-file website work with this CLAUDE.md template, 3-part prompt structure, and per-task constraint pattern.
Use Codex (or any code-aware AI agent) for a technical SEO review with copy-paste prompts, dist/ inspection commands, and a structured-data validator.
OpenAI Codex and Anthropic Claude Code are both AI coding agents — but they live in different places and solve slightly different problems. Here's a clear comparison.