Skip to content

fix(ui): bound stalled widget content fetches in the sandbox host - #117363

Merged
obviyus merged 1 commit into
openclaw:mainfrom
yangxiansheng:fix/widget-sandbox-host-fetch-timeout
Aug 27, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
yangxiansheng:fix/widget-sandbox-host-fetch-timeout

Conversation

@yangxiansheng

@yangxiansheng yangxiansheng commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Before: Chromium loaded a real dashboard widget against an isolated Gateway document route. With response headers withheld, and again with a partial body that never completed, the widget was still blank after 12 seconds with no retry or visible error.
  • After: The same browser flow stopped each stalled request at about 10 seconds. The third attempt reached the existing visible “This widget could not load” state at about 30 seconds.
  • Success control: A complete document rendered its unique content in the nested widget frame.
  • Lifecycle control: Replacing a stalled widget closed the old request in about 0.1 seconds, rendered the replacement, and showed no stale error after the old deadline.

Focused regression support: node scripts/run-vitest.mjs ui/src/lib/board/widget-sandbox-host.test.ts passed 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 27, 2026, 10:52 AM ET / 14:52 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: a216eb67ae06821d9a5909647c03d1ba40486100

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The lifecycle repair and focused coverage are solid, while final-head real-browser proof remains the merge gate.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The contributor supplied linked Chromium video/screenshot evidence, but its comment identifies prior head 5091376c7a30 rather than current head a216eb6; post a redacted current-head run before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The contributor supplied linked Chromium video/screenshot evidence, but its comment identifies prior head 5091376c7a30 rather than current head a216eb6; post a redacted current-head run before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current-main defect: Current main awaits an unbounded fetch and body read; a route that never completes neither rejects nor reaches the existing failure callback.
Owner-boundary repair: The PR makes the sandbox host own the abort controller, deadline, cancellation, and stale-load identity checks across both response acquisition and body delivery.
Caller and visible outcome: The board-frame lifecycle routes document failures through its three-attempt refresh budget and then sets the existing visible failure message.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/lib/board/widget-sandbox-host.timeout.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.ui.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-117363-NdUVZP/target

 ✓  ui  ui/src/lib/board/widget-sandbox-host.timeout.test.ts (3 tests) 91ms

 Test Files  1 passed (1)
      Tests  3 passed (3)
   Start at  14:53:52
   Duration  1.25s (transform 477ms, setup 81ms, import 271ms, tests 91ms, environment 481ms)

[test] passed 1 Vitest shard in 1.67s

Assertions:

  • NOT OBSERVED expect_output: BoardWidgetSandboxHost document timeout — command exited successfully; expected output was not observed in the captured pane

How this fits together

Dashboard 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]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The contributor supplied linked Chromium video/screenshot evidence, but its comment identifies prior head 5091376c7a30 rather than current head a216eb6; post a redacted current-head run before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The only supplied Chromium proof names the previous head; a final-head run must prove timeout recovery and absence of stale replacement errors.
  • Resolve merge risk (P2) - Production code is net +23 lines for a bug fix; the additional state appears necessary to make cancellation, timeout cleanup, and stale-result ownership one canonical lifecycle.
  • Complete next step (P2) - No repair lane is appropriate: the remaining blocker is contributor-provided, current-head browser evidence rather than a discrete code change.
Agent review details

Security

None.

PR surface

Source +23, Tests +128. Total +151 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 40 17 +23
Tests 2 129 1 +128
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 169 18 +151

Review metrics

Metric Value Why it matters
Production versus test LOC production +40/-17 (net +23); tests +129/-1 (net +128) The production increase implements lifecycle-owned cancellation state; the test increase covers both stalled phases and replacement behavior.

Merge-risk options

Maintainer options:

  1. Refresh final-head browser proof (recommended)
    Record the four existing Chromium scenarios from commit a216eb6 so timeout recovery and replacement cancellation are proven for the code under review.
  2. Accept prior-head evidence
    A maintainer may accept the recording from the preceding head, but that leaves the final force-pushed state without direct runtime evidence.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: A bounded dashboard-widget availability bug can leave an individual widget blank, but does not make the core runtime unusable.
  • merge-risk: 🚨 availability: The patch changes document-load cancellation and retry timing, so an error could affect widget recovery even with focused tests passing.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The contributor supplied linked Chromium video/screenshot evidence, but its comment identifies prior head 5091376c7a30 rather than current head a216eb6; post a redacted current-head run before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Hannes Rudolph: Introduced the granted dashboard-widget capability whose sandbox host remains the central owner boundary. (role: feature owner; confidence: high; commits: 5b67b61964b9; files: ui/src/lib/board/widget-sandbox-host.ts, ui/src/components/board/board-widget-frame.ts)
  • Peter Steinberger: Authored recent dashboard sandbox-host and widget-lifecycle fixes in the same path. (role: recent area contributor; confidence: high; commits: fd4404d0b618, bd6d35443f7d; files: ui/src/lib/board/widget-sandbox-host.ts, ui/src/components/board/board-widget-frame.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Post redacted Chromium evidence from a216eb6 showing header and body stalls, the third-attempt error, and replacement without a stale error.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T04:06:05.683Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed August 8, 2026, 8:43 AM ET / 12:43 UTC sha unknown :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-14T16:14:04.638Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-16T22:22:51.524Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-19T06:15:24.957Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-25T06:31:43.721Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-25T06:49:48.635Z sha 4d5f6411ba69fa7a0de4d0b5ce412c43e4e53977 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T14:37:46.442Z sha 5091376c7a30a3f305d79fc370c4d8a3f7ce78ac :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 25, 2026
@obviyus
obviyus force-pushed the fix/widget-sandbox-host-fetch-timeout branch from 4d5f641 to 5091376 Compare August 27, 2026 14:29
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 27, 2026
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Exact-head Chromium proof: On 5091376c7a30, a dashboard widget fetched from an isolated Gateway route that accepted the request and withheld response headers. Each request stopped at about 10 seconds. The third attempt reached the visible error state at about 30 seconds.

widget-stalled-route-recovery.webm

The successful document control rendered unique content through the same sandbox and Gateway path:

Successful widget document control

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

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@obviyus
obviyus force-pushed the fix/widget-sandbox-host-fetch-timeout branch from 5091376 to a216eb6 Compare August 27, 2026 14:46
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Final-head Chromium proof: a216eb67ae06 passed the same four-scenario browser run. Stalled headers and stalled bodies stopped on each 10-second deadline and reached the existing visible error after three attempts.

Final-head stalled-route recovery

The complete-document control rendered unique content through the same Gateway and sandbox path:

Final-head successful document control

The replacement control also closed the stale request before loading the new widget and remained error-free after the old deadline.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 27, 2026
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Thanks @yangxiansheng!

Proof: Chromium loaded a real dashboard widget against an isolated Gateway document route on a216eb67ae06. Stalled headers and stalled bodies stopped every 10 seconds and reached the visible error after three attempts. A complete document and a replacement widget both rendered correctly. The 18 focused tests and targeted lint passed, and exact-head CI is green.

  • Bug: A widget stayed blank forever when its document response never completed.
  • Fix: The sandbox host now owns one bounded, cancellable document load and rejects stale results after reset or replacement.

Example

Before After
A stalled document left an empty widget with no recovery. Each stalled attempt stops after 10 seconds, then the widget shows its existing error after the retry budget.

@obviyus
obviyus merged commit 9c2b863 into openclaw:main Aug 27, 2026
324 of 327 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants