Repository navigation
Interruptions keep what they owe: lookout news a wait never returned, a refused memory cleanup cut short - #777
Conversation
…turned it (K05) The lookout dropped a task's turn from the lead's news the moment the lead's wait tool started on its handle. A wait that then failed (one bad handle, an unowned process or a turn waiting on itself fails it whole) or was cancelled, or whose turn the person stopped, returned nothing, and the lead never heard how that turn ended. What a wait reads is now held by its call: dropped once the call completes, put back as news when it completes failed, cancelled, denied or with an unknown outcome, or when the lead's turn ends with it still open. Held news keeps the lookout's saved floor, so a lookout restart replays it. Tasks gone meanwhile are not put back. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 848b11756e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A cleanup the loss guard refuses reverts its commit, then puts back what other agents saved or removed while it was open. A finish killed between the two left the marker behind; the next finish found memory already back at the cleanup's start, read no loss, and closed it as a clean cleanup, dropping the other agents' facts for good and moving the person's-words cursor as if the cleanup had landed. The refusal is now written to the marker before memory goes back, and the next finish carries it on: memory back to the start while what others wrote is still listed (or the refused commit is still the newest), then the put-back, then the marker. Going back reads the start's tree with read-tree rather than reverting one commit, so each step can run again. Daemon test: a parked task reaped after its turn resumed as a new task leaves the new task owning the bot and its slot, and sets no wake-up. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b80510e6e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Another turn of the lead's ending while a wait runs (a steer it took, a queued turn stopped) drained every held wait, so a wait that then returned left its turns as news told twice. Each held wait now keeps the lead turn it runs in, and only that turn's end puts it back. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
…t fails A turn the lookout did not see start waits in unheard until who asked is read. When a wait held it and who asked was read meanwhile, asked_by found nothing to update and the asker was never read again, so a failed wait put the turn back in unheard for good. asked_by now settles a held entry where the wait keeps it (and a held forward's asker), and a failed wait tells it as asked_by would have. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9ca602d54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… a refused cleanup goes back once A reply read with who asked, while a wait of the lead's holds the turn, now stays with the held turn, so a failed or cancelled wait tells it with its reply, and an automation's run no longer waits again for a reply already read. A refused memory cleanup now records in .cleanup that memory went back to its start, so a finish cut short after it put back other agents' saves never resets again over a list begun later. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4b7b7a09f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
asked_by now names a turn's end held in a wait's news (a task with no subscription rules), so a failed wait tells it as put would: an automation's run that said nothing stays no news, and the person's own turn stays theirs. A trigger's answer passed on while a wait holds its turn's forward drops the held forward too, so a failed wait does not announce it again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1047fddd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… owners' saves are put back A cleanup start that finds a refusal cut short now closes it, as finish would, and answers loss_guard, where it handed the cleanup on to carry on and finish then left that run's new removals in place. Once a cleanup is refused, its own agents' saves are listed and put back like the others'. The cleanup skill says to stop for the night on that answer. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGH2pLHh19AigAztgFd
Conflicts in lookout/updates.rs (the goal hold beside #777's wait reads: the goal parts go, the wait reads stay) and asks.rs (#776's reading of an ask, with said_by_person now in reactions). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
These fixes came out of the 11-07 state machine audit. Its interruption scenarios were used as a test plan: four of six already had tests, and one of the two missing ones was broken.
1. Lookout: a turn a lead's wait read is news again if the wait never returned it (K05)
What was wrong. The lookout dropped a task's turn from the lead's news the moment the lead's
waittool started on its handle (sonny/src/lookout/mod.rs,tool_started→Updates::read). If the wait handed nothing over, the lead never heard how the turn ended:parkinsrc/server/turn.rs).What changes. What a wait reads is held by its call in
Updates::waits:tool_completedwithoutfailed,cancelled,outcome_unknownordenieddrops the held news.tool_completedwith any of those flags, or the lead'sturn_finishedwhile a wait is still open, puts it back.untold), so a lookout restart replays it.Test:
a_wait_that_failed_or_was_cancelled_hands_its_turns_back_as_news.2. Memory: a refused cleanup cut short is carried on (C10)
What was wrong. The loss guard reverts a cleanup, then puts back what other agents saved or removed while it was open (
put_back). Afinishkilled between those two steps left.cleanupbehind. The nextfinishfound memory already back at the start, read no loss, and closed it as a clean cleanup. That silently dropped the other agents' facts and moved.saidas if the cleanup had landed. The new test reproduces this on main: the rerun returns success withremoved: [], and agent 8's fact is gone.What changes.
head,lost,before,limit) is written to.cleanupbefore memory goes back.finishcarries the refusal on: back to the start while others' writes are still listed (or the refused commit is still the newest), thenput_back, then the marker.git read-tree -u --reset STARTinstead ofgit revert HEAD, so each step can run again. The two are equivalent here, since nothing commits betweencleanup startandfinish.Test:
a_refusal_cut_short_is_carried_on_and_keeps_what_others_saved. It fails on main and passes here. The other 23 memory tests are unchanged and pass.3. Daemon test: a parked task reaped after its turn resumed (A04)
There is no behavior change. The new test
a_parked_task_reaped_after_its_turn_resumed_leaves_the_new_task_in_placepins the guard inService::complete: a predecessor's latePaced/Parkedexit leaves the new task owning the bot and its slot, and sets no wake-up. Removing thea.task == taskcheck makes the test fail.Checks
cargo test -p sonny --bin sonny: 1110 passedcargo test -p agent-client --lib: 110 passedcargo test --bin agent a_parked_task_reaped: passcargo clippy --workspace --all-targets -D warnings: cleanDocs:
docs/LOOKOUT.md,docs/SONNY.md, and twosonny/FEATURES.mdentries.🤖 Generated with Claude Code