gitmyhub

codex-516-fix

★ 48 updated 1mo ago

A single AGENTS.md configuration file that gives OpenAI Codex stricter reasoning rules to stop it from jumping to wrong answers on tricky logic puzzles.

AGENTS.mdCodexsetup: easycomplexity 1/5

This is a configuration workaround, not a code project. It addresses a bug reported in an OpenAI Codex issue where the gpt-5.5 model, even set to its highest reasoning effort, sometimes skips its visible reasoning step and jumps straight to a final answer, giving a wrong result on certain logic puzzles.

The bug report used a specific puzzle: reaching into a bag of candies that differ in shape, so you can tell shapes apart by touch, and figuring out the minimum number you must pull out to guarantee a matching pair. The correct answer, 21, requires noticing that shape can be told apart by touch. When Codex fails, it treats the puzzle as an ordinary blind draw instead and answers 29. Failed runs' logs consistently show a specific reasoning token count around 516, and a related issue found that Codex's reasoning token counts tend to cluster around fixed numbers such as 516, 1034, and 1552, with the 516 cluster linked to worse performance on hard tasks.

This project does not patch Codex itself and does not change model routing or reasoning budgets internally. Instead it ships a single file, AGENTS.md, containing stricter problem analysis rules that you place either inside one project, to affect just that project, or in Codex's global config folder, to affect every project. Once loaded, Codex reads these rules as behavior instructions.

It is meant for tasks like algorithm problems, logic puzzles, weighing and sorting problems, edge case problems, and anything needing a worst case guarantee, especially where a condition like "can be told apart by touch or sight" is easy to miss. It can also help with analyzing or restructuring written content, though it was not built for open ended creative writing.

To check whether the fix is working, you can rerun the original candy puzzle. If Codex correctly uses the touch distinguishable condition, it answers 21; if it still answers 29, the fix has not taken effect for that case.

The project is a single AGENTS.md file plus an Apache-2.0 license, nothing more.

Where it fits