AI AgentsThe Agent That Shipped Every Fix
- #ai-agent
- #orchestration
- #deployment
- #hook
It was a practice project: a month-end closing ERP for a furniture manufacturer and retailer. I handed the work to an orchestrator agent (an agent that splits work across sub-agent sessions), and at 14:15 I set the shipping scope like this:
Commits and deploys are part of this job.
The agent could commit and deploy, but not push. Nothing in that permission said until when.
46
Commit commands
31
Deploy commands
7–16min
From one wording request to the deployed build
304
Messages one orchestrator session received
One line of feedback, one commit, one deploy
The v1 checkout report came in at 16:55. After that I looked at the deployed build and pointed out table titles, alert sentences, and button styles. The agent turned each line of feedback into its own work unit and committed and redeployed for each unit. Those units ran from U17 to U50.
17:29
Alert cut to one sentence
Commit, redeploy
17:32
Table title changed
Commit, redeploy
17:37
Three button and link styles
Commit, redeploy
17:41
Table title changed again
Commit, redeploy
17:44
Numbers removed from titles and alerts
Commit, redeploy
Between 17:29 and 17:44, fifteen minutes, there were five deploys. One wording request took 7 to 16 minutes to show up in the deployed build. Even after I moved to a local address at 20:18, the deployed build was checked six more times.
Nothing stopped it either. The hook that runs before each command reacted only to git commit and git push. The deploy command, wrangler deploy, was out of its scope. The hook asked about commit commands 45 times, and all 45 ran.
304 messages to one orchestrator session
That day, a single orchestrator session received 304 messages: 214 from sub-agents, 18 notifications, and 72 from me. Its context overflowed three times.
The same session also answered the sub-sessions' permission requests. It responded 273 times and denied 8.
| Denied request | Count |
|---|---|
| Deletion | 4 |
| Wide search | 2 |
Write to /tmp | 1 |
| Work already finished | 1 |
The permission had no end point
The 14:15 permission had a scope: commit and deploy, but do not push. It had no end point. So the same permission carried over to the fixes after v1 was handed off, and shipping repeated with every fix request.
Where it worked, three things were in place
Even on that day, one area drew no error reports at all: the month-end calculated values.
| Area | Reference prepared first | Check by someone other than the maker | Script | Result |
|---|---|---|---|---|
| Calculated values | Expected-value table, source code | Independent recalculation by another session (Codex) | verify.mjs | 0 error reports from me |
| Screen wording and elements | None | None | None | 61 messages from me about the screens |
| Shipping | No end point on the permission | None | Hook asked about commits only | 46 commit commands, 31 deploy commands |
For the calculated values, the orchestrator wrote a separate script that checked results using only the seed data and API responses. That script caught a penalty payment missing from customer balances before it was deployed.
Wording had nothing to check against. The instruction to use the accounting terms the finance team uses was passed along only as a sentence. When I checked at 17:02, four of the seven menu words did not appear on a single line of the customer's source documents.
The rule sentences were already there
After a retrospective on November 17, I had added two lines to my agent instructions: look at the user's work first, and ship only when told to. Both lines were in the instructions, and the same pattern still happened that day.
So I did not just add more sentences. I moved the three things that worked for calculated values (a reference prepared first, a check by someone other than the maker, and a script) to the areas that had none.
What I changed
Get an end point with the permission
When shipping is granted as a bundle, the agent records the scope and the end point together. If there is no end point, it asks right then. Shipping after the end point happens only when I ask again.
Fix only until it shows locally
When requests keep coming for a checked-out result, the agent first tells me the local address to look at. Fixes go only as far as what shows at that address.
One line on the shipping queue
No new work unit per request. The agent adds one line to the shipping queue: request time, request text, files changed, and the time it showed locally.
Ship once, when asked
Commits, deploys, doc updates, and logging happen once, when I ask to ship. Requests that change features or data are taken out of this bundle and get a new check-in.
For the other areas, I added three things instead of rule sentences.
- Reference: Before the screens, a word list records the customer source line for each word the screens will use. Words not in the source are my call.
- Another seat: A session other than the one that built it checks how wording and elements are used, before the first result reaches me.
- Hook:
wrangler deployis added to the shipping commands. The hook also catches deletion, writes outside the folder, reverts, and wide searches by name, and either asks or blocks.
That day
Shipping permission with no end point. A unit, a commit, and a deploy for every line of feedback. The hook asked about commits only.
After the change
The permission comes with an end point. Requests are fixed up to the local build and added as one line on the shipping queue. Shipping happens once, when asked. The hook also asks about deploy commands.
When I hand shipping to an agent now, I write down the end point along with the scope.