Skip to content

fix(browser): uploads fail when the browser runs on a remote node - #115291

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
synthalorian:fix/issue-115251
Jul 29, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
synthalorian:fix/issue-115251

Conversation

@synthalorian

@synthalorian synthalorian commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #115251

What Problem This Solves

Fixes an issue where users uploading files through the browser tool would see the upload fail when the browser session ran on a remote node with a different filesystem from the Gateway.

Why This Change Was Made

Browser upload paths remain Gateway-owned. For remote browser sessions, the Gateway now resolves and reads those files, sends bounded bytes through an additive browser.proxy.upload.v1 node command, and the browser node stages private route-valid copies under its managed upload root. Local browser uploads keep their existing validation path, auto-selected older nodes fall back to the Gateway before files are read, and explicitly selected older nodes fail with upgrade/approval guidance.

The transport enforces per-file, aggregate, file-count, retained-byte, and retained-directory limits; canonical base64; private modes; portable filenames; exact command authorization; cancellation/deadline handling; marker-owned cleanup; and compatibility-safe negotiation.

User Impact

Uploads now work when the Gateway and browser node do not share a filesystem. Existing local uploads are unchanged. Operators upgrading nodes get a safe host fallback for automatic routing or a clear error for configured/explicit routing, without forwarding raw Gateway paths to another host.

Evidence

The strongest behavior proof uses separate Gateway/node filesystem roots through the real prepare -> transfer envelope -> node staging -> route-validation path, plus command-policy and local negative-control coverage. No live browser backend was available for a two-process file-chooser recording, so that older rank-up move remains an explicit proof gap rather than being claimed as completed.

Residual bounded risk: after an embedded macOS node-host worker restart, expired staged files are recovered on the first browser proxy command rather than immediately at worker startup. Retained storage is capped at 256 MiB and 64 directories; expanding the core/plugin lifecycle API solely for eager cleanup was intentionally kept out of this fix.

The production additions implement the missing cross-host ownership and security boundary; the larger line count is primarily bounded transport validation, cleanup, policy integration, and regression coverage rather than unrelated refactoring.

AI-assisted maintainer changes were reviewed, tested, and verified as described above.

@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. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:30 PM ET / 16:30 UTC.

ClawSweeper review

What this changes

The PR preserves Gateway-side path validation for local browser sessions while forwarding upload paths unchanged when a remote browser node owns the session.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The patch matches the current browser-node ownership boundary: current main resolves every upload path on the Gateway before it can proxy the request, while the proposed branch leaves proxied paths for the browser-node route to resolve. The patch has focused regression coverage and no concrete correctness or security finding, but the submitted evidence is mock-based rather than a real remote-node upload, so it needs real behavior proof before merge.

Likely related people:

  • vincentkoc — low-confidence routing candidate; they reported the linked browser-node failure as a repository member.

Priority: P2
Reviewed head: 9eb474b27a58d8a6816f1f700554fbdbec4d1bde

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and regression tests are focused, but real remote-node behavior proof is still required before merge.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR includes focused mock-based tests and copied test output, but no redacted real remote browser-node upload evidence; add a terminal transcript, runtime logs, or recording that shows a node-local file succeeds after the fix. 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 real behavior proof before merge: The PR includes focused mock-based tests and copied test output, but no redacted real remote browser-node upload evidence; add a terminal transcript, runtime logs, or recording that shows a node-local file succeeds after the fix. 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 4 items Current-main behavior: Current main resolves upload paths with resolveExistingUploadPaths before the later proxy/local dispatch decision, so a node-local path can be evaluated against the Gateway filesystem.
Proposed ownership correction: The PR conditions Gateway resolution on !proxyRequest, retaining local validation and forwarding requested paths unchanged for proxied requests.
Focused regression coverage: The added tests assert that proxied uploads do not invoke Gateway-side resolution and do not reject a node-local path merely because it is absent from the Gateway filesystem.
Findings None None.
Security None None.

How this fits together

The browser tool accepts agent upload requests and either calls a Gateway-local browser server or proxies the request to a browser node. Upload paths must be resolved by the filesystem that owns the browser control server before the file chooser receives them.

