Skip to content

feat(agents): carry local agents and their work over the agents port - #1742

Closed
loganj wants to merge 1 commit into
agent-host-hosted-forwardingfrom
agent-host-local-port
Closed

loganj wants to merge 1 commit into
agent-host-hosted-forwardingfrom
agent-host-local-port

Conversation

@loganj

@loganj loganj commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🤖

Summary

  • Stacked on feat(agents): forward hosted agent types the screens' page registers #1741. The screens' page reads two things from the agents service that are not part of its state today:
    • the local agent list, which feeds local agent names, mentions and the composer's agent choices;
    • each request's work, which feeds the Starting, Working and Error rows and their Stop.
  • Once the service runs in its own page, the screens' page would lose both. This carries them over the agents port.
  • Nothing uses it yet, so behavior does not change. The agents window PR will connect it.

Details

  • serveAgents(agents, port, options) takes optional local (a LocalAgents source) and activity (a LocalAgentSource). The port pushes their snapshots with the rest of its state and pushes again when they change.
  • The client has local and activity with the same shapes. createLocalAgents().bind(client.local) and createCommunities(…, client.activity) can use them as they use the in-page ones now.
  • Retry (local.refresh), Dismiss (activity.dismissError) and Stop (activity.interrupt) are sent back. Refresh and Stop wait for the service's answer.
  • Without local the list reads as unavailable, as createLocalAgents does when nothing is bound. Before the first push it reads as loading.
  • Small cleanup in connectAgents: one request helper replaces three copies of the same promise bookkeeping.

Testing

  • service.test.ts: the real agents service across a MessageChannel. A created agent appears in the client's local list; a mention's work shows as working, then done.
  • port.test.ts:
    • Error, working, step and stoppable rows arrive; Dismiss hides the error; Stop calls the harness's stop and shows the request stopped.
    • createLocalAgents bound to the client's list follows the service, and Retry reaches the service.
    • A service with no list reads as loading, then unavailable.
  • Mutation checks: each of these makes a test fail: not pushing when work changes, not pushing when the list changes, ignoring Dismiss, and pushing no work.
  • tsc --noEmit, Biome, and vitest run src/features/agents src/buzz-mcp (869 passed) pass.

🤖 Generated with Claude Code

The screens' page reads the local agent list for names, mentions and
the composer's agent choices, and each request's work for the Starting,
Working and Error rows and their Stop. Both come from the agents
service. Once it runs in another page, the port pushes them with the
rest of its state, and carries Retry, Dismiss and Stop back. Nothing
uses it 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>
@loganj

loganj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Closing: the Manager/Runner split replaces this design (#1748 → #1839, with more to come). The branch stays in place because #1737, #1743 and #1744 are still stacked on it. They will move onto the new stack in the hidden-page step.

@loganj loganj closed this Oct 28, 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