feat(realtime): add generationTick event for billing updates#81
Merged
AdirAmsalem merged 1 commit intomainfrom Feb 12, 2026
Merged
feat(realtime): add generationTick event for billing updates#81AdirAmsalem merged 1 commit intomainfrom
AdirAmsalem merged 1 commit intomainfrom
Conversation
Surface the generation_tick WebSocket message from bouncer as a public generationTick event on the realtime client. This lets consumers track billed seconds in real-time during authenticated sessions. generation_ended is parsed but intentionally not exposed — devs should use connectionChange for disconnect and error for insufficient credits. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
commit: |
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
generation_tickWebSocket message as a publicgenerationTickevent on the realtime client, letting consumers track billed seconds in real-time during authenticated sessionsgeneration_endedinternally but intentionally does not expose it — devs should useconnectionChangefor disconnect anderrorfor insufficient creditsUsage
Changes
types.tsGenerationTickMessage,GenerationEndedMessagetypes +IncomingWebRTCMessageunionwebrtc-connection.tshandleSignalingMessage, emitgenerationTickvia mittclient.tsgenerationTicktoEventstype, wire listener to buffered event emitterDesign Decisions
generation_endednot exposed: It's unreliable (won't arrive on client-initiated disconnect or network drop) and overlaps withconnectionChange: "disconnected". Theinsufficient_creditscase is already covered by theerrorevent.generationTick): Matches existing SDK conventions (connectionChange,promptAck,sessionId). Wire format stays snake_case.Eventstype —on/offjust gains a new event key.Note
Low Risk
Additive event/type wiring only; no changes to core connection/retry logic or outbound protocol behavior.
Overview
Surfaces server-side
generation_tickupdates as a new public realtime client eventgenerationTick, allowing consumers to track billed generation seconds during a session.Adds new websocket message types
GenerationTickMessageandGenerationEndedMessageto the signaling type union; the connection layer emitsgenerationTickvia its internal emitter and explicitly parses-but-does-not-exposegeneration_ended.Written by Cursor Bugbot for commit f95fa8f. This will update automatically on new commits. Configure here.