Hold the room until the report is received - #228
Merged
Merged
Conversation
ColtenOuO
reviewed
Oct 3, 2026
A completed interview could end with no report: the agent published the report packet, slept 250 ms and left, and a successful publish only queues the packet, so leaving could drop it and the page fell back to "the interviewer never returned a report". Every report the agent sends, provisional, regenerated or final, now republishes the same bytes up to three times, five seconds each, until the page answers with a receipt naming their SHA-256 digest, and the agent leaves only after that. No retry calls the report model again, and the Live session closes beside the first delivery rather than after it. A candidate who drops before acknowledging the provisional report gets it again on rejoining, and a recovery wait that begins with them already gone starts the rejoin grace instead of holding the room for the whole window. The page renders the first copy at once, ignores retransmissions, and keeps the room, Done and its fallback exits until its receipt has had its chance to leave. Its escape wait grows to 155 s and its wait for a regenerated report to 145 s, so both cover delivery. Close #133
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.
A completed interview could end with no report even on a build that contains #114: the agent published the report packet, slept 250 ms and left the room, and a successful publish only queues the packet, so leaving could drop it and the page fell back to "The report is still unavailable". The ending now freezes the packet and closes the Gemini session, and the room loop republishes the same bytes up to three times, five seconds each, until the page answers with a receipt naming their SHA-256 digest, and only then leaves. No retry calls the report model again. The page renders the first copy at once, ignores retransmissions, and holds the room, Done and its fallback exits until its receipt has had its chance to leave. The escape wait grows from 135 s to 155 s to cover delivery and the Gemini close.
Each session now logs
codetrial report_delivery ... outcome=acknowledged|unconfirmed|failed, which is the line to look for when a report goes missing again.Verified with
scripts/test.sh(exit 0; the Chromium and Playwright browser lanes were skipped locally because neither is installed). New unit tests cover a lost packet retransmitted until its receipt arrives, a hung or failing publish, the candidate leaving mid-wait, a receipt queued ahead of the departure, and a receipt with no sender, which counts only once the candidate is gone. Browser tests cover one render per report across retransmissions, a receipt that throws or stalls, hashing that fails or never finishes, and the exits staying closed while a report is drawn. No live LiveKit session was run, so receipt delivery end to end is still unobserved.Closes #133
Summary by cubic
A completed interview could end with no report: a successful publish only queues the packet, so the agent's old 250 ms sleep before leaving could drop it, and the page fell back to "the report is still unavailable." The agent now republishes the same report bytes up to three times, five seconds each, until the page answers with a receipt naming their SHA-256 digest, and leaves only then. The Gemini session closes beside the first delivery, and no retry calls the report model again. The page renders the first copy immediately, ignores retransmissions, and holds the room, Done, and fallback exits until its receipt has had a chance to leave. The escape wait grows from 135 s to 155 s, and the regenerated-report wait from 140 s to 145 s. A receipt landing as the candidate leaves is acknowledged because presence is read before the receipt is judged, and a candidate who drops before acknowledging the provisional report gets it again on rejoining; a recovery wait that starts with them gone runs the rejoin grace instead of the full window.
codetrial report_delivery ... outcome=acknowledged|unconfirmed|failed.Closes #133.
Written for commit 2f614eb. Summary will update on new commits.