Skip to content

fix(chat): repeated image paste and right-click menu failures - #1113

Merged
shanselman merged 2 commits into
openclaw:mainfrom
calebeden:calebeden-fix-repeat-image-paste
Aug 7, 2026
Merged

shanselman merged 2 commits into
openclaw:mainfrom
calebeden:calebeden-fix-repeat-image-paste

Conversation

@calebeden

@calebeden calebeden commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes issues where the chat composer stopped accepting Ctrl+V image pastes after the first attachment rerender and where its right-click editing menu could flicker, omit Paste, or become unavailable even when supported clipboard content existed.

Why This Change Was Made

The composer now keeps one stable image-paste delegate and reconnects it to each native text box created by Reactor. It also uses a persistent context menu with platform-standard Undo, Redo, Cut, Copy, Paste, and Select All commands, recalculating command and separator visibility whenever the menu opens. Paste reads the current clipboard contents when activated, routes bitmap content through the existing attachment pipeline, preserves native text paste, and handles clipboard COM failures without crashing the tray.

User Impact

Users can repeatedly paste images after attachment rerenders and can reliably use the full right-click editing menu. Paste appears only when the clipboard currently contains supported text or bitmap content, while other editing commands appear when applicable.

Evidence

  • The current PR-head recording below demonstrates repeated image paste, text paste, empty-clipboard visibility, and context-menu commands.
  • Regression coverage verifies stable paste-handler lifecycle wiring and executes the context-menu visibility projection for empty, full, paste-only, and selected-text states.
  • A local ordinary merge of current origin/main preserved merged fix(chat): correct native tool event correlation #1114 native-tool correlation behavior. a1d933a3 was an ancestor of validated candidate c9656524, and the PR's effective diff remained the same four composer/test files.

WinUI recording

PasteFix.under-10MB.mp4

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Validation

Validated local integration candidate c9656524 after merging current origin/main:

  • .\build.ps1 - passed.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj - passed 3,413, skipped 32, failed 0.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj - passed 2,208, failed 0.
  • Focused composer/context-menu filter - passed 3, failed 0.
  • dotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64 - passed.
  • Axe accessibility scans - passed 20, failed 0.
  • Reactor/native-tool UIA proof tests - passed 2, failed 0.
  • Rubber-duck review - no blockers.
  • Exact remote head 661827d3576a6fd43216e0dbb949dedc2f4cba8b - all active checks passed or skipped; merge state clean and mergeable before landing.

Real Behavior Proof

  • Environment tested: Windows 11 x64, isolated WinUI tray data.
  • Remote PR head: 661827d3576a6fd43216e0dbb949dedc2f4cba8b.
  • Validated local integration candidate: c9656524.
  • Existing recording: verified for remote PR head and linked above.
  • Integration compatibility proof: focused composer tests, Axe scans, and Reactor/UIA proof tests all passed against current main plus the unchanged four-file PR diff.
  • Not verified / blocked: isolated integration-candidate computer-use repetition entered onboarding instead of the seeded chat harness. Existing remote-head recording and current-main automated/UIA proof cover the changed behavior.

Security Impact

  • New permissions or capabilities? (Yes/No): No
  • Secrets or tokens handling changed? (Yes/No): No
  • New or changed network calls? (Yes/No): No
  • Command or tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes
  • Config or environment changes? (Yes/No): No
  • Migration needed? (Yes/No): No

Landing Result

Squash-merged unchanged exact head 661827d3576a6fd43216e0dbb949dedc2f4cba8b with --match-head-commit after its active dispatch check completed successfully. Merge commit: 89666df49eb9da0f684851be088181065ca4b993.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@calebeden
calebeden marked this pull request as draft August 6, 2026 21:16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@calebeden calebeden changed the title fix(chat): image paste stops working after first attachment fix(chat): repeated image paste and right-click menu failures Aug 6, 2026
@calebeden
calebeden marked this pull request as ready for review August 6, 2026 23:30
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 7, 2026, 2:41 PM ET / 18:41 UTC.

ClawSweeper review

What this changes

The PR reconnects image clipboard paste handling after chat-composer remounts and adds a state-aware native right-click editing menu.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

Keep open. Current main still gates the paste subscription behind a component-lifetime flag, so the reported remount failure remains relevant; merge requires inspectable current-head WinUI proof because the linked recording could not be retrieved in this review environment.

Priority: P2
Reviewed head: 661827d3576a6fd43216e0dbb949dedc2f4cba8b

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source-level fix is plausible and focused, but inspectable real-behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The PR supplies a current-head WinUI recording, but its attachment was unreachable during this review; body claims and unit tests do not independently prove the after-fix native UI behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR supplies a current-head WinUI recording, but its attachment was unreachable during this review; body claims and unit tests do not independently prove the after-fix native UI behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main source: Current main keeps the paste event subscription behind pasteHooked, which persists across component renders and prevents a replacement native text box from receiving the handler.
Current-main subscription site: The current control is subscribed only inside the one-time guard, matching the source-level image-paste remount failure described by the PR.
Branch scope: The PR head changes the Reactor composer, adds a pure context-menu state projection, expands tray tests, and links that projection into the test project.
Findings None None.
Security None None.

