48-Hour Field Notes: The Receipt That Ended Mid-Brace
The worker log ended on a comma. Not a stack trace, not a timeout banner, just a trailing comma and then the same INSERT running again. I was on hour three of a borrowed coding box, watching a webhook worker “fix itself” by doing the side effect twice. The setup was ordinary. A small HTTP handler accepted a delivery, wrote a row, and enqueued a follow-up job. An agent loop was supposed to patch a parser bug. It had a file-write tool, a shell tool, and a test command. The free remote server was useful because I did not want that loop chewing through a billed workstation while I traced a flake. Disclosure: This article was prepared as part of MonkeyCode's product outreach. I parked the notebook on MonkeyCode’s free server option and used its free model access — the project currently describes a complimentary 10 million token allowance — so the experiment could sit overnight without attaching it to a paid cluster. That is the only product detail this write-up depends on. The failure mode itself is older than any one assistant. Hour 0–8: the queue looked guilty The first chart I trusted was the wrong one. Two jobs appeared for one delivery_id . The broker UI showed two publishes a few hundred milliseconds apart. I blamed at-least-once delivery, because that is the story every webhook tutorial trains you to expect. I added a unique constraint and watched the second write die on UNIQUE . The HTTP layer still returned 201 for both attempts. The agent, reading a truncated tool result from the first write, treated the missing closing brace as “the patch did not land” and issued the mutating call again. That is the analogy I kept returning to. A cashier prints half a receipt. The customer cannot see the order number, so they pay again. The register did nothing wrong after the first commit. The paper was cut too early. Hour 8–20: prove the cut, not the feeling I stopped arguing with the queue and recorded the tool payload as raw bytes. The command was boring on purpose. python