Skip to content

Give agent records one owner that the screens edit with data - #1749

Closed
loganj wants to merge 7 commits into
agents-link-activityfrom
agents-records-owner
Closed

loganj wants to merge 7 commits into
agents-link-activityfrom
agents-records-owner

Conversation

@loganj

@loganj loganj commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🤖 This is step 2 of the Manager/Runner split for agents. It is an inert refactor.

What changes

Each agent membership has a saved record: its watches, timers and Interests, and on its home record the agent's config. Until now AgentsService held these records, their per-record change queue and timer progress, mixed in with everything else.

This PR moves them into one owner, AgentRecords (records.ts). It is the only writer of records, and it keeps the same queue rules as before: one record's changes run in order, each on the newest saved record.

There are two kinds of callers, and they now differ:

  • The Runner's paths (attention tools, timer progress, attention history, the retype gate) still pass a function. They will live in the same page as the records.
  • The screens' paths (Save, Add, Leave, and removing records whose agent is gone) send a RecordEdit, which is plain data:
Edit Used by What it does
create Add Saves a new agent's first settings.
settings Save Config to the home record, attention to this membership's own.
leave Leave Keeps the config, forgets attention, timers and skips.
remove Refresh Deletes a record whose agent is gone.

Why

The goal is to run agents in their own hidden page. Then the agents' page must be the only one that writes agent storage, because each page keeps its own copy of the storage and does not see the other's writes. Data-only edits are what can cross the agents link from #1748. A later slice sends them over it.

Tests

  • records.test.ts: config and attention split between home and membership records, ordered edits, Leave and remove.
  • The existing agents service tests cover Save, Add, Leave, retype and timers unchanged.

🤖 Generated with Claude Code

loganj and others added 7 commits October 27, 2026 10:23
A plugin can now export `agent = { inject, apply }` for what agents need
while they run (agent type runtimes, tools, wakes, Attention sources),
separate from its UI `apply`. Both parts start in the same page, under
the same plugin identity, each with its own dependencies; the plugin is
active once both are and fails if either does.

GitHub's watch_pr moves into its agent entry. No behavior changes.

This is the first step toward running agents in their own webview, so a
hidden or suspended UI page cannot stall them.

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>
An agent type can now come in two halves. The plugin's agent entry
registers the runtime half with `agents.register`, and may pass
`expose`: the handles its own UI reaches of the runtime (stores and
async calls). The UI entry supplies icon, Create, tabs and provider
dialogs with `agents.present(typeId, (exposed) => ...)`. The service
merges both by type key, so readers of `types()` see one type, as
before. Provider getters stay live, and a throwing `present` leaves the
type's agents running.

Claude moves its setup, runtime, process sync and update timer into its
agent entry. Its tabs take narrow handles in place of the runtime
classes. No behavior changes.

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>
Codex's setup, provider, runtime, process sync and update timer move into
its agent entry, which registers the type and exposes handles for its UI.
The UI entry presents the icon, Create, tabs and provider dialogs.

The Activity tab no longer starts Codex itself to read a transcript: the
runtime exposes a transcript read, so the UI holds no process capability.
No behavior changes.

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 goose agent entry registers the runtime half and exposes setup,
session and history handles. The UI entry presents the icon, create
form, provider dialog and tabs from those handles only.

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 Pi agent entry registers the runtime half and exposes the setup and
runtime handles. The UI entry presents the icon, create form and tabs
from those handles only.

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>
Add the agents link: each side serves named topics, which the other
watches, and named commands, which answer one call. Only JSON crosses,
and either side may reload. The screens now read the local work that
running agents report through this link, and Stop and hiding an error
go back through it. Both sides still share one page.

This is the first part of the Runner, which runs agents, moving to its
own page. Behavior is the same, one task later.

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>
Move the agents' saved records and each record's change queue out of
AgentsService into AgentRecords. The Runner's own paths still change a
record with a function. The screens' paths (save, add, leave, and the
cleanup of records whose agent is gone) now send a RecordEdit, which is
data only, so it can later cross to the Runner's page over the agents
link.

No behavior changes.

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 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Closing: this change is now part of #1748, which collects one column of the Manager/Runner split in one PR.

@loganj loganj closed this Oct 29, 2026
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.

1 participant