Skip to content

fix: preserve readable generated image and video filenames - #147833

Merged
steipete merged 1 commit into
mainfrom
codex/fix-generated-media-readable-filenames
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-generated-media-readable-filenames

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Generated image and saved-video results show internal UUID-suffixed storage names instead of readable filenames.

User Impact

A generated poster.png is now named poster.png in attachment metadata and tool-result text, including background completion. Its unique storage path remains unchanged. URL-only video results keep their existing names.

Why This Change Was Made

Both tools now use the media store's existing filename decoder, matching the music result path. This keeps filename interpretation with the storage owner without changing persistence, delivery order, or provider requests.

Related: #147570.

Evidence

Seven strengthened existing cases failed on the original code for the incorrect names; the URL-only no-save control passed. After the repair, all 139 tests across five owner and sibling files passed, including real isolated storage and synthetic background completion. The test count is unchanged.

Independent P2 review completed two clean passes, and the complete selected changed-file gate passed. Providers were mocked; no live generation, Gateway or native app was used.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@steipete
steipete marked this pull request as ready for review September 14, 2026 03:44
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 11:56 PM ET / September 14, 2026, 03:56 UTC.

ClawSweeper review

What this changes

The PR gives generated image and saved-video attachments readable filenames in tool results and background completion, using the existing media-store decoder.

Merge readiness

✅ Ready for maintainer review

This fix remains necessary: current main and v2026.9.4 still expose storage IDs as image and saved-video names. No actionable correctness or security findings were found; the merged music fix establishes the same approach for a separate path.

Priority: P2
Reviewed head: c71147e39e41b9d01f0ef860aabdced828770903

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful strengthened regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Reported validation exercises tool results, real isolated video storage, and synthetic background completion; it does not establish live provider or application behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Reported validation exercises tool results, real isolated video storage, and synthetic background completion; it does not establish live provider or application behavior.
Evidence reviewed 8 items Pinned change boundary: The complete host-provided merge-base-to-head patch changes attachment naming in the two execution owners and strengthens existing tests. The verified test-merge comparison contains the same five files; unrelated base drift is excluded.
Current main still needs the image repair: Current main passes the selected filename into storage but assigns image.id to the attachment name. The patch instead decodes the saved path while preserving that path.
Saved-video and URL boundaries: Current main names saved videos with video.media.id. The patch changes only that branch; URL-only results retain their provider filename, URL, and ordering.
Findings None None.
Security None None.

How this fits together

Image and video tools receive generated media from providers and save buffered results in OpenClaw’s media store. Attachment metadata and formatted tool results then carry those files into foreground responses or background completion.

flowchart TD
  A[Provider results and filename hint] --> B{Buffered media or video URL}
  B -->|Buffered media| C[Media store saves unique path]
  C --> D[Existing filename decoder]
  D --> E[Attachment metadata and result text]
  B -->|Video URL| E
  E --> F[Foreground response or background completion]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +73. Total +73 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 4 0
Tests 3 99 26 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 103 30 +73

Review metrics

None.

Technical review

Best possible solution:

Keep media-store naming authoritative across generated media, preserving unique storage paths and existing URL-only behavior.

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

Yes, from source: generate buffered media with a filename hint and current main exposes the UUID-suffixed storage ID as its attachment name. Runtime reproduction was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the storage owner’s decoder is the narrow repair and matches the merged music implementation without duplicating naming policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 65710d3e8bac.

Labels

Label changes:

  • add P2: This repairs misleading generated attachment names without changing file contents, storage identity, or delivery routing.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Reported validation exercises tool results, real isolated video storage, and synthetic background completion; it does not establish live provider or application behavior.

Label justifications:

  • P2: This repairs misleading generated attachment names without changing file contents, storage identity, or delivery routing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Reported validation exercises tool results, real isolated video storage, and synthetic background completion; it does not establish live provider or application behavior.

Evidence

What I checked:

  • Pinned change boundary: The complete host-provided merge-base-to-head patch changes attachment naming in the two execution owners and strengthens existing tests. The verified test-merge comparison contains the same five files; unrelated base drift is excluded. (c71147e39e41)
  • Current main still needs the image repair: Current main passes the selected filename into storage but assigns image.id to the attachment name. The patch instead decodes the saved path while preserving that path. (src/agents/tools/image-generate-tool.execution.ts:166, 65710d3e8bac)
  • Saved-video and URL boundaries: Current main names saved videos with video.media.id. The patch changes only that branch; URL-only results retain their provider filename, URL, and ordering. (src/agents/tools/video-generate-tool.execution.ts:369, 65710d3e8bac)
  • Existing storage naming contract: The storage owner sanitizes the basename, appends a UUID, and selects the stored extension. Its existing decoder removes only the recognized UUID suffix and otherwise preserves the basename; existing tests cover regular names, UUID-only names, Unicode, and Windows paths. (src/media/store.ts:118, c71147e39e41)
  • Latest release retains the defect: GitHub source reads at v2026.9.4 show name: image.id at line 166 and name: video.media.id at line 361. Local historical blob reads failed, so release source was inspected through the read-only GitHub contents API. (src/agents/tools/image-generate-tool.execution.ts:166, 3a9d69db306c)
  • Merged sibling implementation and routing history: The supplied GitHub context verifies fix: preserve selected filenames in generated music results #147570 as merged. Its commit API identifies steipete and shows the same decoder adopted for music attachments. Local path history also records recent media-generation lifecycle work by Peter Steinberger. This supports the approach and routing, not supersession of image/video work. (src/agents/tools/music-generate-tool.execution.ts:191, d53a3401fe73)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

@steipete
steipete merged commit c47f724 into main Sep 14, 2026
257 of 258 checks passed
@steipete
steipete deleted the codex/fix-generated-media-readable-filenames branch September 14, 2026 04:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit 'e3d8d0078369b21223c70028c4502c89f1420897': (51 commits)
  fix: background requests delay opening chats (#147845)
  chore(i18n): refresh native locales (#147899)
  feat: start remote sessions without a repository (#147773)
  fix(slack): retire probe sockets after timeout (#147846)
  refactor(agents): share theme ANSI color encoding (#147838)
  improve(memory): bound vector recall decision counts (#147900)
  improve(browser): narrow dashboard lifetime rechecks (#147892)
  test(discord): compact lifecycle matrices (#147855)
  fix(agents): use exact model rows for harness support (#147849)
  test(agents): compact embedded lifecycle matrices (#147856)
  test(agents): compact embedded admission matrices (#147853)
  test(cli): compact node management matrices (#147854)
  feat(artifacts): select assistant-delivered files by run (#147682)
  improve: reduce event-loop work when recording prompts (#147876)
  fix: preserve readable generated image and video filenames (#147833)
  fix(ci): skip SDK rendering for identical revisions (#147572)
  fix: prevent false process failures and stalled background waits (#147871)
  fix(ui): restore live updates when retrying chat history (#147865)
  fix(ui): preserve text and image order in assistant replies (#147731)
  refactor(qa-lab): reuse approval result formatter (#147867)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

1 participant