Skip to content

fix: download session files through the development proxy - #173973

Merged
shakkernerd merged 1 commit into
mainfrom
fix/dev-file-download
Oct 16, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/dev-file-download

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #173949

What Problem This Solves

In a Control UI development session using the configured Gateway proxy, opening a file preview works but Download file reports that downloads require a same-origin Gateway connection. The failure happens before the file authorization request, so the browser never receives a download.

User Impact

Session files can download through the already-configured development proxy. Direct same-origin downloads keep working, and an unrelated cross-origin Gateway remains refused. Downloads retain the existing authorization, current-session checks and validation of the browser download URL; no configuration or migration is required.

Why This Change Was Made

Development keeps the upstream Gateway's logical identity separate from its same-origin browser transport. The download caller now asks the existing transport owner whether the connection is same-origin, instead of comparing the upstream identity with the page origin. Resource paths continue to use the existing proxy base path. Reload/bootstrap identity checks and other artifact transports are unchanged.

Evidence

The existing owner test covers direct same-origin and foreign Gateways, configured development transport, a foreign target while a proxy is configured, and a session change while download authorization is pending. The new proxy cases reproduce the origin rejection on the base before the caller is corrected.

Remote changed-file formatting/lint, UI catalog validation and all eleven selected UI/consumer type graphs passed. The focused file passed all five cases in 3.21 seconds of test-command wall time (Vitest: 1.65 seconds), after the base failed its two configured-proxy cases. The prescribed pnpm test ui/src/api/session-file-download.test.ts --maxWorkers=1 measurement also passed all five cases in 3.874 seconds wall time (Vitest: 1.60 seconds). The three hosted UI unit shards passed in 284, 312 and 313 job-seconds respectively; those totals include setup and the existing selected suites, so they are not the incremental cost of the five cases. The hosted UI end-to-end row also passed (95 job-seconds).

The authenticated guest UI downloaded the saved file through the native development proxy: 311 bytes, SHA-256 3dd962e5de2a54d1555ec6eab5c0ad03a398caa8e10af385b7c424f181cd35da, exactly matching the saved workspace file. The affected author files match the qualified runtime. Before/after captures and the focused interaction are below. Independent review found no actionable defects. CI retains the historical debug-overlay lint failure fixed by #173976; the same lint lane passed on that repair, which remains in the qualified merged result. All other selected CI jobs passed.

Visual evidence

Open preview

Before After
Download fails with a same-origin error Download completes without that error

Actual guest interaction; orange outline indicates the clicked control

after-public.mp4

Visual verification

  • Baseline: 17fedf5b0bd3639f8058e6baba053a2987c93061
  • Exact head: dad4c5b78664f9fb7f3730bd4be31cef09206958
  • Scenario: Download a saved source file through the native development UI proxy.
  • Runtime/build: Local OpenClaw development runtime, producer bbc3b1f869937f164b3b6ecc905dc03cfc054c8c; source-equivalent affected files; original build stamps preserved.
  • Observed result: Downloaded 311 bytes through the real UI
  • Observed result: SHA-256 3dd962e5de2a54d1555ec6eab5c0ad03a398caa8e10af385b7c424f181cd35da
  • Observed result: Bytes equal the saved workspace file; genuine cross-origin protection retained
  • Actual authenticated guest UI, retained session and workspace
  • Before and after captures use the same browser viewport and theme; cropped to the affected surface
  • Timestamped actual screenshot-stream frames; private surroundings redacted
  • Affected author files match the combined runtime; test-only corrections preserve production bytes

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes session-file downloads use the existing proxy-aware transport-origin check.

Example: Download report.md through the configured development proxy to ws://127.0.0.1:18789/control.

  • Before: The preview opens, but downloading fails with a same-origin connection error.
  • After: The download is authorized and uses /dev-proxy/control/api/artifacts/download/connection/ticket.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful correction with meaningful regression coverage and browser evidence; the prior request-trace suggestion could not be fully verified, which is an inspection limitation rather than contributor merge work.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored repair is outside the ordinary contributor proof gate; inspected browser screenshots and the reported matching-byte download support the changed path, while recording playback and an independently inspectable request trace remain unavailable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An authorized session file opens in the development UI but cannot be downloaded through its configured Gateway proxy.
