Skip to content

fix(browser): keep the node file name in saved proxy downloads - #139559

Merged
obviyus merged 1 commit into
openclaw:mainfrom
ruel225:fix/browser-proxy-file-name
Sep 6, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
ruel225:fix/browser-proxy-file-name

Conversation

@ruel225

@ruel225 ruel225 commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #139557.

The Gateway discarded the validated node-side filename when saving files returned by a browser node. Downloads, screenshots, and annotated snapshots therefore became UUID-only media files even when a node filename was available.

Why This Change Was Made

Pass the validated path as the media store's existing originalFilename argument. The store extracts and sanitizes the basename, resolves the extension, and writes its normal <name>---<uuid>.<ext> identifier. No new parser, storage format, or migration is added.

User Impact

Browser-node files retain a safe, recoverable node-side name. Website suggestedFilename remains separate metadata: an automatic download can already have a generated node prefix, and an explicit output filename can differ from the website suggestion. This change preserves the node name within the existing store's filename bounds.

Evidence

  • Before: current main at 4da5d447f695, running browser node → Gateway: a named 39-byte PDF was saved with a UUID-only basename. Node and saved-byte hashes matched.
  • After: candidate 105e3f63aa55, same real route: explicit and automatic downloads retain safe node names; saved bytes match; returned paths point to Gateway media files. Empty downloads, screenshots, and annotated snapshot images also pass.
  • A clearly labeled synthetic attachment consumer using the published media filename API rendered the UUID before and the recovered node name after. This is not a full Control UI or external-channel display claim.
  • Labeled synthetic node-envelope probes against the running Gateway reject malformed base64 and over-limit file counts, individual bytes, and aggregate bytes before writing. Exact limits of 256 files, 10 MiB per file, and 16 MiB total pass.
  • The three new filename regressions fail on the original implementation. Candidate owner suites: 98 passed; final changed regression suite: 21 passed. Pinned formatting, owning TypeScript-aware lint, line/assertion guards, and the combined runtime/UI build pass.
  • Fresh independent code review and all eight source-blind acceptance clauses passed. The validator repeated the same boundary inputs on baseline and candidate builds.

CI run 34006491665 reports an unrelated services test-group limit failure: #139592 added the test file that raised that group from 720 to 721 roots. Its parent diff and exact CI merge tree confirm the cause; this PR leaves the count unchanged. Landing still requires the complete CI result and guarded review.

AI-assisted repair and verification. Original contribution by @ruel225.

Redacted browser-node download output

These are captured browser.request results and matching filesystem observations. Only private path prefixes, the fixture URL, and browser target identities are redacted. The baseline requested quarterly-report.pdf; the candidate deliberately requested candidate-quarterly.pdf while keeping the website suggestion unchanged.

Before (4da5d447f695):

{
  "browserResult": {
    "ok": true,
    "download": {
      "url": "<fixture-download-url>",
      "suggestedFilename": "quarterly-report.pdf",
      "path": "<gateway-browser-media>/92a94425-1c4e-46c3-bccd-989b0a082b92.pdf"
    }
  },
  "nodeFile": {
    "name": "quarterly-report.pdf",
    "path": "<node-downloads>/quarterly-report.pdf",
    "size": 39,
    "sha256": "4547e8c1e1654e67682c5f483017313fd02ab51081e5d5e5da40b24ab2d40485"
  },
  "gatewayFile": {
    "name": "92a94425-1c4e-46c3-bccd-989b0a082b92.pdf",
    "path": "<gateway-browser-media>/92a94425-1c4e-46c3-bccd-989b0a082b92.pdf",
    "size": 39,
    "sha256": "4547e8c1e1654e67682c5f483017313fd02ab51081e5d5e5da40b24ab2d40485"
  }
}

After (105e3f63aa55):

