{"slug": "our-hook-told-the-agent-it-was-wrong-it-said-no-three-times", "title": "Our Hook Told the Agent It Was Wrong. It Said No, Three Times.", "summary": "A developer building Since, a CLI hook that checks files immediately after a coding agent writes them, found the hook silently failed on the exact case it was designed to catch: a model ID lookup took 3.2 seconds against a 3-second timeout, so version 0.5.0 said nothing, fixed in 0.5.1 eight minutes later with a 6-second wait. In a follow-up benchmark, a small fast model received the correction note and declined to apply it three times, citing a fabricated filename, a mismatch between the dated model ID and the short alias in its code, and no source to verify the suggested replacement.", "body_md": "**Our first hook had a 3 second budget. The check it ran took 3.2 seconds. So for one version of our CLI, the feature worked perfectly and said nothing about the exact thing it was built to catch.**\n\nThat was the easy bug. The hard one came a few hours later, when the hook finally spoke up, and the coding agent listened carefully, thought about it, and declined.\n\nThree times.\n\nThe idea is simple. When a coding agent writes a file, a hook runs right after. Since checks the file, and if the agent just wrote something already dead, like a model ID that was retired last month, the agent hears about it on the spot, with what to write instead.\n\nNot after the build fails. Not in code review. On the line it just wrote.\n\nThe rules we gave ourselves:\n\nThat last rule is where the first bug lived.\n\nThe agent's hook contract gives you a timeout. We picked 3 seconds for our own wait, because a hook that makes your agent feel sluggish gets uninstalled.\n\nBefore shipping, we'd already spent an evening on speed. A one-file check took 1.75 seconds in production, and when we counted, the read made 15 database queries one after another, each waiting on the last for no good reason. We ran the independent ones together and stopped reading the same row twice, and a one-file check went from about 20 sequential round trips to 11.\n\nThen we measured the real thing, end to end, through the real CLI:\n\n| What the agent just wrote | End to end | \n|---|---|\n| A file naming only a package | 0.8 s | \n| A file with a model ID, seen before in another session | 2.0 s | \n| A file with a model ID, first time | 3.2 s | \n\nThe fast cases were fine. The case the whole feature exists for, a model ID the agent just wrote, came in at 3.2 seconds. Our hook gave up at 3.\n\nSo version 0.5.0 did exactly what we designed: when Since is slow, say nothing rather than stall the agent. It said nothing about the one thing we built it to catch. We published 0.5.1, with a 6 second wait, eight minutes after 0.5.0.\n\nLesson one, cheap and obvious in hindsight: measure the case you care about, not the average case. The average was great.\n\nNext, we wanted proof the note actually changes what an agent writes. We have a benchmark that asks coding models everyday questions and checks whether their answers use things that are already retired. We added a hook arm: the model answers, the hook checks the files it wrote, and if something is proven wrong, the model gets the note and one turn to revise.\n\nWe ran it on a small, fast model first. The note arrived. The model read it. And three times, it left the retired model ID exactly where it was.\n\nHere's the part I didn't expect: it explained itself each time. No hallucinated compliance, no ignoring us. It gave reasons. Good ones.\n\nHere's what the note looked like back then (this one is the example from our CLI's own tests):\n\n```\nSince.dev checked what was just written and found:\n- src/llm.ts:3: gpt-3.5-turbo on OpenAI API: retirement 2026-10-23. Use gpt-5.6-terra. Write: export const ask = (q) => client.chat.completions.create({ model: \"gpt-5.6-terra\", messages: [{ role: \"user\", content: q }] });\n```\n\nRead it as a careful engineer would. It's a list of facts. The instruction, \"Use gpt-5.6-terra,\" is buried in the middle, after a date. There's no source. And there's no ask.\n\n**Reason one: \"That file doesn't exist.\"** The note named a file the benchmark had made up, `src/file1.py`, because the model's answer hadn't named its files and our harness invented a placeholder. The model looked at its own answer, saw no such file, and reasonably concluded the note was about something else.\n\n**Reason two: \"I didn't write that.\"** The note named the dated model ID, while the code used the short alias. To us those are the same model. To a careful reader, the note was complaining about a string that didn't appear anywhere in the code.\n\n**Reason three: \"I can't verify that.\"** The note said to use a replacement, with no source. The model had no way to check that the replacement was real, so it kept what it knew. Which, honestly, is the behavior you'd want from an agent when a stranger's message tells it to change a model ID.\n\nEach of those is a bug in the note, not in the model. The model was doing exactly what we'd want it to do with a vague, unsourced, slightly wrong message.\n\nWe changed four things:\n\nAnd in the benchmark, files are named the way the answer named them, and the model has Since's lookup tools available (with no rule telling it to use them), so if it doubts a replacement, it can check.\n\nThe same example, rewritten:\n\n```\nSince.dev checked what was just written and found:\n- src/llm.ts:3: replace gpt-3.5-turbo here with gpt-5.6-terra. gpt-3.5-turbo on OpenAI API: retirement 2026-10-23. Write: export const ask = (q) => client.chat.completions.create({ model: \"gpt-5.6-terra\", messages: [{ role: \"user\", content: q }] }); Source: https://developers.openai.com/api/docs/deprecations\nFix each one before you go on.\n```\n\nSame facts. Different order, one link, one sentence at the end.\n\nOn the same 8 cases, the revisions went from 1 clean to 7 clean.\n\nI had been writing the note for a human skimming a terminal: facts first, the eye finds the fix. An agent doesn't skim. It reads every word, takes them literally, and weighs them against what it can see. A note that names a file it can't find, or a string it didn't write, isn't a weak signal to an agent. It's evidence the note is wrong.\n\nWhich means a message to an agent is closer to an API than to a log line. It needs to be exact, it needs to say what to do, and it needs to show its work.\n\nWhat's the most reasonable excuse a coding agent has given you for not doing what you asked?\n\n*I'm Nabil. I build [Since](https://since.dev?utm_source=devto), which tracks what your code depends on and tells you before it breaks.*", "url": "https://wpnews.pro/news/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times", "canonical_source": "https://dev.to/nabil_since_dev/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times-54f", "published_at": "2026-11-22 23:30:00+00:00", "updated_at": "2026-11-22 23:41:39.271542+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Since", "Since.dev", "OpenAI", "gpt-3.5-turbo", "gpt-5.6-terra"], "also_reported_by": [], "takeaway": "A post-write hook that times out silently on its slowest path (3.2s check vs a 3s budget) catches nothing, and correction notes naming placeholder files, mismatched aliases, or unsourced replacements get rejected by agents — so measure the target case end to end and make notes verifiable.", "recommendation": {"advice": "Budget hook timeouts for your slowest real check, not the average, and write correction notes that name the exact file and string the agent wrote plus a verifiable source for the fix.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times", "markdown": "https://wpnews.pro/news/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times.md", "text": "https://wpnews.pro/news/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times.txt", "jsonld": "https://wpnews.pro/news/our-hook-told-the-agent-it-was-wrong-it-said-no-three-times.jsonld"}}