Upgrade to @moq 0.4 - #168
Draft
kixelated wants to merge 2 commits into
Draft
Conversation
The transcript track subscribed as soon as the connection was established, which assumes the bot is already on the relay. It isn't always: when the bot is started in response to our own announcement, its broadcast appears strictly after ours, so the stream was reset and never retried — leaving the client connected but silent. Gate it on the announcement instead, read off `Reload` rather than the established session so the gate spans reconnects. Only this track needs it. `Watch.Broadcast` has gated its own subscribe on `conn.announced(name)` since moq-dev/moq#2199, so the catalog and audio are already covered; the transcript goes straight through `@moq/net` with no wrapper. Co-Authored-By: Claude <noreply@anthropic.com>
Picks up the 0.4-era libraries, which reshaped inputs/outputs onto `in` and `out` and replaced the broadcast's inline `audio` prop with a registered rendition. - Publishing: `Publish.Audio.Encoder` registers the `audio` rendition on the broadcast and fills its catalog entry, fed by the microphone's `out.source`. - The client transcript track is served off `broadcast.net` rather than the removed `publishTrack`. `net` swaps on reconnect, so the producer is rebuilt and the message log replayed into it, keeping the guarantee that a bot subscribing late still gets every message in order. - Playback: the source is built before `Sync` (it produces the jitter Sync reads), the decoder takes the sync positionally, and the graph handles move under `out`. - `Reload.announced` is a prefix stream here rather than a membership set, so the transcript gate drains it — which also picks up a same-name republish, where the membership set never changed. The characterization mocks move with the API: outputs under `out`, an `Audio.Encoder`, and a `net` on the publish broadcast. Co-Authored-By: Claude <noreply@anthropic.com>
kixelated
force-pushed
the
claude/moq-0.4-upgrade
branch
from
August 5, 2026 22:02
a38cd8d to
c396884
Compare
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.
Stacked on #167 — its commit is the first of the two here, so review that one first. The second commit is the upgrade.
What
Moves
@moq/*from the 0.1/0.2 line to current (net0.2.3,watch0.4.4,publish0.4.3,signals0.2.1,hang0.3.4,json0.3.0). It's an API migration, not a version bump: inputs/outputs moved ontoin/out, and the broadcast's inlineaudioprop became a registered rendition.Publish.Audio.Encoderregisters theaudiorendition on the broadcast and fills its catalog entry, fed by the microphone'sout.source.publishTrackis gone, so the track is served offbroadcast.net. That signal swaps on reconnect, so the producer is rebuilt and the message log replayed into it — preserving the guarantee that a bot subscribing late still receives every message, in order.Sync(it produces the jitterSyncreads, so the old order was a cycle),Audio.Decodertakes the sync positionally, and the graph handles (context,root,config) moved underout.Reload.announcedis a prefix stream rather than a membership set, so the gate drains it. That's strictly better than MoQ: wait for the bot's broadcast before subscribing to it #167's version: it also catches a same-name republish, where the membership set never changes.Testing
tsc --noEmitandparcel buildare clean.Not verified end-to-end, and it should not merge until it is. Against a live bot the prebuilt playground renders a blank page:
voice-ui-kit0.13'sBotAudioOutput,VoiceVisualizer, andBotVideoPanelall throw (plus aReceived NaN for the children attribute). The same app on the #167 branch, pre-upgrade, works — connects, renders the transcript, plays audio — so the regression is this upgrade meeting a kit built against the older line.That makes it the same version-chain problem as pipecat-ai/pipecat#4629: this needs a
voice-ui-kitrelease on 0.4 before it can land. I haven't investigated whether the kit needs changes or only a rebuild.Note
#167's gate becomes redundant on top of moq-dev/moq#2617, which adds
announcedBroadcast(path)— a reactive handle owning exactly the wait-for-publisher, republish, and reconnect cases hand-rolled here. Worth collapsing to once that lands.(written by Opus 5)