Repository navigation
fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix - #118628
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 9:03 AM ET / 13:03 UTC. ClawSweeper reviewWhat this changesThe PR preserves canonical original filenames in Control UI chat-history attachment cards and restores legacy inbound labels by removing only the terminal managed UUID suffix. Merge readinessKeep this active PR open for normal maintainer merge review. It fixes the linked current behavior at the correct UI projection boundary, has sufficient production-path terminal proof and focused regression coverage, and no actionable patch defect was found; wait for the exact-head required checks to finish successfully before merging. Priority: P2 Review scores
Verification
How this fits togetherPersisted transcript media facts feed the Control UI chat-history projection, which creates visible cards for non-image attachments. The card label is presentation only; the managed media URI remains the identity used for storage and retrieval. flowchart LR
A[Uploaded file] --> B[Persisted transcript media facts]
B --> C[History media projection]
C --> D[Label preference and legacy fallback]
D --> E[Attachment card]
E --> F[Control UI chat history]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +110. Total +126 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land this focused projection repair after exact-head CI passes, retaining canonical fileName as the preferred label and the managed URI as the unchanged storage identity. Do we have a high-confidence way to reproduce the issue? Yes. The checked-out main source drops canonical fileName from the history-media projection, and the PR supplies before/after production-path terminal output plus focused coverage for the affected label derivation. Is this the best way to solve the issue? Yes. The PR fixes the presentation owner rather than renaming stored files or changing URI resolution, and its legacy fallback is constrained to the managed inbound naming contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against baeaca2ad4c1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
a1814ea to
c78c131
Compare
|
Merged via squash.
|
* origin/main: (57 commits) fix(media): fall back when providers return empty output (#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (#118692) test(state): reuse current agent database fixture (#118677) fix(scripts): bound check-file-utils git lookup (#111582) fix(slack): scope interactive conversation bindings safely (#118662) fix(agents): avoid false compaction after mid-turn precheck (#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (#118659) fix(doctor): audit every agent workspace (#111840) fix(release): skip unavailable Buzz on frozen candidates (#118670) fix(ui): surface onboarding and pairing clipboard failures (#118651) fix(config): stop plugin schemas rejecting the channel key core writes (#117992) test(memory): isolate wiki plugin fixtures (#118654) fix(line): clear default access token when removing account (#118055) feat: enable rich setup controls in custodian chat (#114631) test(ui): reuse responsive browser fixtures (#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (#118638) fix(xai): classify exhausted credits as billing (#118615) fix(otel): fail closed when configured TLS material is invalid (#118648) fix(cli): preserve gateway request errors in health JSON (#118645) ...
…ead of managed UUID suffix (openclaw#118628) * fix(ui): prefer persisted fileName and strip managed UUID suffix from attachment card labels * fix(ui): anchor managed UUID removal to terminal storage suffix * fix(ui): preserve dotted UUID-shaped attachment names --------- Co-authored-by: Peter Steinberger <[email protected]>
* origin/main: (57 commits) fix(media): fall back when providers return empty output (openclaw#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (openclaw#118692) test(state): reuse current agent database fixture (openclaw#118677) fix(scripts): bound check-file-utils git lookup (openclaw#111582) fix(slack): scope interactive conversation bindings safely (openclaw#118662) fix(agents): avoid false compaction after mid-turn precheck (openclaw#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (openclaw#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (openclaw#118659) fix(doctor): audit every agent workspace (openclaw#111840) fix(release): skip unavailable Buzz on frozen candidates (openclaw#118670) fix(ui): surface onboarding and pairing clipboard failures (openclaw#118651) fix(config): stop plugin schemas rejecting the channel key core writes (openclaw#117992) test(memory): isolate wiki plugin fixtures (openclaw#118654) fix(line): clear default access token when removing account (openclaw#118055) feat: enable rich setup controls in custodian chat (openclaw#114631) test(ui): reuse responsive browser fixtures (openclaw#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (openclaw#118638) fix(xai): classify exhausted credits as billing (openclaw#118615) fix(otel): fail closed when configured TLS material is invalid (openclaw#118648) fix(cli): preserve gateway request errors in health JSON (openclaw#118645) ...
What Problem This Solves
Fixes an issue where users viewing uploaded files in the Control UI chat history would see collision-safe managed storage basenames (such as
report---43007e90-2ade-43f2-a781-42b843e9eca3.pdf) as the attachment card label instead of the original upload filename (report.pdf). The canonical transcript already persists an authoritative__openclaw.media[].fileName, but the history-media projection dropped it before rendering, so the card fell back to the managed URI basename with its UUID suffix exposed.Closes #118621
Why This Change Was Made
Carry the optional canonical
fileNamethroughreadTranscriptMediaEntries()and prefer it for the attachment label inextractTranscriptAttachments(). For older transcript records that lack a persistedfileName, apply a narrowly scoped UUID-suffix restoration only tomedia://inbound/paths, removing only the terminal---<uuid>storage segment (the generated suffix the store appends immediately before the extension) so an original filename that itself contains a---<uuid>-shaped part is preserved. This is a UI projection-only repair: stored files, managed URIs, transcript identity, provider input, and attachment resolution are all left unchanged.User Impact
Users viewing uploaded documents (PDF/DOCX/PPTX/XLSX/TXT/etc.) in Control UI chat history now see the familiar original filename on each attachment card instead of an internal collision-safe identifier. Normal upload, storage, and retrieval behavior is unchanged; only the displayed label improves. Legacy transcripts without a persisted original name also get the managed UUID suffix removed from
media://inbound/labels.Evidence
pnpm exec tsx scripts/proof-attachment-uuid-label.mjs(loads production UI projection codeextractTranscriptAttachments/readTranscriptMediaEntriesand renders attachment labels from canonical persisted__openclaw.mediafacts)report.pdf,openclaw-attachment-test.docx); managed UUID suffix is not shownreport---<uuid>.pdf,openclaw-attachment-test---<uuid>.docx)Base commit (main):
8d1fe4f0910; fix commits:2bdb636065d(carry fileName + strip terminal UUID),c78c131acf9(anchor UUID removal to the terminal storage suffix per review, plus regression case)Before fix (main
db7c48478f8, predates the fix):After fix (
c78c131acf9, rebased onto8d1fe4f0910):Non-regression (unchanged on purpose, no false positives):
https://example.com/files/...---old.docxstays...---old.docx(not a managed inbound UUID), andmedia://inbound/plain-name.docxstaysplain-name.docx(no UUID to strip).The terminal-suffix anchor (
(?=\.[^/]*$|$)) removes only the final generated---<uuid>segment immediately before the extension or end of basename, so a legacy original name that itself contains a---<uuid>-shaped part (as in the last case above) is preserved while the managed storage suffix is still hidden.pnpm exec vitest run src/pages/chat/chat-history.media.test.ts- 11/11 passed (6 regression assertions including the terminal-suffix preservation case; the fix-asserting ones fail on unfixed main, pass after the fix)pnpm exec vitest run src/pages/chat/components/chat-message.test.ts- 159/159 passedpnpm exec oxfmt --check(changed files) - passedpnpm tsgo:ui- passedpnpm exec oxlint(changed files) - passedAI-assisted: Codex