Use a long-running agent to chase a stubborn bug
A developer let Codex work overnight against a repeatable test, using debug prints and hypotheses to track down an unexplained bug.
- What they did
- They started Codex on a bug they could not easily explain and left it running for hours. Beforehand, they made sure there was a deterministic unit test that hit the problem through the app’s normal entry point. From there, the agent did the repetitive work: adding temporary logging, checking ideas, and rerunning the test.
- How it went
- The write-up does not give a count or a named fix. The developer said this was a very good fit for the agent and that they use it regularly, though it does not say how often it actually reaches the root cause.
- Tips
- This works best when the test gives the agent a clear pass/fail signal to compare against. Have it stop and ask before any irreversible change, and make sure temporary prints are removed afterward.
Try it yourself with Codex
I have a bug in [project] that I can reproduce with [test name or path]. Investigate it by forming likely causes, adding temporary debug output where useful, and rerunning the test after each change. Use only the app’s normal entry path and keep going until you can explain the root cause with evidence from the test output. Before you make any irreversible change, such as deleting code, submitting a patch, or altering behavior, pause and ask for my approval. When you are done, list the debug output you added and remove it unless I approve keeping it. Then propose the smallest fix you think would address the bug, with a brief explanation of why.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Run agent coding jobs in a sealed local box
A developer used Codex to run an almost fully self-contained build-and-deploy workflow on a locked-down spare machine.
Build internal real estate tools with Codex
A rental owner used Codex to make custom tools for offer pricing, property reports, and contract tracking.
Monitor account caps and move chats across tools
teivz built a local app that watches Codex and Claude Code account usage and shifts a chat to another account when one reaches its cap.
Create and launch a BaZi reading agent
A developer used coding agents to build a BaZi reader that calculates charts, writes interpretations, and handles language detection and USDT payments.
Turn tracked tickets into pull requests
Use an agent to pick up issues or tickets, make the code change in an isolated pod, and open a PR for review.
Use a coding agent to fix a Slack-reported bug
A Codex agent handled a Slack issue on its own, and an ops agent later confirmed the fix in the same thread.