Speak session stream protocol v2#64
Merged
Merged
Conversation
Minimal v2 port (documents/eng/SESSION_STREAM_PROTOCOL.md PR 1, CLI half): ws.ts sends the required ?protocol=2 handshake and the v2 frame vocabulary (snapshot/records_append/messages/session/delta/heartbeat/done/error); the resume cursor advances only on records_append feed_seq; done outcomes derive status from the last session frame. connect keys queued chips on the created SessionMessage id (POST /messages returns it now) and reads status/cost from session frames; watch renders pushed raw records client-side; sendSessionMessage supports an idempotency key. Old binaries keep working via their 1003 REST-polling fallback.
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.
Ports the CLI to v2 of the Ellipsis session stream — the server now sends raw session records over the WebSocket and the client owns all rendering.
ws.ts: sends the required?protocol=2handshake and parses the v2 frames (snapshot/records_append/messages/session/delta/heartbeat/done/error). The resume cursor advances ONLY onrecords_appendfeed_seq;doneoutcomes derive their status word from the lastsessionframe; close 1002 joins 1003 as REST-polling fallbacks, 1013 (over capacity) retries with backoff. Unknown frame types/kinds are ignored, so additive server changes never break this client.connect: status + live cost come fromsessionframes; the open inbox slice (messagesframes) drives the queued region, and local chips now retire by the created message's id (POST /v1/sessions/{id}/messagesreturns the createdSessionMessage) plus the transcript user-echo back-reference — no more postSeq bookkeeping. The resume cursor seeds from the already-rendered transcript so reattach never replays what's on screen.--watch: renders the pushed raw records client-side with the same shapingconnectuses;--jsonemits the v2 frames as NDJSON.sendSessionMessagereturns the createdSessionMessageand supports an idempotency key for retry-safe sends.Previously released binaries keep working against a v2 backend via their existing close-1003 → REST-polling fallback; this should release alongside the backend cutover.
Verified: 246 tests green (ws suite updated to v2 semantics),
tsc --noEmitclean,bun --compilebinary builds and prints its version.