Repository navigation
fix(guest): pace queued prompts across reconnect and retry room rate refusals (SW-12) - #30790
Conversation
|
Found 2 test failures on Blacksmith runners: Failures
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a Passes: CI passes on CI passes on Written by web and size checks: green Shipped in:
|
|
Owned by an agent session · session |
eee14f1 to
d2fd083
Compare
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (codex gpt-6.1-sol xhigh, router-review): BLOCK at c27cfdf BLOCK at c27cfdf Visual verdict: no visual regression found across all 16 before/after pairs.
|
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (codex, router-review): SHIP at 2bbce66 Reviewer: codex gpt-6-astra high, fast tier. SHIP at 2bbce66 No actionable correctness findings. All six queue tests passed using a Babel/Node assertion shim; Bun and composer integration tests were unavailable. Follow-ups: none |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
SW-12: pace the guest's outbound prompts so reconnect does not discard its offline backlog
Closes #30777 when merged. The guest composer and browser page have already landed (#30518/#29901); this independent, three-file follow-up touches only the guest tab's outbound queue.
Problem and original test gap.
GuestPage.LiveChatpreviously looped overprompts.unsent()and sent everything synchronously after a snapshot. The room admits 2 prompts/second, burst 2, returning terminalrefused: share.rate_limitedfor the third. That permanently discarded messages the guest had typed while offline. Rapid online sends hit the same error.Patch.
guestSendQueue.ts: one 600 ms paced sender for live and reconnect traffic, with one-shot timers; current connection's sent IDs are tracked, and a new socket snapshot replays only unacknowledged IDs.share.rate_limitedas retryable: schedule the sameclient_idafter 1200 ms. Preserve permanent refusal and owner approval/decline semantics; no new id, no widening permissions.GuestPage.tsxuses this queue on send, snapshot, prompt-state, disconnect and share end. No room, daemon, protocol, consent, cookie, UI or owner approval code is changed.share.rate_limited, reconnect replay, and timer cancellation on end.Review and testing boundaries. Source and new tests committed; no local Bun install/full web suite or deployed two-browser test was available in this GitHub-only session. GitHub CI and owner review should validate the exact head before landing. The pace uses 600 ms against the server's current two-token bucket; if the room changes the rate contract, update both sides together. Independent review should check status races and reconnect lifecycle.
Ownership: SW-12 follow-up to HQ #5599 and sharing flow HQ #4766. Existing held-prompt owner stack (#28859/#29003/#26742) is untouched.