Skip to content

fix(elevenlabs): surface realtime provider error events - #120772

Merged
steipete merged 1 commit into
mainfrom
codex/qa-elevenlabs-realtime-provider-error-events
Aug 8, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-elevenlabs-realtime-provider-error-events

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Realtime transcription silently ignored documented provider failures such as rate limits, exhausted quota, queue overflow, and throttled commits because their event names do not contain the word error.

Why This Change Was Made

The plugin's existing websocket event owner now recognizes the provider's documented structural error field as well as the previously supported error-named events. Existing connection failure handling and normal transcription events continue through their original paths.

User Impact

Provider failures now surface exactly once with their actionable original message, both before a realtime session becomes ready and after it is active.

Evidence

  • Tests against a real loopback websocket reproduced five failures while seven existing behavior checks passed.
  • The exact repaired owner passes all 12 focused websocket tests, and the provider plus shared websocket lifecycle suites pass 38 tests.
  • The complete remote changed-file gate and a fresh structured review both pass without findings.
  • An independent review checked the provider's documented error-event contract and confirmed normal transcription and legacy error events remain unchanged.
  • The owner-only change adds one net production line and does not alter configuration, authentication, public protocols, or persistent state.

@steipete
steipete marked this pull request as ready for review August 8, 2026 23:41
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 8, 2026, 7:47 PM ET / 23:47 UTC.

ClawSweeper review

What this changes

The PR treats ElevenLabs realtime events with a string error field as provider failures even when their event type does not include “error.”.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open: its provider classifier fixes the silent-event gap, but newly recognized startup errors produce two terminal error events in Voice Call and the Gateway relay.

Priority: P1
Reviewed head: 2cc66c5fcd8b0e3c1c78646b4ca9114bacdb7aea

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The repair has strong local intent and focused coverage, but a P1 cross-boundary delivery regression blocks merge.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its described loopback websocket run is useful but does not cover the duplicate terminal consumer path.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its described loopback websocket run is useful but does not cover the duplicate terminal consumer path.
Evidence reviewed 7 items Changed startup-error branch: The new structural-error condition sends a pre-ready event through failConnect, which is the path that both reports an error callback and rejects connect.
Shared lifecycle behavior: failConnect emits callbacks.onError before rejecting the pending connection, so consumers receive two signals for one startup failure.
Voice Call duplicate consumer path: Voice Call emits session.error from onError and again from the rejected connect catch, without deduplication.
Findings 1 actionable finding [P1] Avoid double-reporting pre-ready provider failures
Security None None.

How this fits together

The ElevenLabs plugin translates websocket frames into realtime-transcription callbacks. Voice Call and the Gateway relay consume those callbacks to notify operators and terminate failed transcription sessions.

flowchart LR
A[ElevenLabs websocket] --> B[ElevenLabs plugin]
B --> C{Error before ready?}
C --> D[Shared connection failure]
D --> E[Error callback]
D --> F[Rejected connection]
E --> G[Voice Call and Gateway relay]
F --> G
G --> H[Two terminal error events]
Loading

Before merge

  • Avoid double-reporting pre-ready provider failures (P1) - failConnect calls onError before rejecting connect(). Voice Call and the Gateway relay both forward the callback and the rejection as terminal session errors, so each newly recognized startup failure is reported twice. Preserve one terminal outcome and cover the consumer boundary.
  • Resolve merge risk (P1) - Pre-ready rate-limit, quota, queue-overflow, and throttling events will be sent twice to Voice Call and Gateway clients as terminal session errors.
  • Resolve merge risk (P1) - Direct official confirmation that ElevenLabs reserves error: string for failure events is still needed before relying on that field as the classifier.
  • Complete next step (P2) - A narrow cross-boundary repair can preserve the useful provider classifier while restoring one terminal startup outcome.

Findings

  • [P1] Avoid double-reporting pre-ready provider failures — extensions/elevenlabs/realtime-transcription-provider.ts:202-204
Agent review details

Security

None.

PR surface

Source +1, Tests +95. Total +96 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 2 +1
Tests 1 97 2 +95
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 100 4 +96

Review metrics

Metric Value Why it matters
Production versus test delta production +3/-2 (net +1), tests +97/-2 (net +95) The small plugin change needs cross-boundary coverage because startup errors traverse two terminal consumer paths.

Stored data model

Persistent data-model change detected: serialized state: extensions/elevenlabs/realtime-transcription-provider.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Deduplicate startup failures before merge (recommended)
    Keep the provider classification, but ensure each pre-ready failure produces one terminal error through Voice Call and the Gateway relay, with boundary regressions.
  2. Pause for provider-contract confirmation
    Do not merge until an official ElevenLabs event reference or a redacted real-provider trace confirms that non-error events cannot carry a string error field.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve failConnect's callback-and-rejection contract; make pre-ready transcription failures emit exactly one terminal error in Voice Call and Gateway relay paths, then add focused boundary coverage.

Technical review

Best possible solution:

Preserve the shared pre-ready callback-plus-rejection contract, but make startup failure reporting have one owner in Voice Call and the Gateway relay while ready-session callbacks continue to report live errors.

Do we have a high-confidence way to reproduce the issue?

Yes: source shows that a pre-ready structural error invokes both the shared error callback and the rejected connection path, which both emit terminal errors in Voice Call and the Gateway relay.

Is this the best way to solve the issue?

No: the plugin-owner classifier is the right place for ElevenLabs event recognition, but this PR does not preserve the one-terminal-outcome invariant across its consumers.

Full review comments:

  • [P1] Avoid double-reporting pre-ready provider failures — extensions/elevenlabs/realtime-transcription-provider.ts:202-204
    failConnect calls onError before rejecting connect(). Voice Call and the Gateway relay both forward the callback and the rejection as terminal session errors, so each newly recognized startup failure is reported twice. Preserve one terminal outcome and cover the consumer boundary.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 019dd0e08659.

Labels

Label changes:

  • add P1: The patch would duplicate visible terminal provider-failure events in active Voice Call and Gateway transcription workflows.
  • add merge-risk: 🚨 message-delivery: A newly recognized pre-ready provider failure reaches each affected transport as two terminal session-error events.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its described loopback websocket run is useful but does not cover the duplicate terminal consumer path.

Label justifications:

  • P1: The patch would duplicate visible terminal provider-failure events in active Voice Call and Gateway transcription workflows.
  • merge-risk: 🚨 message-delivery: A newly recognized pre-ready provider failure reaches each affected transport as two terminal session-error events.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its described loopback websocket run is useful but does not cover the duplicate terminal consumer path.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs extensions/elevenlabs/realtime-transcription-provider.test.ts extensions/voice-call/src/media-stream.test.ts src/gateway/talk-transcription-relay.test.ts.
  • [P1] git diff --check.
  • [P1] Confirm the documented ElevenLabs websocket event schema or capture a redacted real-provider error trace.

What I checked:

Likely related people:

  • steipete: Introduced the streaming STT feature and the current ElevenLabs realtime event owner, and authored this repair. (role: feature origin and recent area contributor; confidence: high; commits: 51ed22e6081d, 8c059f95c51c; files: extensions/elevenlabs/realtime-transcription-provider.ts, extensions/elevenlabs/realtime-transcription-provider.test.ts)
  • VincentKoc: Recent history includes the shared talk-relay lifecycle that consumes realtime transcription errors. (role: recent gateway relay contributor; confidence: medium; commits: 548785581580, 796dbacdfc26; files: src/gateway/talk-transcription-relay.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add Voice Call and Gateway relay regressions proving one terminal error for a pre-ready ElevenLabs failure.
  • Cite the official ElevenLabs realtime-event contract or provide a redacted real-provider trace for the structural error field.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit fc1948d into main Aug 8, 2026
150 of 157 checks passed
@steipete
steipete deleted the codex/qa-elevenlabs-realtime-provider-error-events branch August 8, 2026 23:58
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 9, 2026
Punchcard-Session: amber-workshop-workshop-36

* origin/main: (28 commits)
  perf(doctor): keep bundled doctor contract closures dependency-light (#120698)
  fix(elevenlabs): preserve repeated committed speech segments (#120792)
  fix(ai): fence Responses replay metadata (#120777)
  fix(ai): invalidate stale compaction replay (#120786)
  fix(telegram): clean up every failed webhook startup phase (#120788)
  fix(codex): preserve configured MCP tools in scheduled turns (#120366)
  fix(ui): show dev checkout commit lag in Updates (#120769)
  fix(agents): repair XML-polluted tool names (#113814)
  fix(discord): remove only the bot own reactions (#120785)
  fix(macos): complete ChatGPT subscription setup (#120782)
  fix(plugins): surface safe administrator install warnings (#120783)
  fix(release): keep upgrade survivor sessions fresh (#120778)
  fix(providers): preserve realtime tool-result delivery ownership (#120776)
  fix(plugins): retain incognito scope for embedded session ownership (#120215)
  fix(elevenlabs): surface realtime provider error events (#120772)
  fix(agents): preserve exact steering delivery ownership (#120770)
  fix(telegram): prevent session-count routing slowdown (#120774)
  fix(agents): preserve authoritative background process outcomes (#120754)
  test(process): make Linux adapter wiring portable (#120741)
  fix(diagnostics-prometheus): send Content-Length on metrics HEAD responses (#120212)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: elevenlabs maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant