Repository navigation
Conversation
The model of a shared session now covers the client list: the main client, the opt-in to the list, the list before a load answer and after a session/new answer, no list without a member, and the sender id on prompt and steer chunks. Its planted bugs and rows are checked by the shared session checker and the acp check script. The end-to-end tests for the list fail until the list is built.
fx lists sh.fx/sessionClients among its capabilities and reads the client's listing of it. The initialize answer names the caller's connection as sh.fx/clientId, and the connection keeps the clientInfo the client sent, each string cut to 256 bytes on a character boundary. A client that joins a session copies that info into its member record.
A session keeps one flag for a change in its clients. The list is sent after each change, from the audience unlock, to every client that lists sh.fx/sessionClients, with each client's id, its clientInfo, and whether it is the main client. A joiner gets the list before its load answer, and the opener gets it after its session/new answer. A client whose write fails is dropped and the list goes out again without it.
A prompt or steer chunk that fx sends to the other clients carries the sender's id as sh.fx/client in its _meta, to each client that lists sh.fx/sessionClients. The other clients get the chunk as before. A steer group names each steer's own sender, and the running copy keeps the same version for a client that joins later. A client that resumes a session gets the list before its answer, as a load does.
A prompt or steer chunk is built once for each kind of receiver present: listing or not, and for a steer with or without sh.fx/steerInput. When every member lists the capability, one version is built. The running copy keeps the chunk's inputs once, and a joiner's replay builds the version its client takes, so an image is held as its raw bytes and not as a base64 copy per version.
The spec now says that fx sends the list only to clients that list sh.fx/sessionClients, what each entry holds, when the list is sent, and which chunks carry the sender's id. The model header states that the client list is built.
A driver runs fx acp through six plans in which the clients of one session open it, join it, leave it, and send prompts and steers, and checks what fx wrote against the shared session model through a trace module. The plans cover the list after session/new and after a load, a client that does not list the capability, a client that leaves, the main client leaving, and the sender named on prompt and steer chunks.
The initialize answer carried sh.fx/clientId to every client. A client that lists no sh.fx capability now gets an answer with only ACP v1 names, as the rule for sh.fx keys requires. The E2E helper that reads the id checks that a non-listing client gets none.
…me in the shared-session driver A client that does not list sh.fx/sessionClients has no sh.fx/clientId, so the driver could not name its entries in the client lists. It now sends each client a clientInfo name and matches a list entry by that name, then records the entry's id for the chunks the client sends.
This branch has not been deployed
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
fx acpsession that listssh.fx/sessionClientsnow gets its own id assh.fx/clientIdin itsinitializeanswer, and the list of clients that have the session open in_sh.fx/session/clients_update.clientInfoit sent atinitialize(each string cut to 256 bytes, left out when it sent none), andmain, which marks the oldest client in join order.session/new, after its answer. Only clients that list the capability get it, and a client that lists nosh.fxcapability gets nosh.fxkeys.sh.fx/clientin its_meta, for listing clients only. History replay carries no sender.Not built yet: a subagent's permission questions to every client.
Docs: vercel-labs/fx-web#369.
Stacked on #2276.