Repository navigation
fix: download session files through the development proxy - #173973
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +41. Total +41 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 16, 2026, 4:53 AM ET / 08:53 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: session files download through the configured development Gateway proxy. |
* 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) ...
…73973) Restore session file downloads through the configured development Gateway proxy while retaining cross-origin and current-session checks. Fixes openclaw#173949.
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=1measurement 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
Actual guest interaction; orange outline indicates the clicked control
after-public.mp4
Visual verification
dad4c5b78664f9fb7f3730bd4be31cef09206958