Skip to content

Upgrade to @moq 0.4 - #168

Draft
kixelated wants to merge 2 commits into
pipecat-ai:mainfrom
kixelated:claude/moq-0.4-upgrade
Draft

Upgrade to @moq 0.4#168
kixelated wants to merge 2 commits into
pipecat-ai:mainfrom
kixelated:claude/moq-0.4-upgrade

Conversation

@kixelated

Copy link
Copy Markdown
Contributor

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 (net 0.2.3, watch 0.4.4, publish 0.4.3, signals 0.2.1, hang 0.3.4, json 0.3.0). It's an API migration, not a version bump: inputs/outputs moved onto in/out, and the broadcast's inline audio prop became 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.
  • Client transcript track. publishTrack is gone, so the track is served off broadcast.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.
  • Playback. The audio source is constructed before Sync (it produces the jitter Sync reads, so the old order was a cycle), Audio.Decoder takes the sync positionally, and the graph handles (context, root, config) moved under out.
  • Transcript gate. On 0.2.x Reload.announced is 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 --noEmit and parcel build are 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-kit 0.13's BotAudioOutput, VoiceVisualizer, and BotVideoPanel all throw (plus a Received 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-kit release 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)

kixelated and others added 2 commits August 5, 2026 14:54
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
kixelated force-pushed the claude/moq-0.4-upgrade branch from a38cd8d to c396884 Compare August 5, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant