Repository navigation
fix(conversations-v3): keep rotation-sealed recordings out of the reconnect hold - #26762
Merged
Merged
Conversation
…onnect hold Follow-up to #26749, from its round-5 review. A recording listen rotation sealed at its cap could also read as a live cut: its seal lands right after its last line when the speech goes on. Wherever main's rotation check let it go, the reconnect hold took over. A same-device successor that closed into the server-batch handoff before its transcript landed then kept the rotated stretch open for up to 15 minutes after that close, where main queues its notes. - _live_cut rejects a recording with a valid rotation stamp; the other recordings in the load are still checked for reconnect cuts. - _rotation_cap is the one definition of a valid stamp, used by the rotation check and _live_cut, so the two cannot disagree about which owns a recording. The rotation check behaves as before. Failure-Class: FC-live-settlement-uses-capture-clock
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.
What changed and why
Follow-up to #26749, from its round-5 review. Listen rotation seals a recording at its cap, often mid-speech, and
opens the next one on the same device at once. Such a seal can fall within 90 s of the last line, so
_live_cutcounted it as a reconnect cut, and the reconnect hold took over wherever
main's rotation check let the recordinggo.
Synthetic case: A rotates at 300 s and B opens on the same device. B enters the completed server-batch handoff at
400 s (
completedwithhome_transcription_pending_at) before its transcript lands. With capture continuity off,and before #26749, A's card locks at 621 s with its notes queued. With continuity on, the reconnect wait kept A open
until B's transcript landed, or until about 1,300 s.
The fix, in
backend/database/conversations_v3.py:_live_cutrejects a recording with a valid rotation stamp. Rotation's own hold (policy.awaiting_transcript)alone decides it, under either setting.
_rotation_capis the one definition of a valid stamp (anintorfloatwith 0 < cap <= 3600). The rotationcheck and
_live_cutboth use it, so the two paths cannot disagree about which one owns a recording. The rotationcheck behaves as before.
Expected latency cost
CONVERSATIONS_V3_RECORDING_ROTATION).Product invariants affected
none
How it was verified
main. Onmain's loader (743bd94141), the same-device replay with capturecontinuity on fails as the review found, while the cross-device arms and continuity off pass. The new loader test
fails there too: the rotation-sealed recording is held. On this head every case passes.
_live_cut, passes the replay but fails the loader test, because the earlier reconnect cut loses its hold.--jobs 4 --repeat 2 --stt replay, passed in both runs (89.6 s).reconnect_successor_lands_latepasses 9/9 at 367 reads, and every scenario's checks and counts match the fix(conversations-v3): keep a stretch open for the capture after a reconnect #26749head.
BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh): alltest_conversations_v3*,test_pipeline_lab*,test_batch_pipeline_projection*, capture-end, record-seal andserver-batch-completion files. All 158 files passed: 5,113 tests, none failed.
scripts/typecheck.shreports 0 errors.make preflightwith this body passed 40 of 41 checks, including the line-count exception, thefailure class and the index guard. The one failure is
feature-flag-registryat today's UTC date: 82 flag entriesdue 2026-11-22 are past their grace, repo-wide, and this PR changes no flag.
scripts/check_feature_flag_registry.py --as-of 2026-11-29passes, and metadata-only preflight passes 4 of 4.Tests
backend/tests/unit/test_conversations_v3_successor_hold.py(74 cases, 3 new):test_rotation_lets_a_closed_capture_go_as_main_doesnow runs B on the same phone as well as on another device,each with capture continuity on and off. At 621 s A's card is locked with its notes queued in all four.
test_a_rotation_seal_is_no_live_cut_while_other_cuts_still_hold: a rotation-sealed latest recording whosesuccessor closed into the handoff is not held, while an earlier reconnect cut in the same load still holds on its
capturing successor.
Each test runs at or under the 1.0 s CPU budget.
UI evidence
UI-Evidence: none -- backend-only change
Failure class (fixes)
Failure-Class: FC-live-settlement-uses-capture-clock
Line-Count-Exception: backend/database/conversations_v3.py | 2667 -> 2675 | one shared rotation-stamp check, used by the rotation check and
_live_cut, beside the loader's successor checks that already live here🤖 Generated with Claude Code