How this fits together

The WinUI tray chat composer accepts text and clipboard images, turns images into draft attachments, and sends the resulting draft into the chat workflow. Its native text box also supplies editing actions through the right-click menu.

flowchart LR
  Clipboard[Clipboard text or bitmap] --> Composer[Tray chat composer]
  Composer --> PasteChoice[Choose image or text paste]
  Composer --> EditMenu[Native editing menu]
  PasteChoice --> Attachments[Draft attachments]
  EditMenu --> DraftText[Draft text]
  Attachments --> ChatFlow[Chat submission flow]
  DraftText --> ChatFlow
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR supplies a current-head WinUI recording, but its attachment was unreachable during this review; body claims and unit tests do not independently prove the after-fix native UI behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The custom native menu changes editing and clipboard behavior across several WinUI states; the inaccessible recording leaves its real after-fix behavior unverified.
  • Resolve merge risk (P1) - PR-only blobs could not be retrieved from the partial clone, limiting source review to the supplied diff excerpts and current-main implementation.
  • Complete next step (P2) - The remaining merge blocker is contributor-supplied real WinUI proof, not a narrow automated repair.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +209/-33, tests +171/-0 The UI behavior change is accompanied by substantial focused regression coverage, but the native runtime flow still needs visible proof.
Files affected 4 files The change is scoped to the Reactor composer, a pure menu-state helper, and tray tests.

Merge-risk options

Maintainer options:

  1. Verify the native editing flow (recommended)
    Add an inspectable redacted current-head WinUI recording showing repeated image paste and all claimed context-menu clipboard states before merge.
  2. Accept local maintainer verification
    A maintainer may accept the risk after reproducing the same repeated-paste and context-menu states in an isolated WinUI run.

Technical review

Best possible solution:

Preserve the stable per-control paste lifecycle and state projection, then provide an accessible redacted current-head recording that shows repeated image paste and the empty, text, and bitmap clipboard menu states.

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

Yes for the repeated image-paste path: current main subscribes the native control only while pasteHooked is false, so a remounted control will not receive the handler. The context-menu portion still needs real WinUI verification.

Is this the best way to solve the issue?

Unclear. A stable delegate attached and detached per native control plus a pure visibility projection is a narrow maintainable approach, but the complete PR-only implementation could not be retrieved for final source verification.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2439d4371096.

Labels

Label justifications:

  • P2: This fixes a user-facing chat-composer reliability problem with limited blast radius.
  • merge-risk: 🚨 other: Replacing native editing-menu behavior can alter clipboard and command behavior across WinUI states that unit tests alone do not fully cover.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR supplies a current-head WinUI recording, but its attachment was unreachable during this review; body claims and unit tests do not independently prove the after-fix native UI behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main source: Current main keeps the paste event subscription behind pasteHooked, which persists across component renders and prevents a replacement native text box from receiving the handler. (src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs:602, 2439d4371096)
  • Current-main subscription site: The current control is subscribed only inside the one-time guard, matching the source-level image-paste remount failure described by the PR. (src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs:1113, 2439d4371096)
  • Branch scope: The PR head changes the Reactor composer, adds a pure context-menu state projection, expands tray tests, and links that projection into the test project. (661827d3576a)
  • Feature history: The current Reactor chat composer dates to the Reactor chat migration, with later theme and chat-maintenance work by the listed area contributors. (src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs:585, 9acafa606a4d)
  • Proof inspection limitation: The supplied GitHub attachment could not be downloaded because github.com DNS resolution failed. The partial clone also could not retrieve PR-only blobs, so this review relied on the supplied patch excerpts and current-main source. (661827d3576a)

Likely related people:

  • Karen: Introduced the Reactor chat surface and subsequently maintained its theme-resource integration. (role: Reactor chat feature contributor; confidence: high; commits: 9acafa606a4d, ff1901275a41; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs)
  • Caleb Eden: Authored a recent merged change in the same Reactor composer and the proposed branch commits. (role: Recent chat-area contributor; confidence: high; commits: d2de6150753b, 661827d3576a; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawReactorChatRoot.cs)

Rank-up moves

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

  • Attach or replace the recording with an accessible redacted current-head artifact that visibly exercises repeated image paste and context-menu states.
  • After updating the PR body, request a fresh review if one is not triggered automatically.

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 (4 earlier review cycles)
  • reviewed 2026-08-06T23:35:20.510Z sha 661827d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-07T15:54:28.264Z sha 661827d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-07T16:00:32.933Z sha 661827d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-07T16:08:54.970Z sha 661827d :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 7, 2026
@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 7, 2026
@shanselman
shanselman merged commit 89666df into openclaw:main Aug 7, 2026
19 checks passed
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 7, 2026
@calebeden
calebeden deleted the calebeden-fix-repeat-image-paste branch August 7, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants