Skip to content

fix: explain why chat won’t attach an empty file - #206402

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/error-copy-chat-recovery-b2
Nov 28, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/error-copy-chat-recovery-b2

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

When a chat attachment is empty, OpenClaw says to try again. The same empty file will fail every time, whether you chose it or an embedded app supplied it.

User Impact

Before: “Could not attach file. Try again.”

After: “OpenClaw can’t attach empty files.”

If you chose the file, you can attach a nonempty replacement without rebuilding your draft. If an app supplied it, the notice explains what failed without telling you to use a file picker. The app still receives a rejection; its message isn’t sent.

Why This Change Was Made

OpenClaw already checks for empty files before trying to read them. Only that notice changes. A genuine read failure keeps its existing message, and an oversized file still takes priority when a selection contains both oversized and empty files.

Skill in practice: Name the cause the system knows. Offer a next step only if the reader can take it: here the composer knows the file is empty, but not who chose it.

Evidence

In the real Control UI, a draft already contained text and an attached agenda.txt. Selecting a zero-byte meeting-notes.txt in the file picker showed the notice and left the text and original attachment intact. A nonempty replacement with the same name attached successfully. The synthetic Gateway received no send request until Send message, then received the draft and both files. Verified in Chromium at 390 × 800 and 1060 × 720. This proves the outgoing browser request, not delivery by a live Gateway or model.

The empty pasted-file regression failed on the base. Both the paste and embedded-app regressions failed on the earlier two-sentence wording. With the correction, the app test observed the same notice, a negative receipt, and no call to the send handler. All 45 tests in the two focused suites passed. The UI typecheck, touched-file lint and formatting, copy check, i18n baseline and verification, and diff check passed. The production Control UI build completed; its size report flagged largest CSS gzip (57.2 vs. 56.9 KiB), chat boot requests (21 vs. 20), and chat boot JS gzip (1306.2 vs. 1305.0 KiB).

Independent source review identified the embedded-app caller as a case where a file-picker instruction would be misleading. After the correction, the campaign coordinator checked the shared notice, the app regression, and the revised screenshots.

The four screenshots below show the same draft at 390 × 800 in the light theme. Before: 7857d5ae3a5a. After: reviewed source tree 1a80245aa523.

Comparison Before After
Clean The notice asks you to try again The notice identifies the empty file
Annotated Why retrying the same file won’t help Why the explanation works for both sources

Contributor: @vyctorbrzezowski

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

Chat asks to retry the empty file

Chat identifies the empty attachment

The generic retry notice is outlined above the retained draft

The empty-file explanation is outlined above the retained draft

roboclaw-bot and others added 2 commits November 27, 2026 05:14
Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 93c6368b-b472-433b-ae54-4981f914bffe
@clawsweeper

clawsweeper Bot commented Nov 27, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 27, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 27, 2026 05:17
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR replaces the generic retry notice for empty chat attachments with an explanation that OpenClaw cannot attach empty files.

Example: Select zero-byte meeting-notes.txt while a draft already contains agenda.txt.

  • Before: The notice says “Could not attach file. Try again.”
  • After: The notice says “OpenClaw can’t attach empty files.” while the draft and agenda.txt remain intact.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, minimal correction with inspected browser evidence and distinct paste/app regression coverage; required CI has not cleared.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots exercise the changed toast through the actual Control UI file picker with retained draft content; the body records Chromium replacement-file verification against a synthetic Gateway, while embedded-app rejection is supported by the focused production-owner regression.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An empty attachment produces retry advice even though retrying the same file cannot succeed.
Reason: The maintainer-authored direction improves a known error state with a minimal shared-owner change and preserves existing admission policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR makes empty-file rejection understandable through the existing shared owner, with no concrete introduced defect found; CI remains blocked.

Reviewed head: 7abe976bb609c29f7b5ecdaaf9f72d906f0f922c

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI’s shared attachment admission owner receives files from composer inputs and embedded apps, rejects invalid files before preparation, and emits a localized error toast.

flowchart TD
  A[Composer file inputs] --> C[Shared attachment admission]
  B[Embedded app content] --> C
  C --> D[Localized rejection toast]
  C --> E[Admitted attachment preparation]
  E --> F[Chat submission]
Loading

Technical review

Best possible solution:

Keep the correction in shared attachment admission and land it once the required CI gate is resolved.

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

Current-main source deterministically routes zero-byte files to the generic read-failure notice, and the supplied before screenshot shows that result; no target code was executed during this review.

Is this the best way to solve the issue?

The smallest complete fix is the selected translation-key change in the existing admission owner, which also serves embedded apps without suggesting an inappropriate file-picker action.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 288e52aab044.

Provenance checked

  • Empty-file admission and rejection notice keeps the original intent (8739432: Reject zero-byte files at intake instead of allowing the payload assembler to drop them silently after sending.)
  • Error-toast presentation and oversized-file precedence keeps the original intent (aeae6d1: Present attachment failures through an error toast and consolidate rejection feedback; the supplied provenance also records later toast expectation alignment.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduced diff changes the empty-file translation key, adds its English text, and updates the existing paste regression plus an embedded-app rejection regression. (ui/src/pages/chat/components/chat-attachment-admission.ts:85, 7abe976bb609)
  • Current main still needs the correction: Fetched main still selects chat.attachments.readFailed for empty files; oversized-file precedence and rejection behavior are otherwise identical. (ui/src/pages/chat/components/chat-attachment-admission.ts:85, 288e52aab044)
  • Original admission contract: Commit 8739432 established the shared admission funnel and rejected zero-byte files because the payload assembler otherwise silently dropped them after sending. (ui/src/pages/chat/components/chat-attachment-admission.ts, 8739432d4ce6)
  • Inspected browser proof: All four downloaded screenshots were inspected: clean and annotated before/after images show the corrected notice with retained draft text and agenda.txt. The body describes Chromium file-picker and replacement-file verification against a synthetic Gateway and explicitly limits its delivery claim. (7abe976bb609)
  • Required CI remains unresolved: The head’s baseline-ratchet check reports database-worker and database-dialect failures and cancellation; ci-gate rejects the failed lane. Detailed logs redirect to a blocked storage host, so neither PR causation nor an inherited failure was established. (7abe976bb609)
  • Related broader attachment work: fix(ui): keep named attachment errors beside the draft #180319 proposes persistent, named explanations for empty, oversized, and unreadable files; this PR supplies a narrower correction to the current toast.

PR surface

Source +1, Tests +22. Total +23 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 2 1 +1
Tests 2 26 4 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 28 5 +23

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve attribution of the database-ratchet failures and obtain a passing required CI gate.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 12:33 AM ET / 05:33 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit 23ea8a9 into main Nov 28, 2026
182 of 185 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the openclaw/error-copy-chat-recovery-b2 branch November 28, 2026 07:10
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
* fix: explain why chat won’t attach an empty file

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: explain why chat won’t attach an empty file

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 93c6368b-b472-433b-ae54-4981f914bffe

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

2 participants