Skip to content

fix: restore supported image pastes in chat - #154367

Merged
steipete merged 1 commit into
mainfrom
codex/fix-clipboard-image-header-parser
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-clipboard-image-header-parser

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes supported image data URL pastes failing before an attachment is added to chat.

User Impact

Supported pasted images reach the attachment flow reliably.

Why This Change Was Made

The clipboard parser now recognizes the image header separately from the payload. It retains the existing decoding, image-type and attachment-size checks.

Evidence

  • The existing paste regression failed during the ordinary Linux suite; all 79 existing tests across the four attachment, palette and composer suites pass locally on macOS with Node 24.19.0. No tests or assertions were removed.
  • Mapped checks and independent review passed.
  • The before/after screenshots below use the same small synthetic image to verify unchanged rendering. The existing regression test verifies the parser repair.

The full-suite benchmark was stopped after separate Chromium launch failures were traced to its temporary-directory setup. A full-suite pass is not claimed here.

Before: small synthetic image paste

After: small synthetic image paste

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 03:37
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 12:08 AM ET / 04:08 UTC (Revision 2).

ClawSweeper review

What this changes

The shared chat attachment parser separates an image data URL’s header from its payload while preserving decoding and attachment-size checks.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused repair candidate, current main retains the older parser, and no introduced correctness defect was found. The maintainer-authored PR is also protected from automated closure.

Priority: P2
Reviewed head: 9778a390b5064047124d568d80daeabf8a234c13

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable repair with existing boundary coverage and no actionable introduced defect; visual evidence is correctly limited to rendering parity.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies. Inspected screenshots show small-image composer rendering before and after; the reported 4 MiB parser recovery is supported by focused test claims, not demonstrated by those screenshots.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies. Inspected screenshots show small-image composer rendering before and after; the reported 4 MiB parser recovery is supported by focused test claims, not demonstrated by those screenshots.
Evidence reviewed 6 items Introduced change: The pinned merge-base-to-head diff changes only header matching and payload extraction. Image MIME matching, whitespace normalization, atob decoding, and downstream admission remain intact.
Current-main necessity: Fetched main still matches the entire payload in the regular expression. No merged fixing PR was established. Inspection of the supplied latest-release source blob failed, so release coverage remains unknown and no shipped-fix claim is made.
Existing boundary regression: The existing test dispatches a paste through the rendered chat textarea with a 4 MiB payload and verifies attachment size and exact payload preservation; neighboring cases reject malformed base64. The PR reports the existing Linux failure and 79 passing focused tests on macOS. These checks were inspected, not executed during this review.
Findings None None.
Security None None.

How this fits together

The Control UI converts pasted image data URLs into attachments shared by chat and new-session composers. Accepted images enter the existing attachment store and preview flow before submission.

flowchart LR
  A[Clipboard image data URL] --> B[Parse image header]
  B --> C[Decode base64 payload]
  C --> D{Attachment size accepted}
  D -->|Yes| E[Attachment store and preview]
  D -->|No| F[Rejection notice]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1. Total +1 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep image parsing in the shared attachment owner, avoiding a payload-wide regular-expression capture while retaining existing admission and decoding behavior.

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

No independently confirmed current-main reproduction was established here. The existing 4 MiB textarea-paste regression provides a concrete check, and the author reports its Linux failure, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: the patch makes a small change in the existing shared parser and preserves its accepted input and rejection checks; the platform-specific failure mechanism was not independently reproduced.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 99112ab00fe8.

Labels

Label justifications:

  • P2: This repairs a bounded image-paste failure without changing configuration, transport, or stored data.
  • 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 maintainer-author exemption applies. Inspected screenshots show small-image composer rendering before and after; the reported 4 MiB parser recovery is supported by focused test claims, not demonstrated by those screenshots.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The maintainer-author exemption applies. Inspected screenshots show small-image composer rendering before and after; the reported 4 MiB parser recovery is supported by focused test claims, not demonstrated by those screenshots.

Evidence

What I checked:

  • Introduced change: The pinned merge-base-to-head diff changes only header matching and payload extraction. Image MIME matching, whitespace normalization, atob decoding, and downstream admission remain intact. (ui/src/pages/chat/components/chat-attachments.ts:120, 9778a390b506)
  • Current-main necessity: Fetched main still matches the entire payload in the regular expression. No merged fixing PR was established. Inspection of the supplied latest-release source blob failed, so release coverage remains unknown and no shipped-fix claim is made. (ui/src/pages/chat/components/chat-attachments.ts:120, 99112ab00fe8)
  • Existing boundary regression: The existing test dispatches a paste through the rendered chat textarea with a 4 MiB payload and verifies attachment size and exact payload preservation; neighboring cases reject malformed base64. The PR reports the existing Linux failure and 79 passing focused tests on macOS. These checks were inspected, not executed during this review. (ui/src/pages/chat/chat-view.attachment-paste.test.ts:52, 9778a390b506)
  • Inspected visual evidence: Both downloaded PR screenshots show the same small synthetic image thumbnail in the composer. They support unchanged rendering, as the captured PR body explicitly states; they do not demonstrate recovery of the larger Linux failure. Captured context sourceRevision: 9280a137b9b01df732ef8850f00a7018626c7b1bd8acdfc628e98e581707ec54. (9778a390b506)
  • Related merged work and routing: The supplied GitHub context verifies feat(ui): paste images into command-palette sessions #153238 as merged command-palette image-paste work. File history also identifies recent attachment work by Vyctor H. Brzezowski and Joseph Krug. Exact introduction attribution remains unverified because blame and historical patch inspection encountered an unavailable object. (ui/src/pages/chat/components/chat-attachments.ts, 99112ab00fe8)
  • Review continuity: The previous completed review examined the same head and retained no findings or published rank-up moves. The current file comparison is empty; no prior concrete blocker needs to be raised again. (ui/src/pages/chat/components/chat-attachments.ts, 9778a390b506)

Likely related people:

  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Joseph Krug: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-21T03:45:21.521Z sha 9778a39 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 8c198a5 into main Sep 21, 2026
208 checks passed
@steipete
steipete deleted the codex/fix-clipboard-image-header-parser branch September 21, 2026 04:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot 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.

1 participant