Repository navigation
fix(discord): keep recording independent of voice conversations - #139658
Conversation
|
🦞👀 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 6, 2026, 2:08 AM ET / 06:08 UTC. ClawSweeper reviewWhat this changesSeparates Discord meeting recording from voice conversations and connection lifetimes, adds bounded audio processing, and preserves a guarded realtime-only transcription fallback. Merge readiness✅ Ready for maintainer review This remains useful work that current main has not absorbed. The earlier realtime-only compatibility blocker is addressed, and this review found no new actionable defect. Maintainer authorship and the protected label also preclude cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherDiscord voice receive feeds participant audio into recording and authorized agent conversations. Recording publishes meeting notes through the transcripts provider, while conversation separately controls agent requests and spoken replies. flowchart TD
A[Discord participant audio] --> B[Bounded speaker receive]
C[Explicit capture subscription] --> B
B --> D[Batch transcription]
D --> E[Current capture check]
E --> F[Meeting notes]
B --> G[Conversation authorization]
G --> H[Agent requests and voice replies]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1244, Tests +4460, Docs +106. Total +5810 across 59 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep capture lifetime owned by the exact source subscription, with independently authorized conversation and a bounded, explicitly limited realtime fallback. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main retires the transcript binding when its voice connection stops, so connection replacement can end an otherwise active recording. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes. Moving recording lifetime to the source subscription addresses the owning boundary, while the optional processing result and guarded realtime fallback preserve existing callers and eligible realtime-only setups. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f3f1995be7fe. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
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.
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.
dd0211d to
6389844
Compare
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.
|
Addressed the realtime-only recording regression in 852bf66. Existing per-speaker realtime finals are now retained only when every submitted audio packet belongs to the same current capture and all covering batch work confirms no backend is available. Early finals wait for batch settlement; successful or silent batch input suppresses duplicate notes, and failed, oversized, mixed, unbound, incomplete, or reset-generation input cannot authorize fallback text. Realtime credentials remain in their existing scope, and no extra provider session is started. The actual |
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.
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.
|
Merged via squash.
|
Add bounded archive search, paging, exports, and capture status over the existing SQLite records. Preserve canonical stored Markdown, public projection privacy, shared-archive access control, and original capture ownership during title edits. Only complete plugin metadata can establish that a source is unavailable. Compare stored dates by instant without rewriting their identity. Select bounded page keys before projecting notes and participants. Keep storage admission, schema, indexes, and current occupied-source ID behavior intact. Related: #130860 Builds on #139572 and #139658.
Add bounded archive search, paging, exports, and capture status over the existing SQLite records. Preserve canonical stored Markdown, public projection privacy, shared-archive access control, and original capture ownership during title edits. Only complete plugin metadata can establish that a source is unavailable. Compare stored dates by instant without rewriting their identity. Select bounded page keys before projecting notes and participants. Keep storage admission, schema, indexes, and current occupied-source ID behavior intact. Related: #130860 Builds on #139572 and #139658.
* feat(transcripts): browse and export saved meeting archives Add bounded archive search, paging, exports, and capture status over the existing SQLite records. Preserve canonical stored Markdown, public projection privacy, shared-archive access control, and original capture ownership during title edits. Only complete plugin metadata can establish that a source is unavailable. Compare stored dates by instant without rewriting their identity. Select bounded page keys before projecting notes and participants. Keep storage admission, schema, indexes, and current occupied-source ID behavior intact. Related: #130860 Builds on #139572 and #139658. * refactor(transcripts): distinguish stored and public notes readers * fix(transcripts): preserve legacy archive reads and speaker identities Preserve v2026.9.2 requests without paging arguments as the recent 2,000-row window, with UTF-16 clipping and the historical transport ceiling. Keep modern pages and downloads on their separate byte bounds. Map stored speaker IDs and labels independently through the public read projection without parsing provider-only utterance metadata. * test(transcripts): isolate timezone and cross-plugin E2E fixtures Run native timezone coverage in a process started with the requested zone. Keep hello lifecycle coverage on its supplied method list and move the Gateway/Discord integration proof to the root E2E owner without changing its assertions or resolved import targets. * test(transcripts): include archive methods in current inventory * refactor(transcripts): anchor methods after shipped catalog Preserve the full v2026.9.2 catalog prefix and every named descriptor while letting later main method additions merge independently.
…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.
…#139875) * feat(transcripts): browse and export saved meeting archives Add bounded archive search, paging, exports, and capture status over the existing SQLite records. Preserve canonical stored Markdown, public projection privacy, shared-archive access control, and original capture ownership during title edits. Only complete plugin metadata can establish that a source is unavailable. Compare stored dates by instant without rewriting their identity. Select bounded page keys before projecting notes and participants. Keep storage admission, schema, indexes, and current occupied-source ID behavior intact. Related: openclaw#130860 Builds on openclaw#139572 and openclaw#139658. * refactor(transcripts): distinguish stored and public notes readers * fix(transcripts): preserve legacy archive reads and speaker identities Preserve v2026.9.2 requests without paging arguments as the recent 2,000-row window, with UTF-16 clipping and the historical transport ceiling. Keep modern pages and downloads on their separate byte bounds. Map stored speaker IDs and labels independently through the public read projection without parsing provider-only utterance metadata. * test(transcripts): isolate timezone and cross-plugin E2E fixtures Run native timezone coverage in a process started with the requested zone. Keep hello lifecycle coverage on its supplied method list and move the Gateway/Discord integration proof to the root E2E owner without changing its assertions or resolved import targets. * test(transcripts): include archive methods in current inventory * refactor(transcripts): anchor methods after shipped catalog Preserve the full v2026.9.2 catalog prefix and every named descriptor while letting later main method additions merge independently.
Related: #130860, #127426. Follows #139484 and #139572.
What Problem This Solves
Fixes an issue where Discord meeting recordings could lose speech or stop when a voice connection changed, conversation authorization or a reply stalled, or realtime speaker connections were busy. Starting a recording during an in-flight conversation authorization could also miss a participant who was already speaking. Incomplete audio could reach a conversation or active-run control after a receive failure.
Why This Change Was Made
The Discord source now owns recording across connection and manager replacement. Each speaker has one bounded receive stream, and each audio packet retains the recording authority and timestamp under which it arrived. Recording can promote an existing pending receive reservation while conversation keeps its original admission request and authorization checks. Recording, pending conversation input, and serialized responses have separate lifecycle owners; conversation work cannot occupy the recording queue. Replacing an already-registered source transfers its subscription atomically without repeating Discord target validation, preserving dormant captures through lookup outages and carrying pending connection recovery to the new recording. Transport work follows the admitted source subscription; audio publication still requires the exact current recording. Stop and replacement revoke the exact recording; incomplete receive input retires its realtime speaker before recovery. Pending conversation input has explicit decoded-audio, utterance, and text limits, while recording continues. Realtime send and close failures are contained within the conversation owner.
Contiguous recording chunks share batch transcription with authorized
stt-ttsconversation, but command dispatch waits for the complete utterance. Shared media results distinguish completed empty transcription from omitted input. WAV files remain owned until processing releases them, preserving the cleanup fix from #139484. A retired recording releases its queue slot while an independently authorized conversation retains the same input operation. Pending WAV work is capped process-wide at 128 jobs and 64 MiB before files are created, including across reconnects. Input that loses every owner during the file write is cleaned immediately, before any pending processing queue.User Impact
Explicitly authorized meeting recordings continue across transport changes and conversation failures, retain short answers and bounded upload chunks, and keep speaker identity and audio-ingress timestamps. Failed or incomplete speech cannot become a partial conversation command. Existing realtime-only setups retain safely bound per-speaker final transcripts when batch transcription is disabled or no backend is available. This limited route waits for every covered batch operation, never duplicates successful or silent batch output, and rejects mixed capture input, failed/oversized/unknown input, and provider continuity resets. It does not promote realtime credentials or start another provider session.
/vc statusexposes the limited-coverage warning and directs operators to configure batch transcription for full room coverage. The documentation explains the lifecycle, authorization boundary, upload limits, and diagnostics.Evidence
Independent P0–P2 review passed for the refactor. The final compatibility review has no accepted/actionable findings. Its sole status-length report was disproven:
/vc statusfilters to the invocation guild, and the manager owns at most one active connection per guild.A complete 626-case voice run and all 11 cross-plugin integrations passed before rebase. On current main, 106 affected recording/conversation/capture/WAV cases and all 11 cross-plugin integrations passed, including the landed immediate-cleanup regression. The full changed-file gate passed, followed by focused verification of the final owner repairs. Final extension production/test and root integration types, lint, formatting, and diff checks passed. A full-run test polling race was repaired by awaiting the actual publication callback, preserving the assertion and timeout settings.
Final compatibility proof: all 16 real-manager cases passed, including
/vc status, disabled batch audio, delayed admission, batch settlement/silence/duplicates, capture replacement, provider resets, and bounded pending finals. A broad run passed 640 voice cases and all 11 integrations; its one test failure emitted a provider final before admission completed and passed after waiting for the actual turn-completion promise. All selected changed-file checks passed after fixture typing and status lint repairs, including production/test types, lint, dead-export scans, and boundary guards.CI exposed three missing capture-only fixture methods and a type import cycle. The fixture repair passed canonical root test types and both provider integrations. Shared capture, receipt, and segment-result contracts now live in a true type-only leaf; both runtime and Madge cycle guards pass, all six edited modules emit identical JavaScript, and the leaf emits none. The final full build, all three affected type lanes, lint, 18 focused cases, and independent review passed.
An isolated real media-runtime probe confirmed that a setup with only realtime-scoped provider credentials and no local STT returns the canonical no-model/omitted result with no attempted batch backend. The probe used actual provider selection/auth hooks and a network fence; no credentials were promoted.
Focused regressions reproduced lost recordings during queued authorization failure, pending initial admission, and realtime speaker-capacity exhaustion; occupancy replacement also reproduced spurious source transitions. Each is covered at its owning boundary.
Real libopus invalid-packet, decryption-error, and stream-error cases verify that incomplete speech cannot dispatch. Receive tests cover queue bounds, no-capture authorization, silence finalization, teardown, replacement, long speech, small upload budgets, and WAV cleanup.
Live OpenAI speech generation and file transcription passed with synthetic audio using
gpt-4o-mini-ttsandgpt-4o-transcribe: all three expected markers were recognized, input processing completed, and temporary audio was removed. All eight production source files in that proof match this slice.Discord transport proof uses synthetic connections with real SDK and libopus behavior. No live Discord room was used.