Skip to content

feat(ai.tts): add paxa input streaming - #312

Merged
heypoom merged 1 commit into
mainfrom
paxa-labs-incremental-text-streaming
Oct 11, 2026
Merged

heypoom merged 1 commit into
mainfrom
paxa-labs-incremental-text-streaming

Conversation

@heypoom

@heypoom heypoom commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Add input streaming for paxa

Summary by CodeRabbit

  • New Features
    • Added Paxa as a text-to-speech provider, with provider-specific settings and voice options.
    • Added live speech input for Paxa: send text in fragments, synthesize buffered text without ending the session, and finish by playing the remaining audio.
    • Live speech streams audio as it arrives and can be stopped to discard pending audio.
  • Documentation
    • Added setup and usage guidance for Paxa text-to-speech and live speech sessions.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c40d3eb8-ebb5-41f9-aabf-b8b4bbb2d16c

📥 Commits

Reviewing files that changed from the base of the PR and between 27a4934 and c84f592.


📒 Files selected for processing (16)
  • docs/design-docs/specs/187-gemini-text-to-speech.md
  • docs/design-docs/specs/196-paxa-text-to-speech.md
  • server/go.mod
  • server/main.go
  • server/paxa_live.go
  • server/paxa_live_test.go
  • ui/src/lib/ai/object-descriptions-types.ts
  • ui/src/lib/ai/object-prompts/index.ts
  • ui/src/objects/ai.tts/AiSpeechNode.svelte
  • ui/src/objects/ai.tts/live-session.test.ts
  • ui/src/objects/ai.tts/live-session.ts
  • ui/src/objects/ai.tts/prompt.ts
  • ui/src/objects/ai.tts/schema.ts
  • ui/src/objects/ai.tts/useLiveSpeech.svelte.ts
  • ui/src/objects/ai.tts/useLiveSpeech.test.ts
  • ui/static/content/objects/ai.tts.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9fdaac07-cced-4c72-8ef1-b14a647d5d6f


📥 Commits

Reviewing files that changed from the base of the PR and between fa1dc81 and 27a4934.



📒 Files selected for processing (4)
  • ui/src/objects/ai.tts/schema.ts
  • ui/src/objects/ai.tts/useLiveSpeech.svelte.ts
  • ui/src/objects/ai.tts/useLiveSpeech.test.ts
  • ui/static/content/objects/ai.tts.md


Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.




📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The change adds a specification for Paxa text-to-speech and implements incremental Paxa speech sessions through a same-origin WebSocket relay. The TTS node accepts append, flush, and end messages, and the prompt and documentation describe the new controls.

Changes

Paxa live text-to-speech

Layer / File(s) Summary
Provider and live-session specification
docs/design-docs/specs/187-gemini-text-to-speech.md, docs/design-docs/specs/196-paxa-text-to-speech.md
The new Paxa specification describes provider settings, playback modes, incremental sessions, and relay requirements. Paxa provider and streaming-playback sections were removed from the earlier specification.
Authenticated WebSocket relay
server/go.mod, server/main.go, server/paxa_live.go, server/paxa_live_test.go
The server registers the Paxa live endpoint and relays authenticated WebSocket frames to Paxa. Tests cover authentication, origin validation, frame forwarding, and upstream failures.
Browser live-session protocol
ui/src/objects/ai.tts/schema.ts, ui/src/objects/ai.tts/live-session.ts, ui/src/objects/ai.tts/live-session.test.ts
The UI adds append, flush, and end message schemas and a session that queues commands until ready, plays audio in order, and handles completion, closure, and errors.
Node integration and live-speech lifecycle
ui/src/objects/ai.tts/AiSpeechNode.svelte, ui/src/objects/ai.tts/useLiveSpeech.svelte.ts, ui/src/objects/ai.tts/useLiveSpeech.test.ts, ui/src/objects/ai.tts/prompt.ts, ui/src/lib/ai/object-descriptions-types.ts, ui/src/lib/ai/object-prompts/index.ts, ui/static/content/objects/ai.tts.md
The TTS node routes incremental messages to the live-speech controller and displays its loading state. The controller validates requirements and manages playback and cancellation. The prompt and documentation describe the controls and session behavior.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant AiSpeechNode
  participant useLiveSpeech
  participant PaxaLiveSession
  participant GoRelay
  participant Paxa
  participant SpeechStreamPlayer
  AiSpeechNode->>useLiveSpeech: append, flush, or end
  useLiveSpeech->>PaxaLiveSession: open session and append text
  PaxaLiveSession->>GoRelay: WebSocket authentication and session messages
  GoRelay->>Paxa: authenticated WebSocket frames
  Paxa-->>GoRelay: audio chunks and session events
  GoRelay-->>PaxaLiveSession: forwarded frames
  PaxaLiveSession->>SpeechStreamPlayer: play audio chunks in order
  PaxaLiveSession-->>useLiveSpeech: completion or error
Loading





































Merge Risk: ⚪ Minimal · up to 27a49

This change adds incremental Paxa speech controls (append, flush, end). No concrete merge-blocking risk was identified in the reviewed portion.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 11 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding Paxa input streaming to ai.tts.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 11 files. (1 skipped: 1 unsupported.)




✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR











🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔇 Additional comments (15)
docs/design-docs/specs/196-paxa-text-to-speech.md (1)

1-33: LGTM!

server/go.mod (1)

5-8: LGTM!

server/main.go (1)

36-39: LGTM!

server/paxa_live.go (1)

45-55: LGTM!

server/paxa_live_test.go (1)

1-124: LGTM!

ui/src/objects/ai.tts/schema.ts (1)

11-13: LGTM!

Also applies to: 23-25, 46-54

ui/src/objects/ai.tts/live-session.test.ts (1)

1-166: LGTM!

ui/src/objects/ai.tts/useLiveSpeech.svelte.ts (1)

32-95: LGTM!

ui/src/objects/ai.tts/useLiveSpeech.test.ts (1)

1-118: LGTM!

ui/src/objects/ai.tts/AiSpeechNode.svelte (1)

93-110: LGTM!

Also applies to: 223-225, 333-333, 346-346

ui/src/objects/ai.tts/prompt.ts (1)

1-35: LGTM!

ui/src/lib/ai/object-descriptions-types.ts (1)

141-141: LGTM!

Also applies to: 276-276

ui/src/lib/ai/object-prompts/index.ts (1)

6-6: LGTM!

Also applies to: 91-91

ui/static/content/objects/ai.tts.md (1)

58-90: LGTM!

ui/src/objects/ai.tts/live-session.ts (1)

74-81: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Detach socket handlers in stop().

stop() closes the socket but keeps the onopen, onmessage, onerror, and onclose handlers attached. The closed guards stop late events from doing anything, so this does not change behavior. Clearing the handlers releases the closures that capture options. This follows the learning to remove WebSocket listeners when a socket closes.

♻️ Proposed change
     this.pending.length = 0;
+    this.socket.onopen = this.socket.onmessage = this.socket.onerror = this.socket.onclose = null;
     this.socket.close();

Based on learnings: "explicitly remove all registered event listeners (open, message, error, close) before/while closing".

Source: Learnings


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ece97eb-b255-4120-954d-f23f7d7c5978
📥 Commits

Reviewing files that changed from the base of the PR and between bcf341a and fa1dc81.

📒 Files selected for processing (16)
  • docs/design-docs/specs/187-gemini-text-to-speech.md
  • docs/design-docs/specs/196-paxa-text-to-speech.md
  • server/go.mod
  • server/main.go
  • server/paxa_live.go
  • server/paxa_live_test.go
  • ui/src/lib/ai/object-descriptions-types.ts
  • ui/src/lib/ai/object-prompts/index.ts
  • ui/src/objects/ai.tts/AiSpeechNode.svelte
  • ui/src/objects/ai.tts/live-session.test.ts
  • ui/src/objects/ai.tts/live-session.ts
  • ui/src/objects/ai.tts/prompt.ts
  • ui/src/objects/ai.tts/schema.ts
  • ui/src/objects/ai.tts/useLiveSpeech.svelte.ts
  • ui/src/objects/ai.tts/useLiveSpeech.test.ts
  • ui/static/content/objects/ai.tts.md
💤 Files with no reviewable changes (1)
  • docs/design-docs/specs/187-gemini-text-to-speech.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@heypoom
heypoom force-pushed the paxa-labs-incremental-text-streaming branch 5 times, most recently from 162c5e2 to 27a4934 Compare October 11, 2026 09:40
@heypoom
heypoom force-pushed the paxa-labs-incremental-text-streaming branch from 27a4934 to c84f592 Compare October 11, 2026 09:48
@heypoom
heypoom merged commit 04a6a18 into main Oct 11, 2026
2 checks passed
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