flowchart LR
  A[Agent browser upload request] --> B[Browser tool]
  B --> C{Remote browser node?}
  C -->|No| D[Gateway path validation]
  C -->|Yes| E[Forward requested paths]
  D --> F[Local file chooser]
  E --> G[Node file chooser]
  F --> H[Browser upload]
  G --> H
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR includes focused mock-based tests and copied test output, but no redacted real remote browser-node upload evidence; add a terminal transcript, runtime logs, or recording that shows a node-local file succeeds after the fix. 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 (P1) - A mocked gateway call does not prove that a real remote browser node receives, resolves, and uploads a node-local file correctly; before merge, show a redacted remote-node run that also confirms local uploads retain their existing validation behavior.
  • Complete next step (P2) - The code review is clear, but this external PR needs contributor-provided real remote-node behavior proof before normal maintainer merge review.
Agent review details

Security

None.

PR surface

Source +10, Tests +65. Total +75 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 14 4 +10
Tests 1 65 0 +65
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 79 4 +75

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #115251
Summary: This PR explicitly targets the linked remote browser-node upload issue and provides a candidate implementation for that single reported behavior.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one path-validation owner per session: retain Gateway validation for local sessions and validate proxied upload paths only at the browser node's file-chooser boundary, supported by a redacted real remote-node upload proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one path-validation owner per session: retain Gateway validation for local sessions and validate proxied upload paths only at the browser node's file-chooser boundary, supported by a redacted real remote-node upload proof.

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

No executed current-main reproduction was available in this review. Source inspection and the focused regression tests provide a clear path: use a proxied browser session with a file that exists only on the browser node.

Is this the best way to solve the issue?

Yes, subject to live proof. Skipping Gateway resolution only for proxied sessions matches the documented route ownership while preserving the existing local-session validation path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a scoped remote browser-node upload failure without evidence of an emergency availability, security, or data-loss impact.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR includes focused mock-based tests and copied test output, but no redacted real remote browser-node upload evidence; add a terminal transcript, runtime logs, or recording that shows a node-local file succeeds after the fix. 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.

Label justifications:

  • P2: This repairs a scoped remote browser-node upload failure without evidence of an emergency availability, security, or data-loss impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR includes focused mock-based tests and copied test output, but no redacted real remote browser-node upload evidence; add a terminal transcript, runtime logs, or recording that shows a node-local file succeeds after the fix. 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:

  • vincentkoc: Reported the browser-node upload failure that this PR explicitly targets; the supplied context identifies them as a repository member, but no current-main feature-history attribution was available in the review evidence. (role: linked issue reporter; confidence: low; files: extensions/browser/src/browser-tool.ts, extensions/browser/src/browser/routes/agent.act.hooks.ts)

Rank-up moves

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

  • Run one real proxied browser-node upload using a file present only on the node and attach a redacted terminal transcript, logs, or recording.
  • Include a local-session negative control showing that Gateway-side invalid-path rejection remains unchanged.

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.

@vincentkoc vincentkoc self-assigned this Jul 29, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes because this currently forwards an ambiguous path/URI across the Gateway-to-node boundary without defining who owns the bytes.

Blocking findings:

  1. media://inbound/... is Gateway-managed input. Forwarding it unchanged asks the remote node to resolve the same opaque URI against a different inbound store, which can fail or select unrelated node-local state.
  2. The success test uses /home/node-user/uploads/report.pdf, but the real node upload route only accepts its managed upload root or node inbound media. The mocked node.invoke proves forwarding, not that the real route accepts the path.
  3. The media://inbound/node-only-file.pdf test succeeds only because the node proxy is mocked; that URI is explicitly Gateway-owned in the browser tool context.
  4. The sibling browser CLI still resolves files on the Gateway before /hooks/file-chooser, so this is a one-sided fix for a shared upload contract.
  5. Automatic host fallback can switch an auto-selected node request back to the Gateway, making raw-source semantics depend on routing outcome.

Best-fix verdict: wrong layer. Define an explicit source-ownership/transport contract. Gateway-managed bytes should be staged into the node-managed upload root with cleanup, following the lifecycle pattern in src/infra/terminal-file-upload.ts. Truly node-local sources need a distinct explicit input shape. Apply the same contract to the tool and CLI paths, then prove it against a real remote browser node.

Issue remains open: #115251

synthalorian and others added 2 commits July 29, 2026 13:50
…e Gateway

