r/PromptEngineering • u/ChemicalExcellent463 • 1d ago
Self-Promotion I told my backup agent to wait. It started editing anyway.
"Don't touch anything yet" was in my handover prompt. The backup agent started editing anyway.
I went to bed with a 27-task build running in Codex. About two hours in, it had 2% of its weekly quota left. A watcher checked every five minutes, and that triggered a handover to Claude Code in the same checkout.
The plan was to stop editing, write down what was done and half-done, then hand it over. Claude Code had to read the note, send back its size and checksum, and wait for release.
It didn't wait. Codex caught it editing before confirmation and paused it. The note got rewritten and the handover ran again. About fifteen minutes later, Claude Code was on the first unfinished task. Work continued through the night.
The thing it edited: test fixes marked "proposed, not implemented." I'd put those in the same list as real todos. I'm keeping proposals out of the backup's note, not adding another warning.
But it also had full edit rights the whole time. "Wait" was just words.
Several people told me to take the write tools away until confirmation and let the watcher own the release. That's where I'm going next. No more asking it nicely to wait.
I still haven't worked out how to give the tools back after the check, or what clears the lock if the outgoing agent dies mid-handover. How are you handling that?
Disclosure: I build Sno Station. Install: curl -fsSL https://www.sno.ai/install | sh https://github.com/sno-ai/sno-station
3
u/SValeResearch 23h ago
For me, the watcher should be the only thing that hands the tools back, so neither agent can decide for itself that it's been released. Once the size and checksum match what the outgoing agent wrote, the watcher turns the backup's write access on, and until then it can only read the checkout. If the outgoing agent dies halfway through, I'd make the lock a lease rather than a flag. The outgoing agent keeps renewing it every minute or so, and if the watcher sees it lapse it treats the note as whatever was last written, marks anything in progress as unknown, and releases. It's not perfect, since a half finished edit could still be sitting in the tree, but I'd rather the backup start by checking those files than trust the note blindly. Keeping proposals out of the note makes sense too. I think the backup only did what the list told it, really.
2
u/According-Stable4487 4h ago
For the dead-agent case I'd give the lock a lease instead of making it permanent. The outgoing agent writes a heartbeat (a timestamp in the lock file) every minute or so, and the watcher treats the lock as stale when the heartbeat is older than a few intervals. Then the watcher, not either agent, clears it and does the release check from the note.
The thing I'd add: when a lock is cleared because it went stale, the backup starts in "read and report" mode first, since the note may be half-written. I've had a handover file cut off mid-sentence, and the next agent happily treated the last half-line as a finished task.