Repository navigation
fix: explain why chat won’t attach an empty file - #206402
Conversation
Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 93c6368b-b472-433b-ae54-4981f914bffe
|
🦞👀 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: passed. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +22. Total +23 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 12:33 AM ET / 05:33 UTC. |
* 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) ...
* 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) ...
* 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) ...
* 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]>
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-bytemeeting-notes.txtin 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 tree1a80245aa523.Contributor: @vyctorbrzezowski
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by