Skip to content

fix(media): strip internal UUID suffix from outbound media filenames#96565

Merged
obviyus merged 2 commits into
openclaw:mainfrom
NarahariRaghava:fix/strip-media-store-uuid-from-outbound-filename
Jun 25, 2026
Merged

fix(media): strip internal UUID suffix from outbound media filenames#96565
obviyus merged 2 commits into
openclaw:mainfrom
NarahariRaghava:fix/strip-media-store-uuid-from-outbound-filename

Conversation

@NarahariRaghava

Copy link
Copy Markdown
Contributor

Closes #96538

What Problem This Solves

Fixes an issue where users receiving files from an agent on Telegram (and other chat channels) would see internal cache suffixes in the filename, e.g. resume---a1b2c3d4-5678-90ab-cdef-1234567890ab.pdf instead of resume.pdf. The internal media-store UUID used for deduplication was leaking into the recipient-visible attachment filename.

Why This Change Was Made

The shared outbound media loader (loadWebMediaInternal) derives the recipient-facing filename from the staged file's basename, which includes an internal ---<uuid> suffix for cache deduplication. The media store already exposes extractOriginalFilename to strip this suffix, but it was not being called on the outbound path. This change applies that existing helper at the shared media boundary so all channels benefit.

User Impact

Users receiving file attachments from agents on Telegram, Slack, Discord, and other chat channels will now see clean original filenames instead of filenames polluted with internal cache identifiers.

Evidence

All 74 existing tests pass plus a new regression test that verifies a staged file named with the internal UUID suffix produces a clean outbound filename.

@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 7:20 PM ET / 23:20 UTC.

Summary
The PR imports the media-store original-filename helper into the shared web media loader and adds a regression test for staged filenames with ---<uuid> suffixes.

PR surface: Source +4, Tests +10. Total +14 across 2 files.

Reproducibility: yes. Mantis reproduced the before/after Telegram filename behavior on the PR base, and current main has no relevant diff in the media loader or Telegram send files, so the same source path remains present on current main.

Review metrics: 1 noteworthy metric.

  • Shared Filename Boundary: 1 shared media-loader boundary changed. All channel and plugin callers that use local loadWebMedia filenames can inherit the recipient-visible normalization.

Stored data model
Persistent data-model change detected: serialized state: src/media/web-media.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96538
Summary: This PR is the live implementation candidate for the open Telegram outbound filename issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Maintainers should explicitly accept the shared filename normalization or ask for it to be narrowed to media-store-resolved paths.

Risk before merge

  • [P1] The shared loader now strips any local basename matching the media-store UUID suffix pattern, so Discord/plugin SDK and other local loadWebMedia callers inherit the visible rename even when the input was not resolved from the media store.

Maintainer options:

  1. Accept Shared Filename Normalization (recommended)
    Maintainers can intentionally accept that local outbound media filenames matching the media-store suffix pattern are displayed as their original names across Telegram, Discord, and plugin SDK callers.
  2. Narrow To Media-Store-Resolved Paths
    If arbitrary local filenames must be preserved exactly, ask for a follow-up patch that only strips suffixes after the URL/path is known to come from the OpenClaw media store.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer acceptance of the shared filename behavior and normal merge decision.

Security
Cleared: The diff only changes filename normalization and a regression test; it does not add dependencies, workflows, secrets handling, permissions, or code-execution surfaces.

Review details

Best possible solution:

Merge the shared media-loader normalization with its regression test after maintainers explicitly accept the cross-channel filename behavior, and keep the linked issue paired until this PR lands or is replaced.

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

Yes. Mantis reproduced the before/after Telegram filename behavior on the PR base, and current main has no relevant diff in the media loader or Telegram send files, so the same source path remains present on current main.

Is this the best way to solve the issue?

Yes. The shared loader is the best fix location because the leak originates before channel delivery and sibling callers consume the same media.fileName; a Telegram-only strip would leave other outbound paths inconsistent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3ab8d6aa609a.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a normal-priority user-visible attachment filename bug with a narrow shared media fix and limited blast radius.
  • merge-risk: 🚨 compatibility: Merging changes recipient-visible filenames for every local loadWebMedia caller whose basename matches the media-store UUID suffix pattern.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • proof: sufficient: Contributor real behavior proof is sufficient. Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Mantis before/after Telegram Desktop recordings and screenshots show the polluted filename on main and the clean filename on the PR candidate.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes a visible Telegram attachment filename, which is exactly the kind of behavior a short Telegram Desktop proof can demonstrate.
Evidence reviewed

PR surface:

Source +4, Tests +10. Total +14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 0 +4
Tests 1 10 0 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 14 0 +14

What I checked:

Likely related people:

  • steipete: Recent GitHub history for src/media/web-media.ts and src/media/store.ts includes media helper documentation and media-core extraction around the shared media boundary. (role: recent media/outbound contributor; confidence: medium; commits: f1bdc91b64d4, 77f1359612f6; files: src/media/web-media.ts, src/media/store.ts)
  • vincentkoc: Recent src/media/store.ts commits touched media-store error normalization, temp-save wrapping, and staged media extension behavior adjacent to the filename contract. (role: recent media-store contributor; confidence: medium; commits: af7797b0adfa, e69fedc8cfad, 2bdbf240a92d; files: src/media/store.ts)
  • obviyus: Recent Telegram rich-message work touched the delivery surfaces that consume media.fileName for visible Telegram sends. (role: recent Telegram delivery contributor; confidence: medium; commits: da92615816b6, 547cc0f10903; files: extensions/telegram/src/bot/delivery.replies.ts, extensions/telegram/src/send.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. labels Jun 24, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 24, 2026 22:08 Inactive
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 24, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs showing the attachment filename before and after the PR.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-96565/run-28132691685-1/index.json

@NarahariRaghava

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 24, 2026
@obviyus obviyus self-assigned this Jun 25, 2026
@obviyus
obviyus force-pushed the fix/strip-media-store-uuid-from-outbound-filename branch from 1f0939a to 5e502e8 Compare June 25, 2026 15:34
@obviyus
obviyus merged commit dc12b99 into openclaw:main Jun 25, 2026
43 checks passed
@obviyus

obviyus commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

Proof before landing:

  • node scripts/run-vitest.mjs src/media/web-media.test.ts
  • pnpm exec oxfmt --check src/media/web-media.ts src/media/web-media.test.ts
  • .agents/skills/autoreview/scripts/autoreview --mode local

Changelog skipped per release-owned policy.

Thanks @NarahariRaghava!

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

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

Telegram outbound filenames include internal cache suffix (---<uuid>)

2 participants