{
  "browserResult": {
    "ok": true,
    "download": {
      "url": "<fixture-download-url>",
      "suggestedFilename": "quarterly-report.pdf",
      "path": "<gateway-browser-media>/candidate-quarterly---8518a609-06c4-48b7-9756-77bddb1b4f0b.pdf"
    }
  },
  "nodeFile": {
    "name": "candidate-quarterly.pdf",
    "path": "<node-downloads>/candidate-quarterly.pdf",
    "size": 39,
    "sha256": "4547e8c1e1654e67682c5f483017313fd02ab51081e5d5e5da40b24ab2d40485"
  },
  "gatewayFile": {
    "name": "candidate-quarterly---8518a609-06c4-48b7-9756-77bddb1b4f0b.pdf",
    "path": "<gateway-browser-media>/candidate-quarterly---8518a609-06c4-48b7-9756-77bddb1b4f0b.pdf",
    "size": 39,
    "sha256": "4547e8c1e1654e67682c5f483017313fd02ab51081e5d5e5da40b24ab2d40485"
  }
}

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@ruel225
ruel225 marked this pull request as ready for review September 6, 2026 00:33
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 5, 2026, 10:32 PM ET / September 6, 2026, 02:32 UTC.

ClawSweeper review

What this changes

Preserves browser-node filenames in locally saved downloads and images using the existing media store, with regression coverage for filename recovery and unchanged file contents.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, focused fix: current main still discards the node filename, and no introduced correctness defect was found. The updated body describes real before/after runs, but does not include the observable output requested in the previous review.

Priority: P2
Reviewed head: 105e3f63aa55866eff5f7584871592fe67c82c88

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is narrow and maintainable, but the reported real runs still need observable evidence.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The body reports before/after browser-node-to-Gateway downloads at the relevant revisions, covering the changed persistence owner and matching saved bytes. However, it provides summary claims rather than inspectable runtime output, so the earlier transcript request remains incomplete; this is not test-only evidence. 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 body reports before/after browser-node-to-Gateway downloads at the relevant revisions, covering the changed persistence owner and matching saved bytes. However, it provides summary claims rather than inspectable runtime output, so the earlier transcript request remains incomplete; this is not test-only evidence. 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 9 items Verified introduced change: The pinned merge-base-to-head production delta adds file.path as the existing originalFilename argument; unrelated base-branch changes are excluded.
Still needed on main: Fetched main still calls saveMediaBuffer without originalFilename, so the filename remains unavailable to its existing name-preservation branch.
Latest release retains the omission: The supplied latest release, v2026.9.2, also omits the filename argument at this call site.
Findings None None.
Security None None.

How this fits together

Browser nodes return file contents and paths to the Gateway. The browser plugin validates these results, saves the files in local media storage, and replaces remote paths with local paths used by downstream consumers.

flowchart LR
  A[Browser node files] --> B[Validate file envelope]
  B --> C[Decode and enforce size limits]
  C --> D[Sanitize filename and save media]
  D --> E[Replace remote result paths]
  E --> F[Local files and attachment consumers]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The body reports before/after browser-node-to-Gateway downloads at the relevant revisions, covering the changed persistence owner and matching saved bytes. However, it provides summary claims rather than inspectable runtime output, so the earlier transcript request remains incomplete; this is not test-only evidence. 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.
  • Complete next step (P2) - Add inspectable output from the reported after-fix browser-node/Gateway run, including the retained filename and saved-byte comparison. A terminal screenshot or recording is welcome; copied output or logs also count. Redact IP addresses, keys, phone numbers, private endpoints, and other private details. Update the PR body to trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +1, Tests +23. Total +24 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 23 0 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 24 0 +24

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #139557
Summary: This PR is the candidate implementation for the explicitly linked filename-loss issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep filename preservation at the browser persistence boundary and reuse the existing media naming, sanitization, and reader contracts.

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

Yes, from source: a named browser-node file reaches saveMediaBuffer without originalFilename on current main and necessarily receives a UUID-only ID. No runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes. Passing the validated node path to the existing optional argument repairs the missing information at its owner without duplicating filename logic or changing website-supplied metadata.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6c55a99226ed.

Labels

