Repository navigation
fix(browser): uploads fail when the browser runs on a remote node - #115291
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:30 PM ET / 16:30 UTC. ClawSweeper reviewWhat this changesThe 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 Likely related people:
Priority: P2 Review scores
Verification
How this fits togetherThe 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +65. Total +75 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label 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
|
9eb474b to
f11c2c9
Compare
vincentkoc
left a comment
There was a problem hiding this comment.
Requesting changes because this currently forwards an ambiguous path/URI across the Gateway-to-node boundary without defining who owns the bytes.
Blocking findings:
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.- 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 mockednode.invokeproves forwarding, not that the real route accepts the path. - The
media://inbound/node-only-file.pdftest succeeds only because the node proxy is mocked; that URI is explicitly Gateway-owned in the browser tool context. - 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. - 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
…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
f11c2c9 to
f7b2e67
Compare
|
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. |
|
Merged via squash.
|
* 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 ...
…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 ...
* 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 ...
…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 ...
…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 ...
…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]>
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.v1node 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
tsconfig.extensions.jsonand extension-testtsgolanes passed.oxfmt, focusedoxlint,git diff --check, secret scanning, fresh autoreview, and an independent sub-agent review are clean.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.