When a browser session is proxied to a remote node, the upload action
previously ran resolveExistingUploadPaths on the Gateway, pinning paths
to a filesystem the node cannot see and rejecting node-local files. The
node-side /hooks/file-chooser route already re-resolves paths against
its own filesystem, so skip Gateway-local resolution whenever the
request is proxied and forward the requested paths as-is.

Fixes openclaw#115251
@vincentkoc
vincentkoc requested a review from a team as a code owner July 29, 2026 11:54
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime plugin: file-transfer size: XL and removed size: S labels Jul 29, 2026
@vincentkoc vincentkoc changed the title fix(browser): uploads on remote browser nodes fail by resolving paths on the Gateway fix(browser): uploads fail when the browser runs on a remote node Jul 29, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification update:

Known proof gap: no live browser backend was available for a two-process file-chooser recording. The replacement proof uses separate Gateway/node filesystem roots through the real prepare -> envelope -> staging -> route-validation path, with local negative controls and node command-policy tests.

Residual bounded risk: the embedded macOS worker performs restart recovery on its first browser proxy command; retained staging is capped at 256 MiB / 64 directories. The PR body now records the rationale and evidence.

@vincentkoc
vincentkoc merged commit 151c549 into openclaw:main Jul 29, 2026
120 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main: (128 commits)
  fix(codex): keep stressed inference turns isolated and observable (#115893)
  feat(skills): review interrupted deep turns in experience review (#115887)
  fix: reject malformed UTF-8 in proxy gateway error response bodies (#111852)
  fix(browser): stabilize atomic download staging (#115892)
  fix(google): cancel unread response body on video download error (#110045)
  refactor(ui): give Memory the shared hub header with hoisted agent scope (#115884)
  fix(test): stop asserting exact video deadline budgets (#115883)
  feat(gateway): expose MCP tool identity in effective tools (#115870)
  fix(skills): verify workshop migration without recovery
  refactor: replace context-engine retry proxy with declared params (#115872)
  fix: reject malformed UTF-8 in hosted official plugin catalog feed responses (#111768)
  fix(codex): harden app inventory invalidation and targeted publishes (#115866)
  fix(browser): uploads fail when the browser runs on a remote node (#115291)
  fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
  fix(skills): recover complete apply transitions
  fix(macos): reap timed-out shell process groups (#115859)
  refactor(ollama): unify model inspection and setup (#115879)
  fix(ui): muted theme text below WCAG AA contrast in webchat (#114586)
  fix(test): restore isolated memory manager tests (#115880)
  fix(skills): revalidate rollback targets
  ...
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…discovery

* origin/main: (72 commits)
  fix(codex): keep stressed inference turns isolated and observable (#115893)
  feat(skills): review interrupted deep turns in experience review (#115887)
  fix: reject malformed UTF-8 in proxy gateway error response bodies (#111852)
  fix(browser): stabilize atomic download staging (#115892)
  fix(google): cancel unread response body on video download error (#110045)
  refactor(ui): give Memory the shared hub header with hoisted agent scope (#115884)
  fix(test): stop asserting exact video deadline budgets (#115883)
  feat(gateway): expose MCP tool identity in effective tools (#115870)
  fix(skills): verify workshop migration without recovery
  refactor: replace context-engine retry proxy with declared params (#115872)
  fix: reject malformed UTF-8 in hosted official plugin catalog feed responses (#111768)
  fix(codex): harden app inventory invalidation and targeted publishes (#115866)
  fix(browser): uploads fail when the browser runs on a remote node (#115291)
  fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
  fix(skills): recover complete apply transitions
  fix(macos): reap timed-out shell process groups (#115859)
  refactor(ollama): unify model inspection and setup (#115879)
  fix(ui): muted theme text below WCAG AA contrast in webchat (#114586)
  fix(test): restore isolated memory manager tests (#115880)
  fix(skills): revalidate rollback targets
  ...
vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main: (95 commits)
  fix(codex): keep stressed inference turns isolated and observable (#115893)
  feat(skills): review interrupted deep turns in experience review (#115887)
  fix: reject malformed UTF-8 in proxy gateway error response bodies (#111852)
  fix(browser): stabilize atomic download staging (#115892)
  fix(google): cancel unread response body on video download error (#110045)
  refactor(ui): give Memory the shared hub header with hoisted agent scope (#115884)
  fix(test): stop asserting exact video deadline budgets (#115883)
  feat(gateway): expose MCP tool identity in effective tools (#115870)
  fix(skills): verify workshop migration without recovery
  refactor: replace context-engine retry proxy with declared params (#115872)
  fix: reject malformed UTF-8 in hosted official plugin catalog feed responses (#111768)
  fix(codex): harden app inventory invalidation and targeted publishes (#115866)
  fix(browser): uploads fail when the browser runs on a remote node (#115291)
  fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
  fix(skills): recover complete apply transitions
  fix(macos): reap timed-out shell process groups (#115859)
  refactor(ollama): unify model inspection and setup (#115879)
  fix(ui): muted theme text below WCAG AA contrast in webchat (#114586)
  fix(test): restore isolated memory manager tests (#115880)
  fix(skills): revalidate rollback targets
  ...
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…d-fingerprint

* origin/main: (36 commits)
  fix(codex): keep stressed inference turns isolated and observable (#115893)
  feat(skills): review interrupted deep turns in experience review (#115887)
  fix: reject malformed UTF-8 in proxy gateway error response bodies (#111852)
  fix(browser): stabilize atomic download staging (#115892)
  fix(google): cancel unread response body on video download error (#110045)
  refactor(ui): give Memory the shared hub header with hoisted agent scope (#115884)
  fix(test): stop asserting exact video deadline budgets (#115883)
  feat(gateway): expose MCP tool identity in effective tools (#115870)
  fix(skills): verify workshop migration without recovery
  refactor: replace context-engine retry proxy with declared params (#115872)
  fix: reject malformed UTF-8 in hosted official plugin catalog feed responses (#111768)
  fix(codex): harden app inventory invalidation and targeted publishes (#115866)
  fix(browser): uploads fail when the browser runs on a remote node (#115291)
  fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
  fix(skills): recover complete apply transitions
  fix(macos): reap timed-out shell process groups (#115859)
  refactor(ollama): unify model inspection and setup (#115879)
  fix(ui): muted theme text below WCAG AA contrast in webchat (#114586)
  fix(test): restore isolated memory manager tests (#115880)
  fix(skills): revalidate rollback targets
  ...
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…ocess-probes

* origin/main: (56 commits)
  fix(codex): keep stressed inference turns isolated and observable (#115893)
  feat(skills): review interrupted deep turns in experience review (#115887)
  fix: reject malformed UTF-8 in proxy gateway error response bodies (#111852)
  fix(browser): stabilize atomic download staging (#115892)
  fix(google): cancel unread response body on video download error (#110045)
  refactor(ui): give Memory the shared hub header with hoisted agent scope (#115884)
  fix(test): stop asserting exact video deadline budgets (#115883)
  feat(gateway): expose MCP tool identity in effective tools (#115870)
  fix(skills): verify workshop migration without recovery
  refactor: replace context-engine retry proxy with declared params (#115872)
  fix: reject malformed UTF-8 in hosted official plugin catalog feed responses (#111768)
  fix(codex): harden app inventory invalidation and targeted publishes (#115866)
  fix(browser): uploads fail when the browser runs on a remote node (#115291)
  fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
  fix(skills): recover complete apply transitions
  fix(macos): reap timed-out shell process groups (#115859)
  refactor(ollama): unify model inspection and setup (#115879)
  fix(ui): muted theme text below WCAG AA contrast in webchat (#114586)
  fix(test): restore isolated memory manager tests (#115880)
  fix(skills): revalidate rollback targets
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…enclaw#115291)

* fix(browser): resolve upload paths on the owning browser node, not the Gateway

When a browser session is proxied to a remote node, the upload action
previously ran resolveExistingUploadPaths on the Gateway, pinning paths
to a filesystem the node cannot see and rejecting node-local files. The
node-side /hooks/file-chooser route already re-resolves paths against
its own filesystem, so skip Gateway-local resolution whenever the
request is proxied and forward the requested paths as-is.

Fixes openclaw#115251

* fix(browser): transfer uploads to remote browser nodes

* fix(browser): normalize upload abort errors

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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.

[Bug]: remote browser-node uploads reuse gateway-local file paths

2 participants