r/ChatGPTCoding • u/Ok_Negotiation_2587 • Oct 03 '26
Discussion Coding agents say "fixed" when they mean "I changed the code"
Read the last message of an agent session closely. "Fixed the race condition." "The endpoint now returns the right status." "This should resolve the timeout." Then scroll up and look for the command that proves it. Often there isn't one. It edited the file, read its own edit, found it convincing, and reported the result as if it had run it.
It's not lying exactly. From where it sits, a change that looks right and a change that works are the same thing unless something forces it to check. And "fix this bug" doesn't force it to check.
What I add to the task:
Before you say anything is fixed, run [the command that failed] and paste the exact output. If you didn't run something, write "not verified" next to that claim.
And as a rule in the instructions file:
Never use the words fixed, works, resolved, or done unless the same message shows the command you ran and its output.
The second one changes the tone of the whole session. Claims get smaller and more specific, and when it can't run something (no DB locally, needs a real API key), it says so instead of quietly skipping it.
And the one I run at the end, before I review the diff:
List every claim you made in this session that something works or is fixed. For each one, show the command and output that proved it, or mark it unverified.
The unverified list is the useful part. It's usually 2 or 3 items, and those are exactly where I'd have trusted the summary and moved on.
One more detail: "run the tests" often turns into running only the test file it touched. If it matters, name the command for the full suite.
For bugs I debug in ChatGPT or Claude in the browser instead of the terminal, the end-of-session prompt is saved in AI Toolbox, the extension I build, so it's one // away instead of retyped.
3
u/Interesting-Law-8815 Oct 05 '26
Simple. NEVER trust the agent to test it. Use deterministic tests
3
u/Quick_Dog_7971 Oct 05 '26
The rule holds right up to the point where the bug doesn't reproduce locally. I've had an agent run the exact failing command, paste a green result, and still be wrong: the race only shows under load, the timestamp only breaks in UTC+7, the bad row only exists in prod. The run proved the code, not the bug.
Two things that fixed it for us:
2
u/magicmulder Oct 03 '26
Each of my apps has a pre_deploy.sh that runs a local CI pipeline (unit tests, static analysis etc.), and my AGENTS.md specifies that a task is not done until that run passes.
2
u/bshivarthy Oct 04 '26
OfferBeginning1903's stash-and-red-first is the strongest version of this thread. I'd push it one step past what anyone's said: stop trusting pasted output entirely.
pasted command output is model-generated text. I watched an agent paste a plausible test run that never happened, it had just filled in what it expected to see. no rule about pasting catches that, because the paste looks exactly like a real one. the fix we landed on was boring. the harness runs the verification command itself and stores the exit code against the diff hash. the agent can say whatever it wants in chat, "fixed" only counts when there's a machine row tying that diff to a green run.
it also kills the incentive problem. pasting output is cheaper than running it, so of course the agent pastes.
2
u/Sufficient-Storage87 Oct 04 '26
this is why i never trust the agent's own verdict. my setup: agent works in a sandbox, then i grade the result against hidden tests it never saw. "fixed" is a claim, the test suite is the verdict. across my rounds the agents that sounded most confident weren't always the ones that actually passed.
2
u/tianyes Oct 04 '26
Same rule here, plus one gap a passing run won't cover: the thing the user actually sees. We had a "page is live" check pass on a site that returns 200 and the homepage for any URL. We also had an analytics view keep showing believable numbers for a post that had gone private. So for anything that ships, done means opening the real output, the live page or the actual row, not just a green run.
2
u/xqianliu Oct 04 '26
The unverified list at the end is a good one. What I found though is that even a real green run doesn't tell you the agent tested the right thing. I had a batch of 38 changes that passed the agent's own review and still failed. 22 broke stuff that already worked, 7 only handled the exact example in the issue, 9 ignored a repo convention for the changelog. Telling the reviewer "check for regressions" did basically nothing. What helped was making the agent that wrote the code also generate tests for the whole class of inputs, not just the reported case, and write down how many it ran. Then a separate review session checks those counts against the diff. Much easier to spot when a number doesn't add up than when it just says fixed.
2
u/ImL1s Oct 03 '26
Yeah — "looks right in the diff" is not the same as "the failing command is green."
The sticky version for us was: the same reply that says fixed has to paste the exact command that previously failed and its new output. No paste → write "not verified."
Still misses the green-but-wrong-path case. Naming which assertion covers the bug in that same message closed most of those.
2
u/Right-Performance-93 Oct 03 '26
the unverified list is a good idea. i do a lighter version, i just make it paste the exact test command it ran next to every summary. no command, i dont believe the summary
2
u/goodevibes Oct 04 '26
The last line reads like a merge commit and the scroll up has zero proof. I started requiring a failing command then a passing one in the same session before I trust fixed. Agents love narrating the edit. They are quieter about rerunning what broke.
2
u/[deleted] Oct 03 '26
[removed] — view removed comment