Skip to content

fix(canvas): omit deleted snapshot paths - #125216

Merged
steipete merged 2 commits into
mainfrom
steipete/canvas-snapshot-path-cleanup-125126
Aug 17, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/canvas-snapshot-path-cleanup-125126

Conversation

@steipete

@steipete steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #125126

What Problem This Solves

Fixes an issue where Canvas snapshots returned a path and media URL after the snapshot staging file had already been deleted, leaving agents and callers with stale result facts.

Why This Change Was Made

Keep the inline image and canonical node/format/media policy, but remove only the file-backed path fields before returning the result. The staging file remains unlinked in finally. This is AI-assisted maintainer work.

User Impact

Canvas snapshot results no longer advertise an unusable file path. Agents still receive the image itself and the facts needed to continue safely.

Evidence

  • Pre-fix owner-boundary proof: node scripts/run-vitest.mjs extensions/canvas/src/tool.test.ts failed the new assertion because details.path still contained the deleted snapshot path (43 passed, 1 failed).
  • Focused post-fix proof: the same command passed all 44 Canvas tests, including inline image content, node/format metadata, media.outbound: false, no outbound artifact, and deleted staging-file verification.
  • node_modules/.bin/oxfmt --check extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts passed.
  • node scripts/run-oxlint.mjs extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts passed.
  • pnpm check:assertion-safety --base origin/main passed after the result handling was simplified to avoid a new assertion.
  • git diff --check passed.
  • node scripts/check-changed.mjs --dry-run -- extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts classified extensions, extensionTests successfully.
  • Fresh Codex-backed autoreview with --mode uncommitted was clean with no accepted/actionable findings.
  • Production LOC: +5/-3 (net +2). Tests: +11/-4 (net +7).
  • This is the result-contract follow-up to fix: keep browser and Canvas tool results bounded and actionable #125126. No isolated paired Canvas node was available in this clone/runtime; the deterministic private snapshot owner-boundary test exercises the exact returned result and cleanup behavior.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete steipete self-assigned this Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 11:01
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 7:16 AM ET / 11:16 UTC.

ClawSweeper review

What this changes

This PR returns Canvas snapshot metadata without the staged file path or media URL after the image has been hydrated and the staging file removed.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No blocking correctness finding: the Canvas-local wrapper removes only metadata made stale by cleanup while preserving the hydrated inline image. Likely related people: steipete (high confidence), from the merged snapshot lifecycle work and this follow-up.

Priority: P2
Reviewed head: 041a19edda826d02ce4e0b507498d0422191231a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused source-backed repair and regression test cover the cleanup boundary; paired-node evidence would further reduce integration uncertainty.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-owned work, so the external-contributor proof gate does not apply; the PR body nevertheless records focused before/after owner-boundary evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-owned work, so the external-contributor proof gate does not apply; the PR body nevertheless records focused before/after owner-boundary evidence.
Evidence reviewed 4 items Generic helper creates the stale facts: The shared image helper copies its input path to both details.path and details.media.mediaUrl before Canvas deletes that path.
Pre-fix owner boundary: The merged Canvas lifecycle returned imageResultFromFile directly and unlinked the same saved path in finally.
Proposed repair and regression coverage: The branch retains the canonical node/format/outbound details after image hydration, and its focused test uses the actual helper, verifies no path or media URL remains, preserves the inline image, and confirms file deletion.
Findings None None.
Security None None.

How this fits together

Canvas snapshots are rendered by a paired node, staged in managed media storage, hydrated into an inline image result, and then cleaned up. The agent-facing result must retain durable facts such as node and format without retaining the deleted staging path.

flowchart LR
A[Canvas snapshot request] --> B[Paired Canvas node]
B --> C[Managed media staging]
C --> D[Inline image hydration]
D --> E[Staging file cleanup]
E --> F[Pathless result metadata]
Loading

Decision needed

Question Recommendation
After exact-head CI completes, should this maintainer-owned Canvas result-contract repair be landed? Land after CI: Land once the exact PR head has green required checks.

Why: The protected maintainer label requires explicit maintainer handling despite the focused, source-backed repair.

Before merge

  • Resolve merge risk (P1) - Production code is net +2 lines; this is justified by retaining Canvas-owned metadata separately from the generic helper, whose file-backed result contract serves other callers.
  • Resolve merge risk (P1) - No paired live Canvas-node run is supplied; the actual-helper regression covers the returned result and cleanup boundary but not a real node session.
Agent review details

Security

None.

PR surface

Source +2, Tests +7. Total +9 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 3 +2
Tests 1 11 4 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 16 7 +9

Review metrics

Metric Value Why it matters
Production versus test LOC production +5/-3 (net +2); tests +11/-4 (net +7) The small production increase preserves Canvas-owned durable metadata after generic image hydration; test growth exercises the actual-helper cleanup contract.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the Canvas-local pathless return shape, leave the generic file-backed image helper unchanged for durable-file callers, and land after exact-head CI and maintainer review.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the Canvas-local pathless return shape, leave the generic file-backed image helper unchanged for durable-file callers, and land after exact-head CI and maintainer review.

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

Yes—source proves the helper emits the staged path and media URL before Canvas deletes that file, and the focused regression exercises that exact helper-and-cleanup boundary.

Is this the best way to solve the issue?

Yes—the wrapper preserves generic image hydration while removing only Canvas-specific facts that become invalid during cleanup; changing the shared helper would affect durable-file callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e30b425e18af.

Labels

Label changes:

  • add P2: This repairs stale Canvas snapshot result metadata with limited blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-owned work, so the external-contributor proof gate does not apply; the PR body nevertheless records focused before/after owner-boundary evidence.

Label justifications:

  • P2: This repairs stale Canvas snapshot result metadata with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-owned work, so the external-contributor proof gate does not apply; the PR body nevertheless records focused before/after owner-boundary evidence.

Evidence

What I checked:

  • Generic helper creates the stale facts: The shared image helper copies its input path to both details.path and details.media.mediaUrl before Canvas deletes that path. (src/agents/tools/common.ts:509, 90969ff41e5b)
  • Pre-fix owner boundary: The merged Canvas lifecycle returned imageResultFromFile directly and unlinked the same saved path in finally. (extensions/canvas/src/tool.ts:280, 90969ff41e5b)
  • Proposed repair and regression coverage: The branch retains the canonical node/format/outbound details after image hydration, and its focused test uses the actual helper, verifies no path or media URL remains, preserves the inline image, and confirms file deletion. (extensions/canvas/src/tool.test.ts:343, 041a19edda82)
  • History and release check: The stale lifecycle path dates to the merged Canvas/browser repair; local main and origin/main contain it, while no local release tag contains that commit. (extensions/canvas/src/tool.ts:280, 90969ff41e5b)

Likely related people:

  • steipete: Authored the merged snapshot lifecycle change and the focused follow-up. (role: recent Canvas snapshot lifecycle contributor; confidence: high; commits: 90969ff41e5b, eeb0fa3850b5; files: extensions/canvas/src/tool.ts, extensions/canvas/src/tool.test.ts)

Rank-up moves

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

  • Add a redacted paired Canvas-node snapshot trace, or state the concrete infeasibility in the PR body.

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 041a19edda826d02ce4e0b507498d0422191231a:

  • Pre-fix owner-boundary reproduction: node scripts/run-vitest.mjs extensions/canvas/src/tool.test.ts failed exactly because details.path still contained the staging path (43 passed, 1 failed).
  • Post-fix focused proof: the same command passed all 44 Canvas tests. The actual-helper boundary case verifies inline image content; retained node, format, and media.outbound: false; omitted details.path and details.media.mediaUrl; no outbound media artifact; and ENOENT after cleanup.
  • node_modules/.bin/oxfmt --check extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts passed.
  • node scripts/run-oxlint.mjs extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts passed.
  • pnpm check:assertion-safety --base origin/main passed.
  • git diff --check passed.
  • node scripts/check-changed.mjs --dry-run -- extensions/canvas/src/tool.ts extensions/canvas/src/tool.test.ts passed with lanes extensions, extensionTests.
  • Fresh Codex-backed autoreview was clean before commit and clean again after the CI-driven simplification; no accepted/actionable findings.
  • Production LOC: +5/-3 (net +2). Tests: +11/-4 (net +7). The +2 production lines are the minimal Canvas-owned boundary needed to keep durable metadata separate from the generic helper's file-backed metadata.
  • Exact-head CI: run 32023454206 succeeded; openclaw/ci-gate job 95369415209 succeeded.
  • Native flow: scripts/pr review-init 125216, PR-head artifact initialization, and scripts/pr review-validate-artifacts 125216 passed with READY FOR /prepare-pr, issueValidation.status=valid, and no findings. OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125216 completed at the same head with gates_mode=hosted_exact_or_recent_parent; it reused the exact hosted CI, so no separate Testbox provider, lease ID, or run URL was allocated (REMOTE_GATES_* empty).
  • ClawSweeper exact-head review reports no findings and recommends landing after exact-head CI. Its optional rank-up move is addressed by the PR body's concrete statement that no isolated paired Canvas node was available. The live gap is not described as live proof; the real-helper regression covers the exact returned-result and cleanup boundary.

This is the result-contract follow-up to #125126. The stale facts were produced by the generic image helper but invalidated by Canvas-owned immediate cleanup, so the canonical fix remains local to Canvas while durable-file callers keep the shared helper contract unchanged.

@steipete
steipete merged commit 5e96426 into main Aug 17, 2026
114 of 116 checks passed
@steipete
steipete deleted the steipete/canvas-snapshot-path-cleanup-125126 branch August 17, 2026 11:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(canvas): omit deleted snapshot paths This is item 3/3 in the current shard. Shard 2/35.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
* fix(canvas): omit deleted snapshot paths

* refactor(canvas): return pathless snapshot details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: canvas maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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