Skip to content

fix: speed up repeated visualization loads - #146602

Merged
steipete merged 2 commits into
mainfrom
codex/faster-visualization-loads
Sep 13, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/faster-visualization-loads

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes slow repeated visualization loads when reopening a chat or remounting a widget.

User Impact

Chat visualizations, dashboard widgets, and MCP Apps can reuse their public sandbox shell. Five paired foreground browser measurements reduced median warm-mount rendering from 863 ms to 251 ms (71% faster) under controlled latency. First loads still pay the shell network cost; initial Gateway and history delays remain.

Why This Change Was Made

The shared sandbox endpoint previously returned no-store for every mount. Its URL now fingerprints the shell HTML and security headers, and only an exact version receives immutable caching. Unversioned, stale, or policy-mismatched URLs remain uncached. Widget documents, credentials, and view tickets never enter this cache; authenticated document reads and sandbox isolation remain unchanged.

Evidence

  • Benchmarked with mcporter Chrome DevTools in the existing Chrome profile. Five live shell mounts took a median 677 ms to finish rendering.
  • Controlled comparison used the real Canvas component and sandbox HTTP server, synthetic content, 200 ms document latency, and 600 ms shell latency. Five foreground A/B pairs alternated order: before 866/866/856/854/863 ms; after 281/251/257/244/248 ms. Every mount still fetched its document; cached mounts made no additional shell requests. Interaction worked after cache reuse.
  • 56 focused tests passed across the HTTP endpoint, Canvas RPC, Canvas component, board policy, and MCP resource suites. The new regression failed before the fix and passed afterward; affected HTTP and board tests passed again after making obsolete helpers private.
  • Changed-file checks passed, including production/test types, formatting, lint, export scans, storage, import-cycle, and authentication guards. Independent review found no actionable findings through P2.
  • The first CI attempt exposed an unrelated stale upgrade-fixture expectation introduced by improve(msteams): reduce repeated reads during poll cleanup #146575: the runner now passes the plugin name explicitly. This PR also corrects that one-line expected argument list without changing production behavior. The four failures reproduced locally; all 27 registry and Teams upgrade tests pass after the correction, with a clean independent review.

Cache the public sandbox shell under a fingerprint of its HTML and security headers. Keep widget documents authenticated and refreshable, and keep unversioned or mismatched shells uncached.
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime docker Docker and sandbox tooling agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 00:49
@steipete
steipete requested a review from a team as a code owner September 13, 2026 00:49
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 9:07 PM ET / September 13, 2026, 01:07 UTC (Revision 2).

ClawSweeper review

What this changes

This PR lets repeated visualization mounts reuse a versioned public sandbox shell, documents the cache boundary, adds HTTP regression coverage, and corrects an upgrade-test argument expectation.

Merge readiness

✅ Ready for maintainer review

The optimization remains useful: current main and the latest release still disable shell caching. The pinned patch has no actionable correctness findings, and the reported browser measurements support its performance benefit.

Priority: P2
Reviewed head: 752e4ece3a8630d00fe8e8271e8397695b969192

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful browser measurements, meaningful HTTP regression coverage, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured browser observations exercise the real Canvas component and sandbox HTTP owner across repeated mounts, reporting fewer shell requests, fresh document reads, working interaction, and lower render latency; the subsequent commit changes only a test expectation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured browser observations exercise the real Canvas component and sandbox HTTP owner across repeated mounts, reporting fewer shell requests, fresh document reads, working interaction, and lower render latency; the subsequent commit changes only a test expectation.
Evidence reviewed 8 items Introduced cache boundary: The shared document builder hashes the shell HTML and response security headers together. The HTTP owner enables immutable caching only when the requested version matches; malformed policies still fail and unversioned or mismatched requests remain no-store.
Still necessary on main: The fetched main revision retains unconditional Cache-Control: no-store for the public shell. Existing mount retention and concurrent document-read sharing do not provide this cross-mount shell cache.
Latest-release comparison: The same unconditional no-store response exists in v2026.9.4; the requested optimization is not present in that release.
Findings None None.
Security None None.

How this fits together

Chat visualizations, dashboard widgets, and MCP Apps load a public shell on an isolated origin before receiving their document content. The shared sandbox owner generates the shell URL and security policy, while separate document and bridge owners retain authentication and per-view state.

flowchart TD
  A[Visualization mount] --> B[Shell URL and policy fingerprint]
  B --> C{Exact cached version?}
  C -->|Yes| D[Public shell from browser cache]
  C -->|No| E[Sandbox HTTP server]
  E --> D
  F[Fresh document through existing access checks] --> G[Isolated widget frame]
  D --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +39, Docs +5. Total +69 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 41 16 +25
Tests 3 58 19 +39
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 104 35 +69

Review metrics

Metric Value Why it matters
Reported warm-mount performance 863 ms → 251 ms median across 5 paired comparisons Controlled browser observations demonstrate a repeated-load benefit while documenting that first-load network cost remains.
Cache validity 1 year for exact fingerprints; no-store otherwise The URL versions both shell content and security headers, preserving the older unversioned request path.

Technical review

Best possible solution:

Keep one content-addressed public shell owner while fetching documents through their existing access checks and retaining uncached responses for older or mismatched URLs.

Do we have a high-confidence way to reproduce the issue?

Yes: current main sends no-store on every shell response, forcing repeated mounts to reload it; the PR also supplies paired browser measurements. This read-only review did not execute a reproduction or tests.

Is this the best way to solve the issue?

Yes: versioning the existing public shell and its headers addresses the redundant transfer without adding a second document cache or changing authenticated content delivery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0d2c3a2292ad.

Labels

Label justifications:

  • P2: This is a bounded performance improvement for repeated visualization loads, with no demonstrated urgent outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured browser observations exercise the real Canvas component and sandbox HTTP owner across repeated mounts, reporting fewer shell requests, fresh document reads, working interaction, and lower render latency; the subsequent commit changes only a test expectation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured browser observations exercise the real Canvas component and sandbox HTTP owner across repeated mounts, reporting fewer shell requests, fresh document reads, working interaction, and lower render latency; the subsequent commit changes only a test expectation.

Evidence

What I checked:

  • Introduced cache boundary: The shared document builder hashes the shell HTML and response security headers together. The HTTP owner enables immutable caching only when the requested version matches; malformed policies still fail and unversioned or mismatched requests remain no-store. (src/agents/sandbox-host.ts:166, 752e4ece3a86)
  • Still necessary on main: The fetched main revision retains unconditional Cache-Control: no-store for the public shell. Existing mount retention and concurrent document-read sharing do not provide this cross-mount shell cache. (src/gateway/mcp-app-sandbox-http.ts:50, 0d2c3a2292ad)
  • Latest-release comparison: The same unconditional no-store response exists in v2026.9.4; the requested optimization is not present in that release. (src/gateway/mcp-app-sandbox-http.ts:50, 3a9d69db306c)
  • Document and authority separation: The loader requires readiness from the exact sandbox URL before delivering fresh document bytes. Canvas document reads retain their existing admission checks. Cached shell bytes contain neither document content nor tickets, and the patch does not change grant production, bridge authority, or final-effect authorization. (ui/src/lib/widget-sandbox-host.ts:90, 752e4ece3a86)
  • Browser behavior evidence: The complete captured PR body, sourceRevision 6d0ba75285bf3ef113e7d3b08f7f9c4a288ac5c689c7eb1a4332c078404785d7, reports five alternating foreground browser comparisons using the real Canvas component and sandbox HTTP server with synthetic content and controlled latency. Median rendering changed from 863 ms to 251 ms; every mount fetched its document, cached mounts made no additional shell requests, and interaction worked after reuse. These are contributor-reported runtime observations, not executions performed during this review. (6fff5349ff78)
  • Regression coverage and re-review continuity: The HTTP regression exercises exact versions, distinct effective policies, GET/HEAD metadata, absent cookies, stale versions, missing versions, and policy mismatch. The previous review recorded no findings. Comparison with its reviewed head shows only the upgrade fixture correction; the visualization implementation and its browser-proof inputs are unchanged. (src/gateway/mcp-app-sandbox-http.test.ts:77, 752e4ece3a86)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • hannesrudolph: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-09-13T00:55:46.628Z sha 6fff534 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit ba11b30 into main Sep 13, 2026
185 of 186 checks passed
@steipete
steipete deleted the codex/faster-visualization-loads branch September 13, 2026 01:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 13, 2026
Keep plugin and settlement adoption with admission while allowing explicit operator recovery. Exercise requester preservation through dispatch and retain retryable approval handoffs on admission failure. Align the existing browser cache assertion with the fingerprinted sandbox shell from #146602.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
* fix: speed up repeated visualization loads

Cache the public sandbox shell under a fingerprint of its HTML and security headers. Keep widget documents authenticated and refreshable, and keep unversioned or mismatched shells uncached.

* test: match explicit plugin argument in upgrade fixture
steipete added a commit that referenced this pull request Sep 13, 2026
Retain no-store assertions for the standalone host and ticketed view while expecting immutable caching for the content-versioned public sandbox shell introduced by #146602. Preserve the existing history, cancellation, and authority conformance cases.
steipete added a commit that referenced this pull request Sep 13, 2026
…146667)

* fix(agents): recover yielded subagents and preserve sidebar nesting

Defer sessions_yield until earlier async tool results have reached a subsequent model request, preventing a child from pausing before it can consume completed output.

Resume paused children through the existing adoption owner so task identity, requester, and parent completion batches survive operator follow-ups. Keep subagents beneath their expanded navigation parent even when categorized, and show their task names in activity rows.

Validation: async-yield, sessions.send recovery, lifecycle, and sidebar regressions; scoped production/test typechecks, lint, consistency checks, and independent review passed.
(cherry picked from commit 3086b77b6ce7edd25d0964b1f3559dea296e4d12)

* fix(gateway): preserve admitted follow-up task ownership

Keep plugin and settlement adoption with admission while allowing explicit operator recovery. Exercise requester preservation through dispatch and retain retryable approval handoffs on admission failure. Align the existing browser cache assertion with the fingerprinted sandbox shell from #146602.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…penclaw#146667)

* fix(agents): recover yielded subagents and preserve sidebar nesting

Defer sessions_yield until earlier async tool results have reached a subsequent model request, preventing a child from pausing before it can consume completed output.

Resume paused children through the existing adoption owner so task identity, requester, and parent completion batches survive operator follow-ups. Keep subagents beneath their expanded navigation parent even when categorized, and show their task names in activity rows.

Validation: async-yield, sessions.send recovery, lifecycle, and sidebar regressions; scoped production/test typechecks, lint, consistency checks, and independent review passed.
(cherry picked from commit 3086b77b6ce7edd25d0964b1f3559dea296e4d12)

* fix(gateway): preserve admitted follow-up task ownership

Keep plugin and settlement adoption with admission while allowing explicit operator recovery. Exercise requester preservation through dispatch and retain retryable approval handoffs on admission failure. Align the existing browser cache assertion with the fingerprinted sandbox shell from openclaw#146602.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant