镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(agents): catch up an agent's mentions, in their own pass - #1634

Open
loganj wants to merge 5 commits into
mainfrom
fix/agent-mention-catch-up
Open

loganj wants to merge 5 commits into
mainfrom
fix/agent-mention-catch-up

Conversation

@loganj

@loganj loganj commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Stacked on #1852: review and merge that first. This PR now holds only the mention part of catch-up. The 2-minute reread of every stream is gone: #1852's 30 s poll with a 16-minute (960 s) overlap replaces it.

Summary

  • An agent running in the app only heard a mention if the live relay subscription delivered it. If that subscription dropped the message (for example, the relay's live fan-out stalled while the socket stayed open), the mention was lost for good. The agent never answered and nothing showed it.
  • Mentions had no catch-up at all. Catch-up only read the agent's watched channels, so a mention in any other channel could not be found again.
  • Now each agent also catches up its own mentions: at start, after a reconnect, and while connected. A mention the live subscription missed is answered within about a minute.
  • Mentions sent before the app started are still ignored, as before.

Details

  • Mentions are a new catch-up stream for each agent in each community it is in (@mentions). It reads chat messages that tag the agent's pubkey (#p), which the relay serves from an index, so paging is exact. Its saved checkpoint is kept under that community's membership key, like a watched channel's.
  • The mention stream names no single channel, so live never covers it. Like fix(agents): catch up every event watch on the kinds it watches #1852's watch on every channel, it is read again about every 30 s while connected, up to 10 s before now, and each read covers the last 16 minutes (960 s) again. A message that arrives late with an older timestamp is still found.
  • A membership added to another community has no saved record there until something is saved for it. Its mention checkpoint is kept anyway, so catch-up there does not restart from "now" on every save.
  • Mentions catch up even when the agent's attention is off or not shown, as live mentions already wake it. They catch up in their own pass, so a watched channel that is stuck or slow cannot hold them up. A watch or Interest edit does not restart that pass or stop what it gives, so edits more often than its 30 s read do not delay it.
  • The agent remembers each mention it was given, from live or from either pass, until no read can return it again. Busy channel traffic pushes ids out of the seen sets, so without this the agent could answer a mention twice.
  • Catch-up reads use readRemote(), not read(). read() also returns events the session observed during the read and the owner's unsent messages, and an older one of those can move the page cursor past events the relay has not returned yet.
  • docs/attention-janet-parity.md lists mention catch-up as an intended difference from Janet.
  • Tests cover a mention lost while connected, a mention found with attention off, a late mention with an older timestamp, a stuck watch that must not block mentions, watches edited every 20 s that must not hold mention reads back, a mention lost in a community the agent was added to, a mention that traffic pushed out of the seen sets, and a mention a waiting catch-up read before live gave it. They also cover that a busy watch and a widened watch do not repeat live messages after a restart.

Cost

  • Each running agent makes one extra mention read about every 30 s in each of its communities. Each read is a small, bounded #p page.

Not in this PR

🤖 Generated with Claude Code

@loganj
loganj changed the base branch from main to carl/copy-agent-to-community October 26, 2026 15:49
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from b83dfc3 to f15ee56 Compare October 26, 2026 15:49
@loganj
loganj marked this pull request as ready for review October 26, 2026 16:03
@loganj
loganj requested a review from a team as a code owner October 26, 2026 16:03
@wesbillman
wesbillman force-pushed the carl/copy-agent-to-community branch from ed949cc to 13d7055 Compare October 26, 2026 16:15
@wesbillman
wesbillman requested a review from a team as a code owner October 26, 2026 16:15
@wesbillman
wesbillman force-pushed the carl/copy-agent-to-community branch from 13d7055 to 3fb0e90 Compare October 26, 2026 16:59
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from f15ee56 to 6bdb48a Compare October 26, 2026 18:20
@wesbillman
wesbillman force-pushed the carl/copy-agent-to-community branch from c0701b9 to 21972f5 Compare October 26, 2026 18:31
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from 6bdb48a to be7f59f Compare October 26, 2026 19:53
wesbillman

This comment was marked as resolved.

Base automatically changed from carl/copy-agent-to-community to main October 26, 2026 21:12
wesbillman

This comment was marked as resolved.

wesbillman

This comment was marked as resolved.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from 194625a to 6b1db71 Compare October 27, 2026 00:57
wesbillman

This comment was marked as resolved.

@loganj

This comment has been minimized.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating Rocket, Mantis and Groot: no changes requested. The prior cursor P2 is fixed: catch-up uses guarded readRemote() pages, and the gated session regression covers concurrent observations.

Reviewed head c8005cc88190a694bcded78302cb47c520d5a549, base 63eeeea786716b564a83e431a5e61a7cb3d97988, following 6b1db71a; source assessment 9/10 for this delta. Tests were inspected, not run; CI, live recovery and performance remain unverified.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating Rocket, Mantis and Groot: no changes requested. The 23-line fixture repair handles local-agent mention queries with the consumer’s time/cursor ordering, preserves viewer-inbox routing, and leaves the prior production repairs unchanged; source assessment 9/10 for this delta.

Reviewed head 7a29868ab2a212cf59ef89d2364fefefb9ebb9de, base 63eeeea786716b564a83e431a5e61a7cb3d97988, following c8005cc8. Source-only: tests/app not run; required CI checks passed in the snapshot, but live recovery and fixture timing remain unverified.

kalvinnchau

This comment was marked as resolved.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating Rocket, Mantis and Groot: no changes requested. The changes retain matched-watch receipts across restarts and keep catch-up progressing after edits or failed reads. Reviewed head bc9610bbd6d033aea22f7ab27c6e856e2954907b, base 63eeeea786716b564a83e431a5e61a7cb3d97988, following 7a29868a. Source-only: tests inspected, not run; three WebKit shards remained running in the CI snapshot, and live recovery/performance remain unverified—busy watches can read every five seconds, beyond the description’s two-minute cost estimate.

kalvinnchau

This comment was marked as resolved.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating Rocket, Mantis and Groot: no changes requested in the three-file delta from bc9610bb. Recording unmatched live events prevents a widened watch from replaying them after restart; the pre-existing mixed held-watch edge remains outside this repair.

Reviewed head 8b207135eea700eeea43f0ed0c360da0b4a7fe22, base 63eeeea786716b564a83e431a5e61a7cb3d97988; source assessment 9/10 for this follow-up. Tests were inspected, not run; CI, live recovery and busy-traffic performance remain unverified.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from 8b20713 to f375e3c Compare October 28, 2026 02:22

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source review via Wes’s account: no further changes requested. The eight feature patches are unchanged by the rebase; Rocket, Mantis, Groot and I checked their integration with the updated runner lifecycle, configuration and remote reads.

Reviewed head f375e3c51fecb6a81b30d276f7cfa2d1bf445e06 against base 27c3f17cde07435311709d371ca282006fd1d037. This follow-up targets rebase integration, not an exhaustive review of unrelated upstream changes; tests/apps were not run, and CI, runtime behavior and performance remain unverified.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from f375e3c to 7a0d7ee Compare November 3, 2026 22:36
@loganj loganj changed the title fix(agents): catch up mentions and keep catching up while connected fix(agents): catch up an agent's mentions, in their own pass Nov 3, 2026
@loganj
loganj changed the base branch from main to loganj/catch-up-all-kinds November 3, 2026 22:36
@loganj

loganj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Restacked on #1852 (base is now loganj/catch-up-all-kinds), head 7a0d7ee. The PR now holds only mention catch-up:

  • the @mentions stream (#p, chat kinds), read with Attention on or off
  • its own pass, so a stuck watch cannot hold mentions up
  • mention dedupe across passes (runner.mentioned)
  • mention checkpoints for memberships without a record
  • the readRemote() switch

The 2-minute reread of every stream, HEARD_READ and the 4096 heard limit are gone. #1852's 30 s poll with its 16-minute overlap and heard cap replaces them, and the mention stream uses that poll because live never covers it. Earlier review threads on the removed reread no longer apply. Full vitest passes on this tree. The body is updated.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket, Mantis and Groot coverage.

One P2 needs fixing: attention-object changes can indefinitely reset the rolling mention poll (inline). Source assessment: 8/10 pending that repair.

Optional P3 / disclosed limitation: catch-up still interprets a visibility-filtered empty page as exhaustion (catch-up.ts:404, session.ts:695–710). A page consisting entirely of filtered events can prevent older visible mentions from being reached before the overlap expires. This extends an existing all-channel-watch boundary to the new mention stream; ordinary joined-channel message mentions pass. Preserve access checks while retaining remote-page count/cursor evidence, and cover the boundary with the real session reader. This is source inference, not a reproduced runtime failure.

Reviewed head c027c79b4981558961422c5abcc1f8d24f7b3138 against base edd0ea073cd2f8b2a03b60c68f47a3f610af2ab2 (stacked on #1852), including the restacked mention feature and its callers. Source-only: no tests, builds or app workflows executed. The one-time CI snapshot was still running, with Windows native validation skipped. Native delivery/recovery, performance and human acceptance remain unverified. Public description and two commit messages inspected; no attached images. No UI/focus surface changed.

Comment thread src/features/agents/runner.ts Resolved
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from c027c79 to 8a52b8c Compare November 3, 2026 23:00
@loganj

loganj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 On the optional P3 (a page of only visibility-filtered events read as the end): this is the same session access-filter boundary as the hidden-reaction finding on #1852, which Logan put in BUZZ-521 for a separate PR. That PR will change the session reader so it keeps the remote page count and cursor while it still applies the access checks. It will cover the mention stream as well as all-channel watches, and it will be tested against the real session reader. This PR leaves that boundary as it is.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch 2 times, most recently from 5fb10b1 to 098befc Compare November 3, 2026 23:39

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket, Mantis and Groot review.

No new actionable findings in this follow-up. The earlier watch-edit starvation is addressed in source: mention passes no longer depend on the attention-map identity in either scheduling or batch admission, while readiness, community/connection and cancellation guards remain. The controlled-clock regression now edits watches every 20 seconds and checks that rapid edits do not cause extra mention reads.

Reviewed head: 098befc23fa841871d7a3730f17f41e457b48d9d
Base: 3b3059befea90859192c2356a5061a0a289fd1c0
Prior reviewed head: c027c79b4981558961422c5abcc1f8d24f7b3138

Source-only follow-up and integration review; tests were inspected, not run. The public PR body and commit messages were inspected; no attached media. The one-time CI snapshot still had checks running, with Windows native validation and browser flake checks skipped. Live relay recovery, native behavior, focus/accessibility, performance and human acceptance remain unverified. This COMMENT review is not an approval or merge authorization.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from 098befc to c030963 Compare November 3, 2026 23:58

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account: no new actionable findings.

All three feature patches are unchanged from the previously reviewed 098befc23fa841871d7a3730f17f41e457b48d9d revision (git range-diff reports all three equal). The entire endpoint change is the 14-line test removal inherited from #1852. I checked its stated invariant against delivered(): a saved non-overlap cursor sets through to one second before its position; the removed fixture used a lower, unreachable value. The remaining test still covers transition from a saved cursor to overlap without redelivery. The mention scheduling/admission repair remains unchanged. This qualifies for the small-follow-up solo exception; no new teammate review was requested.

Head: c0309637358e90f427c415090f790369c0b3bb4f
Base: ae4ad855df52c3e1bbbb3e4ade776f3be1b36025

Public description and all three commit messages inspected; no attached media. Source-only review: no tests, builds, app execution, CI verification, native focus/accessibility, live relay behavior, timing or human acceptance established. No new UI or focus-owner code in this follow-up. This is a non-blocking comment, not approval.

Base automatically changed from loganj/catch-up-all-kinds to main November 4, 2026 18:09
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch 2 times, most recently from 60c4ed5 to c7ac79d Compare November 4, 2026 18:30

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating independent Rocket, Mantis and Groot coverage: no new actionable findings.

All three feature patches are unchanged from the previously reviewed c0309637358e90f427c415090f790369c0b3bb4f revision (git range-diff reports all three equal). We checked their integration with the updated runner, interrupted-turn follow-ups and relay reader. The prior mention-deduplication and watch-edit polling fixes remain intact; connection, access and cancellation guards remain in place.

Head: c7ac79de4e8519a810944fcde0c472a79bcf1f4e
Base: e121e52719d7cde4ac36e4d22827b0e1cf7937ea

Source-only follow-up and integration review, not a complete audit of unrelated upstream changes. Tests were inspected, not run; no builds or app workflows were executed. CI, live recovery, native behavior, performance and human acceptance remain unverified. The public description and feature commit messages were inspected; no attached media or changed UI/focus owner. This COMMENT is not approval or merge authorization.

@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from c7ac79d to 2c1ff5f Compare November 6, 2026 00:04

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating independent Rocket, Mantis and Groot coverage: no new actionable findings.

The rebase preserves the mention-deduplication, admission-time recheck, remote-page cursor and independent polling repairs. We checked their integration with selective checkpoint persistence and asynchronous runner startup: checkpoint producers replace values, and startup reserves the lane before awaiting configuration and checks cancellation before dispatch. The feature range-diff has two unchanged patches; the first differs only in surrounding browser-fixture context. Source assessment: 9/10 for this focused integration.

Head: 2c1ff5f4930310ce8cabeb30c716e25ac3078a0c
Base: ef5a784ec7f0fe492f56a0e441f1510f55ce6acd
Prior reviewed head: c7ac79de4e8519a810944fcde0c472a79bcf1f4e

The previously disclosed optional visibility-filtered empty-page limitation remains unchanged. This is a source-only follow-up, not a complete audit of unrelated upstream changes. Tests were inspected, not run; builds, app workflows, CI, live relay recovery, native behavior and performance remain unverified. Public description and feature commit messages inspected; no attached media or changed UI/focus owner. This COMMENT is not approval or merge authorization.

loganj and others added 3 commits November 9, 2026 11:21
A mention was heard only if the live subscription delivered it. If that
subscription dropped it while the socket stayed up, the agent never
answered it.

Each agent now has a mention catch-up stream in each community: chat
messages that tag its pubkey (`#p`), read with Attention on or off. It
names no single channel, so live never covers it, and it is polled with
the same 30 s read and overlap as any other stream live does not cover.
It has its own pass, so a watch waiting for room cannot hold it up. The
agent remembers each mention it was given, from live or either pass,
while a read can find it again, so traffic that pushes ids out of the
seen sets cannot make it answer twice.

Catch-up reads use readRemote(): read() also returns events the session
observed during the read and unsent messages, and an older one of those
can page past events the relay has not returned yet.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
The mention pass keyed on the attention map, so each watch or Interest edit
restarted it: it read mentions again on every edit, and an edit while it gave
one stopped it. An edit does not change what the mention pass reads, so it no
longer restarts it or stops what it gives.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the fix/agent-mention-catch-up branch from 2c1ff5f to 5d9a0fc Compare November 9, 2026 16:26

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source follow-up via Wes’s account, integrating independent Rocket, Mantis and Groot coverage: one P2 rebase integration defect, detailed inline.

The separate mention pass can now admit watch work from channels known only through agent lookups. A full watch Interest can therefore stop mention polling, despite the mention lane having room. The earlier deduplication, remote-page cursor and watch-edit polling repairs remain present; checkpoint persistence, pause/resume boundaries and access fencing were also inspected.

Head: 5d9a0fc8d6fd788fd94f1b02e22f156f668e3f4d
Base: d9e00ed058ca16e8344f8f45e309046faaa13f96
Feature merge-base: 5296c33d0ac5b49c99c2bfc8560a7fc4a878d216
Prior reviewed head: 2c1ff5f4930310ce8cabeb30c716e25ac3078a0c

Source-only bounded integration review. Tests were inspected, not run; builds, app workflows, CI, live recovery and performance remain unverified. The previously disclosed optional visibility-filtered empty-page limitation is unchanged. Public description and feature commit messages inspected; no attached media or changed UI/focus owner. This COMMENT is not approval or merge authorization.

Comment thread src/features/agents/runner.ts Resolved
Since catch-up reads resolve the public channels they find, the mention
read also returns messages that name the agent in a channel only agents'
lookups know. The owner's app does not hear those for the owner, so they
wake watches, not mentions. The mention pass gave them to those watches
too, and while their Interest was full it waited for room, so no other
lost mention was read until it had some.

The mention pass now passes such an event by, unseen, and the watches'
own pass gives it to them. A test of a full Interest checks that a later
lost mention is answered meanwhile and the watches get the event once
room opens.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source review via Wes’s account.

No new actionable findings in this repair follow-up at efb12b2b927eb6fffab5995a20edef1f0f4945cc (base d9e00ed058ca16e8344f8f45e309046faaa13f96). The previous P2 is addressed in source: the mention pass filters watch-only events before batching, so a full watch Interest cannot stall later mention polls through those events. Skipped rows do not enter global seen-state or advance watch checkpoints, preserving delivery through the independent watch pass.

Inspected the new regression assertions for mention progress while the Interest is full and watch delivery after capacity is released, plus the adjusted captured-addressability test. Rocket, Mantis, Groot and I reviewed the repair against the prior feature coverage. The previously disclosed optional filtered-empty-page limitation is unchanged.

Source-only review: no tests, builds or app workflows were run; the regression’s old-head failure/new-head pass, CI, live recovery and performance remain unverified.

The runner now catches up an agent's mentions. When the connect lands in
the second after the agent's mentions began to be caught up, that pass
reads that second with a #p filter of every channel. The launch boundary
counted it as a start request, so the deleted-settings test failed about
one run in eight. It is not a start's read: allow it, as the post-run
core refresh is allowed.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
kazemek21 added a commit that referenced this pull request Nov 9, 2026
## TL;DR

Removes the six owner-session read tools that let a Buzz-hosted agent
read with its owner's own access: channel, member and DM lists, channel
details, messages and canvases. An agent's own reads and the channel
archive, unarchive and delete changes are unchanged. The tools are gone
from discovery on every harness, and a cached or direct call to one is
refused before anything is read with the owner's session.

Fixes NEXUS-4348 · Initiative:
https://blockcell.sqprod.co/sites/kylez-buzz-mcp-initiative/

## Scope

Kyle's request was to remove "the channel/member/dm list/get" endpoints
and leave the archive/delete channel changes for now. Removing
`owner_read` and the two Canvas tools as well is the initiative lead's
interpretation: they read through the same owner session and handle, and
leaving them would keep the owner-read capability this removes. If that
is wrong, the #2881 half can be restored on its own.

### Removed

From #2745 (owner channels and members):
- `owner_channel_list`, `owner_channel_get`, `owner_member_list`, their
hint text and discovery on Claude Code, Codex, Pi, the session RPC and
the harness kit.
- `src/features/agents/owner-access.ts`, the run handle's `ownerAccess`
field and the runner's host hook that built it for bundled-revision
runs.
- The `BUZZ_OWNER_MCP_COMMUNITIES` build setting (`vite.config.ts`). A
distributor build that still sets it now gets nothing from it;
`docs/configuration.md` lists it with the other retired inputs.
- The owner-tool sections in `docs/agents.md`, `docs/configuration.md`,
`docs/buzz-help.md` and `src/buzz-mcp/AGENTS.md`.

From #2881 (owner messages and canvases):
- `owner_read`, `owner_canvas_get`, `owner_canvas_history`,
`src/buzz-mcp/owner.ts` and the `Owner*` client types.
- The `docs/relay-queries.md` paragraph, and the exports of `tools.ts`
helpers that only `owner.ts` used. `edited()` keeps its author-only edit
selection, minus the owner parameter.

### Kept

- From #2745: the Stop and cancellation fences in the Claude Code, Goose
and ACP sessions (`workLifetime`, `current()`), which every Buzz tool
call now depends on, and the channel-lifecycle changes
(`channel-lifecycle.ts`, including its `records` parameter).
- `addTool` still refuses plugin tool names starting with `owner_`, so a
stale call to a retired name can never reach plugin code. There is no
other owner-prefixed restriction and no new permission layer.
- Ordinary agent-scoped reads, Codex per-thread/turn tool validation,
plugin and external isolation.

## Alternate routes checked

Nothing else reached these tools: no Rust, IPC, sidecar or RPC path, and
Mesh and external agents use the same run handle that no longer carries
owner access. Codex thread tool keys no longer carry the `:owner`
suffix, so threads created with owner tools are replaced instead of
reused with a stale tool list.

## Tests

The new tests list the six names as a fixed fixture rather than reading
them from the catalog:
- `session-tools.test.ts`: `sessionTools()` and `sessionHint()`, which
every harness lists from, name none of the six.
- `service.test.ts`: a real bundled run handle has no `ownerAccess`.
With the owner's session stubbed to return an `OWNER_ONLY` message for
an owner-only channel, each retired name is refused with `No tool
<name>` before any relay query. An ordinary `read` of that channel then
runs with the agent's own key, filtered to that channel, and returns `No
messages.`. The same client's `read` of the agent's own channel returns
its message, and no read through the owner's session ever names the
owner-only channel. External agents see none of the names and are
refused the same way.
- `codex/runtime.test.ts`: `dynamicTools` lists none of the names, each
call fails Codex's validation, a planted owner-access spy is never
called, and the thread's own `read` works.
- `app-client.test.ts`: a handle that still carries an owner capability
doesn't pass it to the tool client.
- The Claude Code and Goose Stop/timer tests now hold an ordinary
`mem_get` read instead of an owner tool.

On a Blox box with these commits applied to main: `tsc` passes, and the
12 affected Vitest files pass (claude, codex, goose, pi runtimes,
app-client, tools, session-tools, service, kit, ACP client,
channel-lifecycle). Full CI covers the rest. `git push --no-verify`
skipped the pre-push lanes (types-and-related-unit-tests, design-system,
rust-clippy); CI's `pnpm check`, sharded Vitest and clippy jobs repeat
all three.

Fail-before check: the removal tests in `service.test.ts` and
`codex/runtime.test.ts` were run against the pre-removal source
(0a5c190). Three of them fail on real assertions:
- Codex `dynamicTools` contains `owner_channel_list`.
- An external agent's call returns "Owner tools are not available to
this agent here; nothing was read." instead of `No tool
owner_channel_list`.
- The bundled handle has `ownerAccess`.

All three pass on this branch. Vitest strips types, so this check
doesn't cover `tsc`. The `session-tools.test.ts` discovery test also
passes on the old source, because that source only lists the tools when
the owner setting is on, so it doesn't count as a fail-before check.

## Not covered

- No native app run or live relay check. The removal is exercised
through the service, runner and harness tests above.
- A Buzz process already running a build with these tools keeps them
until it updates. This doesn't revoke anything remotely.

## Related open PRs

- Human work in overlapping files keeps its behavior but may need a
rebase: #2700, #2974, #3081, #2972 (cancel added tools on native Stop),
#2935, #1634, #2622, #3095, #2882.
- #3004, #3005, #3006, #3008 and #2980 build on the removed owner access
and are not part of this change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
(claude-opus-5-5) on behalf of kylez

---------

Signed-off-by: Kyle Zemek <kylez@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants