Repository navigation
fix(ui): bound stalled widget content fetches in the sandbox host - #117363
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 27, 2026, 10:52 AM ET / 14:52 UTC. ClawSweeper reviewWhat this changesThe PR adds a shared 10-second abort deadline to sandboxed dashboard-widget document loads and cancels superseded loads during reset, deactivation, and replacement. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep open: the patch correctly repairs a current-main blank-widget failure, but the supplied real-browser evidence is tied to the prior head rather than the current commit. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherDashboard widgets fetch Gateway-served HTML through a sandbox host before delivering it to a dedicated-origin iframe. The host feeds failures to the board-frame retry budget, which eventually renders a visible error. flowchart LR
A[Dashboard widget] --> B[Board frame lifecycle]
B --> C[Sandbox host]
C --> D[Gateway document route]
D --> E[Fetch and body read]
E --> F[Sandboxed iframe]
C --> G[Retry budget]
G --> H[Visible load error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +23, Tests +128. Total +151 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single host-owned cancellation path and attach a redacted Chromium run from the current head that covers stalled headers, stalled body delivery, retry-to-error, and replacement without a stale error. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main awaits fetch and response.text without a deadline, so a never-settling headers or body operation cannot reach its failure callback. Is this the best way to solve the issue? Yes. The sandbox host owns the fetch and response body, so it is the narrow canonical place to own cancellation; a frame-level timer would not stop the outstanding body read. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 22c23ba580c6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
4d5f641 to
5091376
Compare
|
Exact-head Chromium proof: On widget-stalled-route-recovery.webmThe successful document control rendered unique content through the same sandbox and Gateway path: The partial-body stall passed the same retry and visible-error contract. Replacing a stalled widget closed the old request in about 0.1 seconds and did not produce a stale error after the old deadline. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5091376 to
a216eb6
Compare
|
Final-head Chromium proof: The complete-document control rendered unique content through the same Gateway and sandbox path: The replacement control also closed the stale request before loading the new widget and remained error-free after the old deadline. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @yangxiansheng! Proof: Chromium loaded a real dashboard widget against an isolated Gateway document route on
Example
|
Stop dashboard HTML widgets from remaining blank when the Gateway document route stalls. The sandbox host now applies one 10-second abort deadline across response headers and body delivery, and cancels stale loads on lifecycle changes. Co-authored-by: Qiong <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>



What problem this solves
A dashboard HTML widget could stay blank forever when its Gateway document route accepted the request but never completed the response.
Root cause
The sandbox host bounded the proxy handshake, but it did not bound the later document fetch or body read. The existing retry and visible error path only ran after those operations rejected.
Fix
The active document load now owns one abort controller and one 10-second deadline across response acquisition and body delivery. Reset, inactivity, and document replacement cancel that same load. Object identity rejects stale results and prevents old cleanup from changing a replacement widget.
No configuration, fallback, or second fetch path was added.
Evidence
Focused regression support:
node scripts/run-vitest.mjs ui/src/lib/board/widget-sandbox-host.test.tspassed all 18 tests. The live Control UI proof passed all 4 Chromium scenarios on the final file content.This pull request keeps the original contributor as the commit author.