Repository navigation
An attached note waits at most a day, then goes as a steer - #609
Conversation
The footer's 📎 said a note would come with the agent's next call: an open loop the person could not close without typing, for words that ask nothing of them (George, 11-01). Attached notes are now passive, as a muted iOS notification or a muted Slack channel: no clip, no count, and the folded 📎 row under what a call carried, once the agent reads them, stays as #535 drew it. The App's attached and reaction_turn bookkeeping went with the clip. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
An attach never started a turn and never expired, so an idle agent could hold one forever and senders could not count on it being read. Submit now takes `wait_ms` with `attach` (protocol 45): once no call has taken the note in by then, the daemon delivers it as a steer sent then would, joining the running turn or starting a turn of its own, and its `queued` event says `lapsed`. Rows keep their wait and due time (schema 76, a partial index on the due attached rows); the run loop looks when the first is due. The daemon keeps no default. The agent CLI and Sonny's trigger notes send `attach_wait` from config.toml, a day unless it says otherwise, "0" for no limit; `agent run --attach-wait` sets one note's. Sonny says nothing when a note lapses, and the coordination skill tells leads attach notes arrive within a day. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
# Conflicts: # sonny/FEATURES.md # sonny/README.md # sonny/src/main.rs
Codex Review SummaryThis 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: dc3554d116
ℹ️ 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 look cloned every active turn's steer flag to arm the few it delivers; it now reads the due bots first and takes only theirs, arming any that came due in between once the job is back. A deleting bot's due note kept `next_due` in the past while `lapse` passed it over, so the timer fired empty at once, over and over; the deadline now uses the sweep's own test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03b9da59ac
ℹ️ 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".
The query-plan screen counts a scan of a subquery as a table scan; the bots come back in due order and are made distinct in Rust instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 708c64e84a
ℹ️ 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".
…tried A lapse job that hit a storage error stopped the daemon through the run loop's ?, ending every running turn for one due note. A look now writes its batch in one savepoint, so a refused write leaves every note attached and due, and the loop looks again after the storage backoff that ready turns use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
What
An
attachnever started a turn and never expired. An idle agent could hold one forever, and an agent told that would stop using attach. Now an attach waits at mostattach_wait(a day by default). If no call has taken it in by then, it goes as a steer: it joins the running turn at its next boundary, or starts a turn of its own on an idle bot.George's pick (11-01): a daemon cap with a Sonny/CLI default of 1 day,
0meaning never, and a per-message override. The default lives in config.toml as a top-levelattach_wait, not[daemon], because docs/CLI.md says the daemon keeps no delivery default and clients send what they resolved.Changes
Daemon (protocol 45, schema 76)
submittakeswait_mswithattachonly (invalid_deliveryotherwise). It must be 1 ms to 365 days, otherwiseinvalid_wait.turns.wait_msandturns.due_msare new columns, with a partial indexturns_dueon due attached rows. A migration adds the columns. Notes already waiting keep no limit.Database::next_dueandDatabase::lapse. Each due row becomesdelivery='steer'. It goesqueuedif the bot has a turn running or ready,readyif the bot is idle. It commits with aqueuedevent carryinglapsed: true, and counts as pending from then on. A retry of the original request is still read as the attach it was, andwait_msis compared like any other field.lapsestimer, planned at start and lowered on submit. The next due time is read on the writer after each look, so no submission is missed. While draining, the timer is skipped.lift,wake_for_steerandready_hintare applied.Clients
client/src/config.rs: top-levelattach_wait("1d"default,"0"for never, at most365d). AlsoConfig::attach_wait(), plusduration_ms, whichsrc/cli.rsnow reuses.agent run --attach-wait DURATION. It falls back to config.toml, then1d. Using it without--delivery attachis a usage error.Docs: docs/CLI.md, docs/RUST_PROTOTYPE.md, README.md, sonny/README.md and sonny/FEATURES.md are updated.
Why steer and not queue
When a note lapses, its sender has waited long enough, so it is delivered the way a message sent now would be. A steer is what the latency thread made the agent-to-agent default. A queued turn would sit behind the bot's own work and could wait again.
Testing
cargo test --workspacepasses.cargo clippy --workspace --all-targetsandcargo fmt --checkare clean.ready, and a second lapsed note waits behind it for the first boundary;wait_ms;AGENT_TEST_RUNTIME=1):test_deliverycovers refusals, a lapse on an idle bot starting a turn, and a lapse joining a running turn;test_clicovers--attach-waitusage errors and a 200 ms wait running end to end.