Repository navigation
fix: preserve percent sequences in media download filenames - #139508
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. Reviewed September 5, 2026, 9:13 PM ET / September 6, 2026, 01:13 UTC. ClawSweeper reviewWhat this changesThe PR preserves literal percent sequences in managed media download filenames by reusing the shared filename encoder, with regression coverage and documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: fetched main and the latest release retain the faulty filename path. No blocking correctness or security finding remains, and the supplied browser evidence supports the repair. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway serves session-scoped media attachments to OpenClaw clients. Its download headers tell browsers how to name saved originals and image thumbnails. flowchart LR
A[Client download request] --> B[Session attachment access checks]
B --> C[Managed original or thumbnail]
C --> D[Shared filename encoder]
D --> E[HTTP media response]
E --> F[Browser saves named file]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -7, Tests +58, Docs +3. Total +54 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing shared encoder for all managed-media download headers while preserving media dispositions and session-scoped access. Do we have a high-confidence way to reproduce the issue? Yes: source identifies the ASCII-header path, and the supplied Chromium before/after observation demonstrates the percent-sequence failure. This review did not execute a reproduction. Is this the best way to solve the issue? Yes: removing the divergent serializer repairs the response-header owner and reuses an established encoder already used by the adjacent assistant-media route. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4d8398494f8e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* commit '6c55a99226ed0611ca088004c81b00fb296f1f71': (182 commits) test(ui): scope dashboard settings setup to the top frame (openclaw#139618) refactor(skills): share pending proposal creation (openclaw#139617) fix(release): accept frozen targets before worker bundles (openclaw#136699) fix(gateway): preserve percent sequences in media filenames (openclaw#139508) fix: preserve current update availability alongside update history (openclaw#139501) feat(diagnostics): expose garbage collection duration metrics (openclaw#139592) fix(ui): keep Logbook timestamps clear of the activity stripe (openclaw#139539) fix(ui): keep Swarm outcomes visible after completion (openclaw#139490) test: check file accessibility without runtime-specific return values (openclaw#139590) refactor(sdk): keep helper types private (openclaw#139601) fix(cron): preserve current-session delivery intent (openclaw#139491) fix: prevent browser profile permission hangs in Doctor (openclaw#139612) fix(agents): repair storage-failure test fixture after failover owner move (openclaw#139531) fix(cli): keep note text with Windows and Unicode line endings (openclaw#139512) fix(agents): keep isolated completion context on its admitted generation (openclaw#139607) fix: avoid declaration builds during source-server updates (openclaw#139392) fix(models): keep discovered models after catalog refresh failures (openclaw#139357) fix(gateway): record a transcript notice when a run fails before replying (openclaw#139439) refactor(ios): reuse shared integer conversion (openclaw#139581) fix(sessions): prevent database lock failures during reclamation (openclaw#139469) ...
* commit 'refs/openclaw/tasks/pr-135167-main-latest': test(ui): scope dashboard settings setup to the top frame (#139618) refactor(skills): share pending proposal creation (#139617) fix(release): accept frozen targets before worker bundles (#136699) fix(gateway): preserve percent sequences in media filenames (#139508) fix: preserve current update availability alongside update history (#139501) feat(diagnostics): expose garbage collection duration metrics (#139592) fix(ui): keep Logbook timestamps clear of the activity stripe (#139539) fix(ui): keep Swarm outcomes visible after completion (#139490) test: check file accessibility without runtime-specific return values (#139590) refactor(sdk): keep helper types private (#139601) fix(cron): preserve current-session delivery intent (#139491) fix: prevent browser profile permission hangs in Doctor (#139612) fix(agents): repair storage-failure test fixture after failover owner move (#139531) fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439)
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users downloading managed audio, video, or image attachments received a changed filename when the name contained a literal percent sequence. For example, Chromium saved
recording%20take.wavasrecording take.wav, even though the attachment retained the correct name in chat. Image thumbnails had the same problem.Why This Change Was Made
The managed-media route now uses the existing shared download filename encoder for every media kind and variant. Removing its separate ASCII serializer keeps the exact filename in
filename*and consolidates the handling already used for Unicode names and documents.Production LOC: +1/−8 (net −7). Tests: +81/−23. The media playback guide also documents preserved download names.
User Impact
Literal percent sequences remain part of downloaded filenames. Originals and image thumbnails share the same filename handling, while inline media and document download dispositions retain their existing behavior.
Evidence
src/gateway/managed-image-attachments.test.tspassed.downloadattribute used by the UI. Before:recording take.wav. After:recording%20take.wav. Plain ASCII and Unicode controls also passed. Every response returned HTTP 200 and the complete WAV, and each owned browser, server, download, and state directory was cleaned up.Remaining broad validation runs in hosted CI on the published PR head.