Skip to content

test(deepgram): observe realtime transcription completion - #134383

Merged
steipete merged 1 commit into
mainfrom
codex/test-deepgram-transcription-completion
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-deepgram-transcription-completion

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Deepgram's local WebSocket tests poll mock call counts after frames have already arrived. Two count-based waits can also complete before the final fixture frame is processed.

Why this approach?

Resolve bounded completion promises from the existing provider callbacks. The two multi-frame negative/count cases wait for a distinct final error marker on the same ordered WebSocket before asserting the complete callback history. Keep the existing fake-clock deadline tests and production timeouts unchanged.

Each changed session owns close in finally. If the no-result finalization case fails before installing its clock, cleanup installs the clock before close and drains the existing five-second fallback window. The overflow case now checks disconnection before test cleanup.

User impact

Test-only change: production +0/-0; tests +116/-41. Eight positive polling observations become callback-backed waits; all 18 Deepgram cases and their existing semantic assertions remain. Local sockets and the real provider/session owners remain in use.

Evidence

All 69 selected Deepgram, ElevenLabs and shared WebSocket tests pass before and after. Full changed-file checks and Codex autoreview pass.

A deliberate missing completion signal produced exactly the original one-second waitFor failure. Before real server teardown, cleanup had drained both timers, emitted one Finalize request and the retained transcript once, and marked the session disconnected. Real server teardown completed, Vitest reported no unhandled errors, and the joined probe restored exact source bytes. This is local transport and failure-cleanup proof, not a live provider result or an elapsed-time benchmark.

node scripts/run-vitest.mjs extensions/deepgram/realtime-transcription-provider.test.ts extensions/elevenlabs/realtime-transcription-provider.test.ts src/realtime-transcription/websocket-session.test.ts

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:53 PM ET / 18:53 UTC.

ClawSweeper review

What this changes

The PR replaces polling-based Deepgram realtime WebSocket test waits with callback-backed completion signals and adds failure-safe session cleanup.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer review. The focused test-only change makes completion observation deterministic while preserving the Deepgram session’s real callback and close paths; current main still has the polling-based tests, and the maintainer label prevents automated cleanup closure.

Priority: P3
Reviewed head: f79ac4363824e803eb55296ad359966ed0827e3b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, production-owner test improvement with credible local transport evidence; normal exact-head CI remains the remaining merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only local Deepgram tests. Its supplied terminal evidence exercises the real plugin session through a local WebSocket fixture and reports callback completion and cleanup results; an external-contributor proof gate does not apply.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes only local Deepgram tests. Its supplied terminal evidence exercises the real plugin session through a local WebSocket fixture and reports callback completion and cleanup results; an external-contributor proof gate does not apply.
Evidence reviewed 6 items Introduced test synchronization: The PR’s introduced lines resolve deferred completion from the existing transcript callback, then assert the expected transcript after that callback fires; this observes the production-owner callback rather than polling mock state.
Ordered negative-case observation: The multi-frame negative and duplicate-transcript cases use a final ordered fixture Error frame as a delivery marker, then retain assertions for the full callback history.
Production owner and caller boundary: The plugin registers the Deepgram realtime provider, whose event handler emits transcript callbacks on final provider events and whose close hook sends Finalize with a bounded fallback for already-finalized text.
Findings None None.
Security None None.

How this fits together

The Deepgram plugin receives realtime WebSocket frames and converts them into partial, final transcript, speech-start, and error callbacks for OpenClaw’s shared transcription session. These tests drive that plugin against a local socket server and verify ordered callback delivery and close-time finalization.

flowchart LR
  A[Local WebSocket fixture] --> B[Deepgram realtime session]
  B --> C[Frame and close handling]
  C --> D[Transcript and error callbacks]
  D --> E[Completion observation]
  E --> F[Assertions and cleanup]
Loading

Before merge

  • Complete next step (P2) - No repair lane applies: this coherent maintainer-authored test PR needs ordinary exact-head CI completion and maintainer handling.
Agent review details

Security

None.

PR surface

Tests +75. Total +75 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 116 41 +75
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 116 41 +75

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +116/-41 (net +75) All added code strengthens asynchronous test observation and cleanup; no runtime, configuration, or dependency behavior changes.

Technical review

Best possible solution:

Land the callback-backed waits and ordered delivery markers once exact-head CI is complete, retaining the existing local WebSocket fixture as the real provider-session boundary.

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

Not applicable: this PR improves test synchronization rather than reporting a user-facing incident. The supplied local fixture evidence describes the relevant callback and cleanup scenario.

Is this the best way to solve the issue?

Yes. The changed waits observe the actual provider-session callbacks, while marker frames cover ordered multi-frame assertions that mock-count polling could complete before fully observing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 33029a1feb0a.

Labels

Label changes:

  • add P3: This is a focused test reliability improvement with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only local Deepgram tests. Its supplied terminal evidence exercises the real plugin session through a local WebSocket fixture and reports callback completion and cleanup results; an external-contributor proof gate does not apply.

Label justifications:

  • P3: This is a focused test reliability improvement with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only local Deepgram tests. Its supplied terminal evidence exercises the real plugin session through a local WebSocket fixture and reports callback completion and cleanup results; an external-contributor proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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

Copy link
Copy Markdown
Contributor Author

Maintainer source/test review is complete. The latest published ClawSweeper comment is the review-started placeholder, with no findings or Rank-up moves; it is not a substantive review. Independent Codex autoreview, full changed checks, all 69 selected provider/shared WebSocket tests and exact-head CI pass.

The missing-signal diagnostic retained the original waitFor timeout, drained both close/finalization timers, emitted Finalize and the retained transcript once, completed real server teardown without unhandled errors, and restored exact source after joined processes. Ordered final-frame markers protect the negative/count cases, and overflow disconnection is asserted before cleanup. Production +0/-0; tests +116/-41. Proceeding through native landing gates under the requested maintainer test-maintenance batch.

@steipete
steipete merged commit 2cbc2e5 into main Aug 31, 2026
109 checks passed
@steipete
steipete deleted the codex/test-deepgram-transcription-completion branch August 31, 2026 19:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: deepgram maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant