Repository navigation
Hold turns on causes a person can fix, and bounce final failures to their sender - #633
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
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
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
…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
…heir sender A turn whose provider sign-in, key, usage limit or reachability fails is held instead of failed: on a call it parks with its cause as `blocked`, at its start it keeps its place in line (`turn_held`), and either tries again on its own, waiting longer each try up to an hour, with no time it gives up. `agent held` lists them, `agent retry` (op `retry_held`) tries them now, `agent login chatgpt` and a starting daemon do it on their own. Sonny shows held work under needs you with the fix, and its lookout hands a message whose turn still ends failed back to the agent that sent it. Protocol 47, schema 78. 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
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: fc69b038f6
ℹ️ 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".
…un's start across retries, and bounce across a lookout restart A held turn a restart resumed without its provider failed at the provider lookup; it is held there too now. An ordinary retry park between holds forgot when the run of holds began, so the next hold waited a minute again; the park keeps `held_since_ms`. The lookout's replay floor now keeps a turn that carries another agent's message, so a lookout started again still sees it end and bounces it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
…used signature is held 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: ecca760be1
ℹ️ 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".
…ars no failure does not swallow one A bounce is held as a failed fire's note is: its turn's start and end stay in the replay floor until the daemon takes it, so a lookout that drops its connection or restarts tells it again under the same request id. A sender's own subscription keeps its bounce from it only when its filters let that turn's end through. 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: bcf614f872
ℹ️ 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".
…all's park as before; bounce ids stay bounded A turn resumed at a model call without its provider is held with what its park kept (route, fallback, a summary's copy). One resumed from a park on a call the model made has that call's continuation, which a park at a model call cannot keep, so it ends with provider_unavailable as before. A bounce's request id is the turn and a digest of who, so long names cannot push it past the daemon's limit. 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: 4ad52cd6c1
ℹ️ 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 turn that starts running without its provider was let in by a start that found it, so it fails as before; the hold is for a park this daemon resumed after a restart without the provider. Fixes the server tests that end turns through a missing provider. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
… turn fails with its cause George asked whether holding forever is a problem when nobody fixes the cause: the bot's later messages wait behind its held turn for good. As mail is retried four to five days before it is returned, a turn is now held for its bot's `hold_ms` (`--hold`, `hold` in config.toml, 5 days unset, up to 365 days, 0 fails at once) from when the hold began, then fails with its cause, which Sonny bounces to its sender. It also makes the hold a caller's choice, as src/AGENTS.md asks of a daemon default. 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: 65f9754150
ℹ️ 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 suppression check built its own turn.ended event without who asked or whether it resolved its task, so a filter on by or resolved judged a different event than the one delivered. It now reads who asked from the turn the lookout just saw end and builds the same turn_event. 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: 013e71d5b1
ℹ️ 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 event loop decided who to bounce to before it handed the event to the lookouts, so a sender's lookout had not yet seen the end it was asked about and every watching lead got a bounce as well as its task update. The senders are now read before delivery and checked after it. A runtime test covers a lead's own failed message (task update only) and another lead's (bounce). 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: 31685b720a
ℹ️ 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 reconnect let go of every turn under way on a bot that ran nothing, so a message to it still ready or held lost its start from the floor, and a later restart lost its sender before it could bounce. A turn carrying another agent's message is kept on a bot the listing still shows, until its own end. 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
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: d13c73a7d8
ℹ️ 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 next try waited the backoff alone, a minute at least, so a short hold_ms held a turn well past its limit. The wait is now no later than when the hold ends, for the bot's turn on a call and for a held start, and that last try works or fails the turn with its cause. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu
Why
George asked what happens to a message an hour or a day old when its provider fails: the person who could fix it may not be watching, and it was not their message. This follows the delivery design he approved (all four decisions): mail and job queues hold what a fixable cause stops, tell someone what to fix, and return to the sender only what is truly undeliverable.
What changes
Daemon (protocol 47, schema 78)
provider_quota_exhausted, HTTP 401/403, and any retryable error past its attempts or the retry budget (an outage). It parks as a pace park withblocked: {code, detail?, since_ms}onturn_pacedand in the turn view, so held time counts inpaced_ms.provider_unavailableorworkspace_requiredstaysreadyin line (newturns.heldcolumn,turn_heldevent) and its bot's later turns do not overtake it.hold_ms(--hold DURATION,hold = "5d"in~/.agent/config.toml) defaults to 5 days, as mail is retried for 4–5 days, and can be at most 365 days. The last try comes when the hold ends; if it fails, the turn fails with its cause.0fails at once. No agent tool changes.held(list) andretry_held(optionally by bot). A starting daemon tries every held turn at once.budget_exhaustedandturn_budget_exhaustedstay final: nothing raises either cap, so holding would wait forever.CLI
agent held,agent retry [--bot NAME].agent login chatgptretries held turns once it signs in.--prettyprints⏸ held: CODE …with the way out.Sonny
/statusunder Needs you asheld: WHY, plus one alert per cause naming the waiting agents and the fix (sign in, edit~/.agent/env, add the provider to config).Docs
Tests
hold_ms0 fails where another would hold, a short hold tries once more at its end and then fails, a held turn resumed without its provider stays held, and a lookout runtime test checks that a lead's own failed message produces only the task update while another lead's produces a bounce.cargo test --workspacepasses, and so does the full runtime suite, except the tests that need bubblewrap (test_trigger, test_acp, test_served). Bubblewrap is missing in this container, and those tests pass on CI.The matched Perf screen is in docs/DAEMON_MEASUREMENTS.md under "Held turns (#633)". No daemon row moved past noise.