Skip to content

refactor(agents): let Claude and Codex read the community through a host interface - #962

Merged
loganj merged 2 commits into
agent-host-runnerfrom
agent-host-reads
Oct 13, 2026
Merged

loganj merged 2 commits into
agent-host-runnerfrom
agent-host-reads

Conversation

@loganj

@loganj loganj commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Summary

Why

Buzz agents are AI assistants, such as Claude or Codex, that a person sets up in the Buzz desktop app. They answer when someone mentions them in a channel, and they can also watch for events and run on a timer. Today an agent runs only while its owner's desktop app is open, because the code that runs agents lives inside the app.

The goal of this stack is a small command-line program that runs an agent with the app closed. It must use the same code as the app, so the agent behaves the same wherever it runs. The app keeps working exactly as it does today.

Stack

Review in order. Each PR keeps the app working.

  1. refactor(agents): separate the agent runner and its reads from the desktop app #961: move the code that decides when an agent runs into its own module.
  2. refactor(agents): let Claude and Codex read the community through a host interface #962 (this PR): let the Claude and Codex agent code read conversations without depending on the app.
  3. feat(agent-host): run a saved agent without the desktop app #967: add buzz-agent-host, the program that runs an agent with the app closed.

Details

  • src/features/agents/reads.ts: the AgentReads interface (channel facts, conversation reads, profiles, names, memories, and which community the agent is in), plus ownerReads, the app's implementation. ownerReads is the existing code, moved.
  • Before, these runtimes got the owner's whole session object from the plugin API (ctx.agents.relay(pubkey)). That object exists only inside the app. The interface lists only the reads an agent needs.
  • src/bundled/claude-code/run.ts and src/bundled/codex/run.ts: the parts of each agent type that run an agent (model list, run, hand-over deadline), without its settings screens. A program with no user interface can load them. The app registers them with their screens as before.
  • The memory read now accepts a cancel signal. Claude keeps its existing 5-second limit.
  • fromOwner, the check that only the owner or the owner's agents can give an agent instructions, moves next to the signature check it uses. The agents service still exports it.
  • The Claude and Codex runtime tests change only how they build their fake session: they wrap it in ownerReads.

@loganj loganj changed the title refactor(claude-code): read the community through a host port refactor(agents): let Claude and Codex read the community through a host port Oct 13, 2026
loganj and others added 2 commits October 13, 2026 12:44
The Claude runtime read the channel, conversation, names and memory
through the owner's app connection. It now asks an AgentReads port for
them, which the app fills from that same connection (ownerReads), so its
behavior is unchanged. A standalone host can give it reads made as the
agent instead.

The run part of the type (models, run and the hand-over deadline) moves
to run.ts, which imports no views, and fromOwner moves next to the
attestation check it uses, so the run code no longer imports the agents
service.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
The Codex runtime read the channel, conversation and memory through the
owner's app connection, like Claude did. It now uses the same AgentReads
port, filled by ownerReads in the app, so a standalone host can run it
with reads made as the agent. The port's memory read takes a signal; each
runtime keeps its own bound (Claude five seconds, Codex its turn).

The run part of the type moves to run.ts, as Claude's did.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj loganj changed the title refactor(agents): let Claude and Codex read the community through a host port refactor(agents): let Claude and Codex read the community through a host interface Oct 13, 2026
@loganj
loganj merged commit d6928af into agent-host-runner Oct 13, 2026
20 checks passed
@loganj
loganj deleted the agent-host-reads branch October 13, 2026 16:45
@loganj

loganj commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Combined into #961 at Logan's request: #961 now contains these two commits unchanged (agent-host-runner fast-forwarded to d6928af). #967 is retargeted onto #961.

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