Repository navigation
Reliability: stop-timeout routing + I/O proc real-time safety - #520
Merged
Merged
Conversation
When stopAndAwaitFiles times out waiting for Audio.onRecordingComplete, the WAV header is not yet fully patched. Previously the controller fed those URLs straight into transcription, risking a corrupted transcript. Now the bridge returns CaptureStopResult with didTimeOut, the controller routes to the failed queue on timeout, and the user can retry from Settings - Meetings once the file finalizes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The CoreAudio I/O block is real-time critical and was emitting debug, warning, and error logs on the audio callback thread (throttled but still per-callback). Strip all logging, remove the now-dead callbackCount captured var, and document the RT-safety contract so future edits stay on the right side of it. Counter increments still use short NSLock acquisitions (acceptable); cleanup logs aggregate stats off-thread. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent reliability fixes uncovered in a focused audit of the meeting capture path.
1. Route stop-timeout meetings to the failed queue (8fde23a)
MeetingCaptureBridge.stopAndAwaitFilesresolves with whatever URLsAudioexposes whenmeetingStopTimeout(30s) fires, regardless of whetheronRecordingCompleteever ran. The controller was feeding those URLs directly into transcription, risking a corrupt transcript from a half-finalized WAV. The bridge now returns aCaptureStopResultcarryingdidTimeOut; on timeout the controller writes the audio into the failed queue (with retry available from Settings) and surfaces a clear error instead of attempting to transcribe.Adds a new
MeetingFailureKind.stopTimeout+ matchingMeetingFailureCopyso retry messaging is user-friendly. Also addsstop_timed_outto the existingmeeting_recording_stoppeddiagnostics event for visibility.2. Drop logging from the system audio I/O proc (32fa75b)
SystemAudioProcessTap.startAudioDevicewas running debug/warning/error logs from the CoreAudio I/O block — even withcallbackCount-based throttling, that's logging on the real-time audio callback thread. Strip the logs, remove the now-deadcallbackCountcapture, and document the RT-safety contract. Stats counters still capture the same data (success rate, dropped buffers);cleanup()logs them off-thread.Test plan
bash build.sh— cleanbash run-tests.sh— 848/848 (added 2 new cases forstopTimeoutclassification + copy)bash run-integration-smoke.sh— cleanonRecordingComplete. The branch is logically verified but not empirically reproduced.Follow-ups deliberately not in this PR
MeetingCaptureBridgeso the controller's timeout branch can be unit-tested with a mockNSLocks inAudio.swift, pre-allocate or pool the per-callbackAVAudioPCMBufferwrapper) — both real concerns but should land behind a benchmarkSTTRouter, failed-transcription persistence crash window,MeetingPromptDetectorpolling cost, transcript styler I/O on@MainActor🤖 Generated with Claude Code