Repository navigation
Conversation
serveAgents pushes what screens read synchronously (the snapshot, each shown agent's memberships, joinable agents, which hosted agents can be interrupted, and the creation and update requests) and answers their calls. It pushes state before each answer, so a call's result never arrives before what it changed. connectAgents keeps the pushed state with structural sharing, so an unchanged agent keeps its identity. Nothing uses it yet. Types, session state and the retype preview call plugin code and come in a later change. 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>
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖
Summary
Details
serveAgents(service, port)pushes what screens read synchronously:It answers the screens' async calls (
create,save,join,retypeand the rest) and their fire-and-forget actions (resumeInterruptedand the dismissals).createorjoinresolves, the client already shows its result. Several changes in one task are one push.connectAgents(port)keeps the screens' synchronous methods (find,memberships,joinable,interruptible,creationRequestsand the rest) and answers them from the pushed state, so screens do not change.shared(prior, next)keeps every part of the prior state that the new push equals, matching array items bykey. An agent that did not change keeps its object, whichuseSyncExternalStoreand the huddle composer's!==checks need.onClick={agents.resumeInterrupted}) drop the click event before it crosses.types(),sessionStateandpreviewRetype. They call plugin code (type functions, session controls). A later PR gives the screens' page what it needs for those.connectedwithout a notify. Screens read it at their next render today, and they have the same timing with this client.Testing
service.test.tscase runs the real service through aMessageChannel.createandjoinresolve with the client already showing the new agent and its two memberships.joinagain rejects with the service's message. An unrelated push keeps the agent's identity.port.test.tscovers structural sharing, the loading state before the first push, refusals, click events being dropped, and closing.tsc --noEmitpasses, andport.test.tsandservice.test.tspass.🤖 Generated with Claude Code