Reason: The maintainer-authored change restores documented behavior using an existing owner, without adding configuration or changing the download permission contract.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes the documented development-proxy download path without an identified code defect; the required CI gate remains red.

Priority: P2
Reviewed head: dad4c5b78664f9fb7f3730bd4be31cef09206958

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI download caller checks the browser transport, requests a connection-bound file grant from the Gateway, and returns a validated same-origin URL to the browser download control.

flowchart LR
  A[Files list or preview] --> B[Session download caller]
  B --> C[Transport origin owner]
  B --> D[Gateway file authorization]
  D --> E[Connection bound HTTP grant]
  E --> F[Development proxy]
  F --> G[Browser download]
Loading

Technical review

Best possible solution:

Keep the focused transport-owner correction and resolve the required CI gate through the repository's existing landing workflow.

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

Current-main source rejects the upstream Gateway identity before authorization despite its configured same-origin transport; the supplied before screenshot shows that exact failure.

Is this the best way to solve the issue?

Reusing the existing transport-origin owner is the smallest complete repair and preserves foreign-origin rejection, connection/session validation, and download URL validation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3aa642027ea1.

Provenance checked

  • Session-file origin admission keeps the original intent (5266c8d: Reject foreign-origin routing before minting a grant while supporting same-origin Gateways and proxies.)
  • Development transport identity keeps the original intent (86ff55d: Preserve Gateway identity for credentials and settings while routing browser HTTP and WebSocket traffic through Vite.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 5266c8d adds ui/src/api/session-file-download.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5266c8d14862; files: ui/src/api/session-file-download.ts)

PR surface

Source 0, Tests +41. Total +41 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 48 7 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 50 9 +41

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The bug blocks file downloads in the supported development-proxy configuration, with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T07:42:51.212Z sha dad4c5b :: needs maintainer review before merge. :: none

Reviewed October 16, 2026, 4:53 AM ET / 08:53 UTC (Revision 2).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@shakkernerd shakkernerd self-assigned this Oct 16, 2026
@shakkernerd
shakkernerd merged commit ce75642 into main Oct 16, 2026
143 of 146 checks passed
@shakkernerd
shakkernerd deleted the fix/dev-file-download branch October 16, 2026 09:40
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: session files download through the configured development Gateway proxy.

vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'ac03ca0b6d26a7dc55d0d262e40d2549631b1ea7': (25 commits)
  fix: apply shared plugin model policy to decisions (#156621)
  perf: shortlist transcript relevance scores before metadata reads (#174058)
  fix: strip standalone trailing NO_REPLY from replies (#171990)
  fix(ci): avoid repeated discovery during changed-test planning (#174069)
  fix(sqlite): preserve transaction outcomes when warnings throw (#157151)
  fix(ai): native video handoff to chat-completions providers + preflight video cost (#170920)
  fix(litellm): image generation fails when the backend returns image URLs (#173508)
  test(memory,gateway,infra,subagents): remove low-value tests (batch d152) (#174034)
  perf(memory): bound derived worker snapshot and pricing retention (#174067)
  fix(test): reduce eager imports during test startup (#174056)
  refactor(codex): share lifecycle preflight fixtures (#174062)
  test(gateway,matrix,agents,ui): remove low-value tests (batch d150) (#174025)
  perf(infra): batch usage refresh maintenance (#174050)
  fix(gateway): revert cold session list worker regression (#174052)
  refactor(config): consolidate browser meeting configuration (#173947)
  fix(cron): keep global-session deliveries on the selected agent (#173855)
  test(compaction): assert structured stale-writer failure (#174064)
  fix(cli): local terminal chat sends model requests without the configured proxy (#173530)
  test(ui): restore bootstrap preference locale after each case (#174065)
  fix: download session files through the development proxy (#173973)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…73973)

Restore session file downloads through the configured development Gateway proxy while retaining cross-origin and current-session checks.

Fixes openclaw#173949.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

Files downloads reject the configured development Gateway proxy

1 participant