Read every recording-list page, and stop losing the GetTranscription race - #2
Open
themightychris wants to merge 1 commit into
Open
Conversation
Two interception bugs made the CLI silently lossy. GetRecordingList is paginated at 10 items per page, and the web app issues one request per page. The interceptor resolved on the *first* response, so only the newest page was ever seen. Recordings past the first page could not be listed, and since `transcript`, `download`, and `info` all resolve a recording's audio_id through that same list, they failed those recordings with "Recording not found". Adding an 11th recording was enough to make a previously working recording unreachable. `_intercept_grpc_pages` now accumulates every page and merges them, deduped by id. The GetTranscription "wait for largest payload" path resolved exactly 3s after listener registration, whether or not anything had arrived; if the page issued the call later (cold profile, slow network) the future was never resolved and the caller timed out with a misleading "may not have a transcript yet". The settle window is now measured from the last arrival rather than from registration, so it waits for the payload instead of racing it. Verified 8/8 consecutive successes on recordings that previously failed ~40% of the time, including a 41-minute one. List and transcript deadlines go 30s -> 60s to accommodate the settle window, and the transcript timeout message no longer asserts a cause it cannot know. Co-Authored-By: Claude Opus 5 <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.
Problem
Two interception bugs make the CLI silently lossy.
1. Only the first page of the recording list is read.
GetRecordingListis paginated at 10 items per page, and the web app issues one request per page._intercept_grpcresolves on the first response, so only the newest page is ever seen. Recordings past page 1 can't be listed — and becausetranscript,download, andinfoall resolveaudio_idthrough that same list, those recordings fail withRecording not found. Adding one new recording is enough to make a previously working recording unreachable.syncskips them and still reports success.2. The GetTranscription settle window races the payload. The
wait_for_largestbranch resolves exactly 3s after listener registration, whether or not anything has arrived. When the page issues the call later than that (cold profile, slow network), the future is never resolved and the caller times out withThe recording may not have a transcript yet— a cause it can't actually know. Roughly 40% of runs failed; retrying usually worked.Fix
_intercept_grpc_pagesaccumulates everyGetRecordingListresponse and merges the item lists, deduped by id, returning the same[[items], token]shape the parsers already expect. Wired into all three call sites.wait_for_largestsettle window is measured from the last arrival rather than from registration, so it waits for the payload instead of racing it. It no longer gives up on its own — the caller'sasyncio.wait_forsupplies the deadline.Verification
Real account, headless Chrome on Linux.
syncover a library spanning two list pages:A recording that had been failing intermittently now succeeds 8/8 consecutive runs with a byte-identical 36,780-byte payload, including a 41-minute one. Existing 52 tests still pass.
Noted, not fixed
A recording whose list metadata reports
has_transcript=truecan still return an emptyGetTranscriptionpayload ([[[]]]). With the race fixed this no longer times out — instead the CLI writes a 0-byte file and printsTranscript saved. Whether to skip, warn, or error seemed like your call.🤖 Generated with Claude Code