Skip to content

Hold the room until the report is received - #228

Merged
jserv merged 1 commit into
mainfrom
scored-report
Oct 3, 2026
Merged

jserv merged 1 commit into
mainfrom
scored-report

Conversation

@jserv

@jserv jserv commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Each session logs codetrial report_delivery ... outcome=acknowledged|unconfirmed|failed.
  • Docs update the delivery budget and the log lines to watch.
  • New unit and browser tests cover lost packets, hung or failing publishes, candidate departures mid-wait, queued receipts, and hashing failures.

Closes #133.

Written for commit 2f614eb. Summary will update on new commits.

Review in cubic

cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv
jserv requested review from ColtenOuO and alanhc October 3, 2026 03:19
Comment thread src/livekit/report.rs
Comment thread tests/unit/livekit.rs
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
@jserv
jserv merged commit 145443b into main Oct 3, 2026
7 checks passed
@jserv
jserv deleted the scored-report branch October 3, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completed interview may end without a scored report when final report delivery is lost

2 participants