Skip to content

Sonny: words attached to a call hang under what it carried, as a 📎 row - #535

Merged
lydakis merged 4 commits into
mainfrom
claude/project-thread-tmrmyw
Oct 31, 2026
Merged

lydakis merged 4 commits into
mainfrom
claude/project-thread-tmrmyw

Conversation

@lydakis

@lydakis lydakis commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

🤖 Generated with Claude Code

George saw attached submissions drawn "as if I had sent two things". A note delivered with submit's attach (an automation that found the agent busy, an agent's --delivery attach, and until #537 a commons reply) joins the agent's next model call and has no turn of its own. Sonny drew it as a ↳ From … ▸ message a blank row under the person's message, the same row a steer gets. The rule is now recorded in the interface system ("Attached notes", https://claude.ai/artifact/517GMW1E2KAafUWMzkLDBD#attached) and the visual system's element table (https://claude.ai/artifact/TjTnmZJPsxfXe7cv34CGpw#attached-row), with before and after shots in dark, light and NO_COLOR.

What changes

  • Daemon. senders gains an attached column, set when the turn was delivered with attach. History items and steered events carry attached: true, so a reopened conversation draws the same as a live one, and a steer mid-turn still reads as a steer. Schema 71 (the migration backfills from steered events whose turn was an attach) and protocol 32 (Sonny: the sky shows the andon cord, who pulled it and who let the line go on #528 already holds 31). No store job is added: keep_sender and history_items run the same statements with one more column. The Perf screen is recorded in docs/DAEMON_MEASUREMENTS.md: every measure is within ±4.1% and store jobs per turn hold at about 7.5.
  • Sonny. Attached words draw as a muted 📎 From an automation ▸ row, indented two columns, directly under the person's message or the step the call joined, with no blank row. 📎 is the same clip the footer shows while attachments wait (George is keeping the emoji for now). Several on one call gather as 📎 2 attached notes · an automation, calc.add ▸, and Ctrl+O opens them. They never join a cluster of ↳ messages that started turns. The person's own attached words stay on their band. Zen hides them like other relayed rows, and the sky is unchanged. Reactions and margin closes keep their own rows.

Screenshots

attached notes

Taken before #537: a commons reply under the person's message and an automation's note under the step its call joined. Before this PR, both drew as ↳ From … ▸ a blank row away, as second messages.

Tests

cargo test --workspace and clippy pass. New: an_attached_message_says_it_rode_along_where_a_steer_does_not and schema_70_finds_each_attached_message_from_its_event (store contract), and words_attached_to_a_call_hang_under_what_it_carried (Sonny: the rows, gathering, Ctrl+O). Also checked live in the rig against Responses and Anthropic, idle and mid-turn, and after reopening. The README and the FEATURES.md clean-view row are updated.

A note delivered with submit's attach (a commons reply, an automation
that found the agent busy) joins the agent's next call and has no turn
of its own. Sonny drew it as a ↳ message a blank row under the person's
message, so it read as if they had sent two things, and nothing told an
attach from a steer.

The daemon now keeps whether a stored message rode along: senders gain
an attached column (schema 71, backfilled from steered events whose turn
was an attach), and history items and steered events carry
attached: true (protocol 32). Sonny draws such words as a muted
"📎 From the commons ▸" row, indented two columns, directly under the
person's message or the step the call joined. Several on one call gather
as "📎 2 attached notes · …" and never join a cluster of messages that
started turns. The person's own attached words stay on their band.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF6exSeSewyrd7MXkQ
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T17:31:05.592011Z 7041903 New commits
🔒 Security Review ⚠️ Failed 2026-10-31T17:01:28.581023Z
We couldn’t complete this review. Comment @codex security review to try again.
305e6aa PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 305e6aabc4

ℹ️ 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".

Comment thread src/store/db.rs Resolved
…, not the commons

The commons stops sending attach notes in #537, so the test, README and
FEATURES examples use an automation that found the agent busy instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF6exSeSewyrd7MXkQ
@lydakis
lydakis merged commit 5555e76 into main Oct 31, 2026
5 checks passed
lydakis added a commit that referenced this pull request Nov 1, 2026
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.


Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

Co-authored-by: Claude <[email protected]>
lydakis added a commit that referenced this pull request Nov 1, 2026
* Sonny: words waiting to ride on the next call say nothing

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 attached note waits at most a day, then goes as a steer

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

* Attach lapses: arm only the due bots' turns, and skip bots being deleted

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

* Attach lapses: the due bots read through the due index alone, no scan

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

* Measurements: the matched screen for the attach wait

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

* Attach lapses: one commit per look, and a store refusing writes is retried

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

---------

Co-authored-by: Claude <[email protected]>
lydakis added a commit that referenced this pull request Nov 1, 2026
…heir sender (#633)

* Sonny: words waiting to ride on the next call say nothing

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 attached note waits at most a day, then goes as a steer

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

* Attach lapses: arm only the due bots' turns, and skip bots being deleted

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

* Attach lapses: the due bots read through the due index alone, no scan

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

* Measurements: the matched screen for the attach wait

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

* Attach lapses: one commit per look, and a store refusing writes is retried

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

* Hold turns on causes a person can fix, and bounce final failures to their 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

* Features: name the pull request

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

* Held turns: stay held when resumed without their provider, keep the run'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

* Held turns: a summary's failure stays a compaction failure, and a refused signature is held

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

* Bounces: told again until the daemon takes them, and a filter that hears 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

* Held turns: a missing provider keeps a pace park's state and ends a call'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

* Held turns: only a resumed pace park is held on a missing provider

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

* Held turns: a hold lasts the bot's hold_ms, five days unset, then the 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

* Hear a bounce's turn end as task updates deliver it

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

* Check a bounce only once the lookouts have heard the turn end

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

* Keep a message's start in the replay floor while it waits in line

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

* Measurements: the matched screen for held turns

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG5PKzf3A9NDuvu9Xu

* A hold's last try comes at its end

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

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants