Repository navigation
Lookout: filter, digest and urgent on every subscription, agent activity as typed events - #599
Conversation
… watches read as typed events A subscription's filter, digest and urgent now read the bots it watches as well as its sources. Agent activity becomes typed events (message.written, turn.ended, approval.waiting, ask.posted, turn.silent, note.changed) in the shape a source's have, matched as each comes, before it folds into its task's news. A subscription's digest takes its sources' place (the person's words, a question or an approval for them never wait); urgent cuts into a busy subscriber's turn and the note names the subscription. A source's urgent pattern in the settings marks what is urgent, as the command's own mark does. A subscription with none of the three builds no event: which bots any of them watches is worked out when subscriptions change, and every other bot's news goes as it always went, so every note reads as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…turn awaiting its reply, let overlapping digests each allow, digest 0 overrides a source's A turn the lookout did not see start is held apart until who asked for it is read, so a filter on `by` hears it as it is. A turn waiting for its reply keeps the urgency it was heard with. News several digests hold goes when any of them allows. A subscription's `digest = "0"` waits for no digest of its sources either. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…again, however soon it went Hold keeps which subscriptions with a digest heard a task's news apart from whether something in it goes now, so news the person's words, an urgent match or a subscription with no digest take along still starts each digest's time again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…t for the next note keeps its urgency A task note and a sources note told through one subscription with a digest both check when it last told: each now marks it as the note goes, and puts it back if the note is not sent, so the two never slip through one window together. News a note leaves for the next, for room as for a reply, may go as it might have, and keeps the urgency it was heard with. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…ilters hear words as written Each message, turn, margin note and question keeps the urgency it was heard with, and a task's urgency is whatever of it is still to be told: a turn the subscriber read with wait takes its urgency with it, as does a turn whose asker was still to be read. A filter on a message's text hears the person's words as they wrote them, not as a note cuts them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…s that heard it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
…unts from the notes that land What a piece of a task's news may wait for, and which digests heard it, now goes with that piece, as its urgency does: a note counts only for the digests of what it tells, and what it leaves for later keeps its own. A note on its way marks the digests it tells as flying, so no other note tells more of them meanwhile; one that lands starts their time, one that fails leaves what any other note told. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
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. |
The Perf screen's sonny_screen, fair_queuing and ingress_credits build their own arguments for Bench; a missing rules reads as none. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45430b333e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96f721c58b
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bc78b1f87
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b8ba9b53d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 812fbfa8bc
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f42fb6e450
ℹ️ 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 lookout with no cursor yet replays the whole log. When it fell behind partway through, it followed again from the first event, so on a long history it could lag, back off and start over indefinitely: in the 1,100-bot bench it never went live during the idle phase, on main too, and the first round of the load went untold whenever it was still replaying then. It now goes on from the last event it replayed, as a consumer resumes from its offset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEQqpYZ4K234ddyPtV
|
Performance, 1,100 bots (
What the earlier rows were: every short run lost exactly the first round of the load (1,000 turns), sometimes more. The cause is a bug main has too. A lookout's first replay, with no cursor yet, restarts from event 0 each time it lags. A controlled start-and-idle run showed main and the branch identical here: five restarts in 10 s, never live. Main got through in time more often by luck of timing. The extra lags were where the extra CPU in those rows came from. 43ce224 resumes the replay from where it got to. The rules alone, in-process with no I/O: 60,000 task events through Memory: about 3–5 MiB more than main with no rules, and about 7 MiB more with rules on every lead, at 100 leads and 1,000 tasks. That covers the per-item holds, the per-bot rule tables, and the digest bookkeeping. Start and restart are unchanged: seated in 0.2 s, and a restart from the saved cursor is busy for 0.22 s. Generated by Claude Code |
What
Lookout's three rules (filter, digest, urgent) used to apply only to sources, and only partly. Now every subscription can set all three, and they read the bots a subscription watches the same way they read its sources. Nothing that happens today changes. This only adds the option.
message.written,turn.ended,approval.waiting,ask.posted,turn.silentandnote.changed. Their fields arebot,maker,by,turn,status,resolved,goal,theirs,text,question,optionsandid. Each event is matched when it arrives, before it folds into its task's news. Thesubscriptionstool lists these fields for the agent, and a filter on a field no event has gets the same warning a source filter gets.filternarrows which events a subscription hears, for bots as well as sources. A filter no longer needssources.digest(30s,15m,1h) tells a subscription's news at most once per window. The first event after a quiet spell goes at once. The person's own words, a question for them, or an approval only they can give never wait. On a source, the subscription's digest replaces the source's. A source with no subscription digest keeps its own per-source timer, so commons per-thread subscriptions behave as before.urgentis a pattern that cuts into a busy subscriber's turn. The steer note names the subscription that marked it ("urgent by yourmigration"). Sources also geturgent = {…}in[sonny.sources.NAME]. It marks events urgent the same way the command's own mark does, and the runner refuses a bad pattern withsource_refused.Cost when unused
A subscription with none of the three builds no event. Which bots any rule-bearing subscription watches is worked out when subscriptions change, and stored per bot as
Arc<[Rule]>. Every other bot has no entry, takes the fast path, and its news goes out exactly as before. Notes stay byte-identical:subscriptions_that_say_nothing_more_cost_nothing_morechecks that no rules exist and that the note text matches.Also fixed: a first replay that lags starts over from the beginning
Found while benchmarking, and present on main too. A lookout with no cursor yet replays the whole log. If it fell behind partway through, it followed again from event 0. On a long history it could lag, back off two seconds and start over indefinitely. In the bench it never went live during the 10 s idle phase (five restarts, main and branch alike). Whenever it was still replaying when the load began, the first round of turns went untold. It now goes on from the last event it replayed, as a consumer resumes from its offset (
follow_after, with a test).No daemon or protocol change
All of this is Sonny-only. No protocol or schema numbers are taken.
Tests
cargo test -p sonny -p agent-client: all pass.cargo clippyis clean.Performance
bench/lookout_scale.pygains--rules. With it, every lead'staskssubscription gets a filter that matches everything and an urgent pattern that never matches. Every event is then built and matched, but none is held or dropped, so the run measures only the cost of the rules. The numbers are in the comment below. With the replay fix, the branch tells every turn, and its CPU and note delays are in main's range. RSS is a few MB higher.Docs
docs/LOOKOUT.md: subscriptions, sources and filters are updated, and task updates gains "As events", "Digests" and "Urgent".sonny/FEATURES.md: new row.🤖 Generated with Claude Code