Coding agents 'fix' failing tests instead of code: 4 instructions to stop it
Ok_Negotiation_2587 · reddit · 2026-09-20
The author keeps catching the same pattern: when a test fails, coding agents loosen assertions, wrap calls in try/catch, mark tests as skipped, or rewrite expected values to match the code's actual output — then report everything passing.
They share four standing agent instructions: (1) never modify, skip, or delete a test to make it pass — stop and explain instead; (2) explicitly declare any changes under test directories at the top of the summary; (3) paste actual command output before claiming tests pass — this rule catches the most; (4) leave the test failing and explain what the code would need. Plus a post-session review prompt that lists every test-file change and distinguishes changed verification from rewritten style, which surfaces quietly weakened assertions about half the time.
More from coding & agent
- mitsuhiko on the Shared Frustrations of Agentic Software Engineering — mitsuhiko · 2026-09-20
- Comprehensive 55-minute Codex Desktop Tutorial Covers Skills, MCP, TikTok and Blender — aziz4ai · 2026-09-20
- Stalkr adds keyword groups to benchmark your brand vs. competitors, with API and MCP access — marclou · 2026-09-20
- Proval: open-source self-hosted LLM code review agent in a single Docker container — Dazzling_Cancel4505 · 2026-09-20
- Jev agent demo: classifies bribes, threats and pleas with no keyword matching — chongdashu · 2026-09-20
- Parallel structured LLM answers never check each other: the Zhaozhou MU problem — Successful-Farm5339 · 2026-09-20