Repository navigation
fix: keep browser and Canvas tool results bounded and actionable - #125126
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 6:36 AM ET / 10:36 UTC. ClawSweeper reviewWhat this changesThis PR bounds Browser and Canvas model-facing results, preserves resolved tab/node identities, improves recovery guidance, and stages Canvas snapshots through managed media storage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main still has the unbounded Browser/Canvas paths, and the latest head addresses the prior sanitizer-bound finding with focused regressions; no new blocking patch defect was found. The maintainer-owned PR remains behind main with exact-head checks in progress. Priority: P1 Review scores
Verification
How this fits togetherBrowser and Canvas extensions turn page or node responses into agent tool results. They sanitize and bound untrusted model-visible text, then return action facts and media observations to the agent loop. flowchart LR
A[Agent tool call] --> B[Browser or Canvas extension]
B --> C[Page or node response]
C --> D[Sanitize and bound content]
D --> E[Wrap untrusted text or stage media]
E --> F[Agent tool result]
F --> G[Next agent action]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +160, Tests +412. Total +572 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the sanitizer-aware owner-path bounds and action-specific recovery guidance, then refresh against main and validate the exact head before landing. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main directly wraps unbounded Browser JSON and only handles string Canvas eval output; the read-only review did not execute the reported regression command. Is this the best way to solve the issue? Yes. Capping at the Browser/Canvas result owners preserves action-specific recovery guidance and media handling; a generic downstream clamp would lose that context. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 353b497007da. LabelsLabel 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 (10 earlier review cycles; latest 8 shown)
|
6355cf1 to
30e6b69
Compare
84210cb to
c381abb
Compare
|
Land-ready maintainer proof for
Maintainer decision: accept the documented live-proof gap for this landing. No isolated paired Canvas-node plus Browser runtime was available in this environment, so the focused owner-boundary regressions and exact-head CI are not described as live proof. |
|
Merged via squash.
|
…nclaw#125126) * fix: bound browser and Canvas tool results * fix: type host profile availability result * fix: reuse Canvas snapshot format normalizer * fix: preserve large Canvas snapshots * fix(browser): bound captured network text * fix: close tool result limit gaps * fix: finalize tool result lifecycle bounds * fix(canvas): narrow snapshot cleanup errors * fix(canvas): bound final eval output * fix: cap sanitized tool results
What Problem This Solves
Fixes an issue where browser and Canvas tool calls could return unbounded page-controlled output, lose the resolved tab or node identity, collapse host/profile failures into empty results, or acknowledge work without returning the facts an agent needs to continue.
Why This Change Was Made
Bound page activity at capture and all model-visible browser/Canvas text with shared limits; carry canonical tab and node identities through the owning routes; preserve actionable stale-target and proxy/profile recovery; and store Canvas snapshots in lifecycle-owned media storage instead of unmanaged temp files. This is AI-assisted maintainer work.
User Impact
Agents receive bounded, untrusted-wrapped output; focus/close and Canvas actions identify the target they actually used; degraded host discovery explains what is unavailable; stale node recovery keeps the original useful guidance; structured Canvas eval results are visible; and snapshot files no longer accumulate outside managed cleanup.
Evidence
node scripts/run-vitest.mjs extensions/browser/src/browser/pw-session.test.ts extensions/browser/src/browser-tool.test.ts extensions/browser/src/browser-node-proxy.test.ts extensions/browser/src/browser/routes/tabs.test.ts extensions/browser/src/browser/server-context.tab-reference-parity.contract.test.ts extensions/canvas/src/tool.test.ts— 313 passed.git diff --check— passed.extensions, extensionTests.