Label justifications:

  • P2: Restoring useful names on browser-node artifacts is a bounded user-facing correction without evidence of urgent availability or delivery impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The body reports before/after browser-node-to-Gateway downloads at the relevant revisions, covering the changed persistence owner and matching saved bytes. However, it provides summary claims rather than inspectable runtime output, so the earlier transcript request remains incomplete; this is not test-only evidence. 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:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • sunlit-deng: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attach the existing run's redacted transcript or terminal capture showing the node filename, returned Gateway media path, and saved-byte comparison.

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-06T00:39:05.066Z sha 4957c4e7db48c8d5d002938332cc457b4864e5f9 :: needs real behavior proof before merge. :: none

@obviyus obviyus self-assigned this Sep 6, 2026
Pass the validated node filename to the existing media store. Keep website filename metadata separate and cover safe filename recovery, byte preservation, and local path isolation.
@obviyus
obviyus force-pushed the fix/browser-proxy-file-name branch from 4957c4e to 105e3f6 Compare September 6, 2026 02:26
@obviyus

obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 139559
head: 105e3f6
run: 34006491665 attempt: 1
failed: check-additional-boundaries job=101414653635 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit ef59721 into openclaw:main Sep 6, 2026
99 of 101 checks passed
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks @ruel225!

Proof: A real browser-node download through the Gateway now retains a safe node-side filename and identical bytes. All eight independent acceptance clauses passed, including screenshots, annotated snapshots, empty files, path isolation, and limits. The PR body includes redacted runtime output.

Before After
Named node files became UUID-only Gateway media. Saved media carries the sanitized node name plus the normal UUID suffix.
The shared filename reader could not recover the node name. It recovers that name; website-suggested metadata stays separate.

The exact-head local review passed with no findings or security concerns. CI run 34006491665, attempt 1, had one failed child: check-additional-boundaries. Its services: 721 test roots exceeds the 720 limit failure was introduced by #139592, authored and merged by @steipete: 41fba39c40aa added src/logging/diagnostic-gc.test.ts and changed the count from 720 to 721. The unchanged limit and compiler-expanded file lists prove the cause. CI's main parent and merge tree both contain 721 roots; this browser-only PR leaves the count unchanged. All other child jobs passed or were skipped.

Landed through the guarded, authorized unrelated-CI exception. No failing check was weakened, and no unrelated source was changed. Existing stored files remain unchanged. Downstream display proof used the explicitly labeled synthetic attachment consumer, not an external channel or the full Control UI.

vincentkoc added a commit to ylcn91/openclaw that referenced this pull request Sep 6, 2026
* origin/main:
  fix(ci): rebalance services test roots below the memory bound (openclaw#139645)
  fix(backup): exclude shared workspace files from state-only archives (openclaw#139598)
  fix(config): preserve plugin secret references in Settings saves (openclaw#139536)
  fix(ui): retain real-Gateway browser proof across reruns (openclaw#134274)
  fix(browser): preserve node filenames in proxy media (openclaw#139559)
  fix(qa): give hot-reload maintenance proofs their own budgets (openclaw#139580)
  fix(streaming): preserve assistant items and settled output (openclaw#139507)
  fix(android): reconnect secondary gateways after rapid lifecycle changes (openclaw#139319)
  fix(gateway): restart inside a marker-less LaunchAgent no longer kills its caller (openclaw#139628)
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'ef5972108dc690725717613cb0c1bdaaf910c8de':
  fix(browser): preserve node filenames in proxy media (#139559)
  fix(qa): give hot-reload maintenance proofs their own budgets (#139580)
  fix(streaming): preserve assistant items and settled output (#139507)
  fix(android): reconnect secondary gateways after rapid lifecycle changes (#139319)
  fix(gateway): restart inside a marker-less LaunchAgent no longer kills its caller (#139628)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Pass validated browser-node paths to the existing media-store filename argument. Preserve safe recoverable node basenames, file bytes, limits, and local result paths while keeping website filename metadata separate.

Verified through a running browser node and Gateway, focused regression coverage, and independent acceptance.

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

extensions: browser P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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.

Browser proxy files are saved as a bare UUID, discarding the node file name the envelope already carries

2 participants