Repository navigation
fix(discord): retain voice input until transcription completes - #139484
Conversation
Keep temporary WAV input alive through queued and in-flight transcription, then release the owning workspace on every completion or discard path. Failed writes release their partial workspace immediately. Extracted from #130860.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 6:59 PM ET / 22:59 UTC. ClawSweeper reviewWhat this changesThe Discord plugin keeps temporary voice recordings until processing finishes and releases discarded or failed recordings promptly. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: pinned main and v2026.9.2 still delete WAV input after 30 minutes. No actionable introduced defect was found, and the broader related PR does not supersede this extraction. Priority: P2 Review scores
Verification
How this fits togetherDiscord voice capture writes decoded speech to a temporary WAV file and queues it for transcription. The resulting text feeds meeting transcripts or an agent response; the receiver and processing queue now share explicit responsibility for releasing the input file. flowchart TD
A[Discord speech] --> B[Decode and write WAV]
B --> C{Capture still usable?}
C -->|No| F[Release workspace]
C -->|Yes| D[Wait in processing queue]
D --> E[Transcribe and process text]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +129. Total +133 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep WAV lifetime tied to its actual processing owner, with cleanup on completion, failure, and discard. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold queued or in-progress WAV consumption beyond 30 minutes and the existing main timer removes its input. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Transferring the existing workspace cleanup handle follows the file's consumer lifetime and avoids another timeout or parallel cleanup mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36612a28e005. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (95 commits) perf(build): avoid unrelated gateway artifact scans (#127757) fix(update): deliver terminal progress after long updates (#139289) fix(ui): show session hover cards for local chat URLs (#139384) perf(ui): reuse unchanged transcript key snapshots (#139400) fix(ui): make subagent sessions view-only (#139381) fix: open agent state on SQLite builds without extensions (#139487) perf(skills): detach cached metadata from source strings (#139478) fix(ui): show primary user in multi-agent profile hero (#136736) perf(sessions): stop decoding the session row four times per SQLite entry patch (#136361) refactor(exec): share package-manager option scans (#139482) fix(ci): authorize frozen mobile release candidates (#139441) fix: avoid session deletion slowdown in large session stores (#139467) perf(gateway): reuse node invocation idle timers (#139354) fix(auth): preserve selected profiles across plugin scopes (#139413) fix(discord): retain voice input until transcription completes (#139484) fix(agents): name Gateway storage failures in run-failure copy (#139409) fix: keep subagent checks responsive in large session stores (#139450) fix(memory): index notes when optional embeddings cannot start (#139463) fix: refresh pending approvals when reopening chat (#139457) fix(tooling): preserve Git hook choices during install (#139461) ...
Keep explicit recording owned by its source across connection and manager replacement. Receive each speaker once, retain packet-time capture authority, and share completed batch transcription with authorized conversation. Separate recording progress from conversation admission and replies, fence incomplete or retired conversation input, and bound receive, conversation, and queued WAV work. Retain WAV ownership through delayed processing and cleanup, including when a retired recording hands off to conversation. Preserve short authorized recording chunks and distinguish completed empty transcription from omitted media input. Document lifecycle and limit behavior. Split from #130860. Follows #139484 and #139572. Related: #127426.
…law#139484) Keep temporary WAV input alive through queued and in-flight transcription, then release the owning workspace on every completion or discard path. Failed writes release their partial workspace immediately. Extracted from openclaw#130860.
) * fix(discord): keep recording independent of voice conversations Keep explicit recording owned by its source across connection and manager replacement. Receive each speaker once, retain packet-time capture authority, and share completed batch transcription with authorized conversation. Separate recording progress from conversation admission and replies, fence incomplete or retired conversation input, and bound receive, conversation, and queued WAV work. Retain WAV ownership through delayed processing and cleanup, including when a retired recording hands off to conversation. Preserve short authorized recording chunks and distinguish completed empty transcription from omitted media input. Document lifecycle and limit behavior. Split from #130860. Follows #139484 and #139572. Related: #127426. * fix(discord): keep package-boundary types portable Spell the existing channel-resolution union within the plugin and type the transcript fixture callback with its public SDK contract. This removes a forbidden normalization-core import and prevents Vitest's private Procedure type from leaking into generated declarations. Validation: normalization import guard, all 123 plugin package boundaries, extension and root integration types, 53 voice cases and two core provider integrations, and scoped P0-P2 review. * fix(discord): retain safely bound realtime-only recordings Preserve existing per-speaker realtime finals when batch audio is disabled or the actual media runtime confirms no backend is available. Carry packet capture receipts through delayed admission and wait for every batch result; successful, silent, failed, mixed, or incomplete input cannot duplicate or authorize fallback notes. A provider continuity reset permanently retires the recording owner until a fresh speaker connection establishes receipts. Bound pending final text and surface limited coverage through /vc status. Document the independent batch path and the narrower realtime-only contract. Related to #130860 and #139658. * test(discord): declare capture-only fixture capability Keep fake transcript managers aligned with the required realtime capability query. These integration fixtures have no realtime conversation and return false without weakening the production interface. Validation: canonical root test types, provider integration, scoped lint, and independent P0-P2 review passed. * refactor(discord): make recording contracts a type-only leaf Move capture, packet-receipt, and segment-result contracts out of their runtime owners, breaking the full import graph cycle. Narrow realtime recording metadata to the three strings it consumes. All six existing modules emit identical JavaScript; the new leaf emits none. Validation: both import-cycle guards, three canonical type lanes, 18 focused tests, lint, full build, and scoped P0-P2 review passed.
…claw#139658) * fix(discord): keep recording independent of voice conversations Keep explicit recording owned by its source across connection and manager replacement. Receive each speaker once, retain packet-time capture authority, and share completed batch transcription with authorized conversation. Separate recording progress from conversation admission and replies, fence incomplete or retired conversation input, and bound receive, conversation, and queued WAV work. Retain WAV ownership through delayed processing and cleanup, including when a retired recording hands off to conversation. Preserve short authorized recording chunks and distinguish completed empty transcription from omitted media input. Document lifecycle and limit behavior. Split from openclaw#130860. Follows openclaw#139484 and openclaw#139572. Related: openclaw#127426. * fix(discord): keep package-boundary types portable Spell the existing channel-resolution union within the plugin and type the transcript fixture callback with its public SDK contract. This removes a forbidden normalization-core import and prevents Vitest's private Procedure type from leaking into generated declarations. Validation: normalization import guard, all 123 plugin package boundaries, extension and root integration types, 53 voice cases and two core provider integrations, and scoped P0-P2 review. * fix(discord): retain safely bound realtime-only recordings Preserve existing per-speaker realtime finals when batch audio is disabled or the actual media runtime confirms no backend is available. Carry packet capture receipts through delayed admission and wait for every batch result; successful, silent, failed, mixed, or incomplete input cannot duplicate or authorize fallback notes. A provider continuity reset permanently retires the recording owner until a fresh speaker connection establishes receipts. Bound pending final text and surface limited coverage through /vc status. Document the independent batch path and the narrower realtime-only contract. Related to openclaw#130860 and openclaw#139658. * test(discord): declare capture-only fixture capability Keep fake transcript managers aligned with the required realtime capability query. These integration fixtures have no realtime conversation and return false without weakening the production interface. Validation: canonical root test types, provider integration, scoped lint, and independent P0-P2 review passed. * refactor(discord): make recording contracts a type-only leaf Move capture, packet-receipt, and segment-result contracts out of their runtime owners, breaking the full import graph cycle. Narrow realtime recording metadata to the three strings it consumes. All six existing modules emit identical JavaScript; the new leaf emits none. Validation: both import-cycle guards, three canonical type lanes, 18 focused tests, lint, full build, and scoped P0-P2 review passed.
Related: #130860
What Problem This Solves
Fixes an issue where Discord voice transcription could lose its temporary audio when it stayed queued or in progress for more than 30 minutes. Failed and discarded recordings also retained temporary workspace resources after they were no longer needed.
Why This Change Was Made
WAV creation now returns the existing workspace's cleanup handle. The receiver retains ownership until it either discards the input or transfers it to the processing queue; queue completion releases the workspace on both success and failure.
This extracts the independent WAV lifetime repair from #130860. The shared transcription mock now uses the runtime method's real type so its file-consuming regressions are checked accurately.
User Impact
Long-running and queued transcriptions keep valid audio until they finish. Short, stale, failed, and replaced captures release their temporary files promptly, along with the workspace's retained cleanup resources.
Evidence
The focused tests exercise the Discord service boundaries with synthetic data; the broader live Discord work remains with #130860.