Skip to content

fix: desktop keyboard pastes local clipboard text - #141986

Merged
steipete merged 1 commit into
mainfrom
codex/webvnc-native-paste
Sep 8, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/webvnc-native-paste

Conversation

@steipete

@steipete steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Closes #141981
Related: #141378

What Problem This Solves

Fixes an issue where users pasting local text into the Control UI Desktop Keyboard field would send a remote paste shortcut instead of the clipboard contents. A live macOS reproduction pasted a 32-character string but inserted only v.

Why This Change Was Made

The Keyboard textarea now permits the browser's native paste and sends the resulting text through the existing noVNC encoder. It temporarily releases and restores held modifiers around literal text, tracks physical modifier releases after focus moves, and clears stale bookkeeping on blur, reset, control loss, or connection replacement. Direct desktop-canvas shortcuts and provider authorization are unchanged.

User Impact

Command+V on macOS and Ctrl+V on Windows/Linux insert local clipboard text through Keyboard, without leaving remote modifiers stuck. Keyboard input remains disabled until connected control is ready. The usage note documents this distinction from remote desktop shortcuts.

Evidence

  • Mac and Windows shortcut regressions failed on the original implementation because native paste default was prevented.
  • Independent review caught a focus-transition edge case; its canvas/toolbar regressions failed before the follow-up repair.
  • Final candidate: 72 focused tests passed (60 client/panel and 12 real-noVNC browser cases), full changed-file checks passed, and the UI build passed its existing bundle budgets.
  • Independent review is clean through P2.
  • Live Chrome → WebVNC → macOS: the original 32-character paste inserted v; the repaired bundle inserted the complete WebVNC paste 0123456789 AaBbCcDd. Normal macOS sign-in using pasted saved credentials also succeeded, with no password or lock-policy changes.
  • Before/after images show the synthetic app field and Desktop controls only; browser account chrome and machine URLs are excluded. The before image preserves the original failed-paste result.

The local checks used the existing ordinary checkout because this linked worktree's external dependency symlink is rejected by the typecheck boundary guard. The touched source bytes were verified identical; no guard was bypassed. CI will validate the PR head.

Before: the original paste inserted only v

After: the complete 32-character clipboard text reaches the app

@clawsweeper

clawsweeper Bot commented Sep 8, 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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 3:54 AM ET / 07:54 UTC.

ClawSweeper review

What this changes

The Desktop Keyboard field permits local clipboard paste, sends literal text without held modifiers, clears stale modifier tracking, and documents the workflow.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix for behavior still broken on current main. No blocking correctness or security findings remain, the supplied live proof supports the repair, and the previous draft blocker is resolved.

Priority: P2
Reviewed head: 283f655553cbad9d2ded275854574a47e21f2821

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported repair with directly visible live proof and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The supplied Chrome → WebVNC → macOS run exercises the changed Keyboard text path, and inspected before/after images show v replaced by the complete pasted string in the remote application; scripted noVNC tests supplement modifier and lifecycle coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The supplied Chrome → WebVNC → macOS run exercises the changed Keyboard text path, and inspected before/after images show v replaced by the complete pasted string in the remote application; scripted noVNC tests supplement modifier and lifecycle coverage.
Evidence reviewed 8 items Current main still prevents native paste: The fetched main implementation forwards every keyboard event and calls preventDefault, including the local paste shortcut. This PR's central repair is still necessary.
Latest release retains the same paste defect: The v2026.9.2 source also unconditionally forwards and prevents keyboard events; that release does not contain this repair.
Repair stays within the existing input boundary: The shortcut exception permits browser paste, input processing temporarily releases tracked modifiers, and connection changes clear tracking. DesktopClient continues using its existing noVNC encoder; the handoff exposes a handle only after connection readiness. No Codex runtime contract is involved.
Findings None None.
Security None None.

How this fits together

The Control UI Desktop panel sends keyboard input to a connected remote desktop through noVNC. Its Keyboard field translates local text entry into remote key events while the existing connection owner gates control readiness.

flowchart LR
  A[Local clipboard] --> B[Desktop Keyboard field]
  B --> C{Connected control available}
  C -->|No| D[Input disabled]
  C -->|Yes| E[Release modifiers and send text]
  E --> F[noVNC keyboard encoder]
  F --> G[Remote desktop field]
  E --> H[Restore held modifiers]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +65, Tests +186, Docs +2. Total +253 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 71 6 +65
Tests 2 186 0 +186
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 259 6 +253

Review metrics

Metric Value Why it matters
Production versus regression coverage production +65 net lines; tests +186 net lines Production growth implements modifier lifecycle tracking; the added tests cover platform shortcuts and stale-state transitions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #141981
Summary: This PR owns the proposed clipboard repair; the earlier readiness repair addresses a separate prerequisite.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep local paste in the Keyboard field on the existing noVNC text path, preserving direct canvas shortcuts and connected-control gating.

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

Yes: take connected desktop control, choose Keyboard, and paste local text. Current-main source prevents the browser paste default, matching the supplied macOS reproduction; this review did not execute that flow.

Is this the best way to solve the issue?

Yes: the repair lets the browser produce clipboard text and reuses the existing encoder, with lifecycle cleanup and focused regression coverage.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs a reproducible clipboard-entry defect limited to the Desktop Keyboard workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The supplied Chrome → WebVNC → macOS run exercises the changed Keyboard text path, and inspected before/after images show v replaced by the complete pasted string in the remote application; scripted noVNC tests supplement modifier and lifecycle coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Chrome → WebVNC → macOS run exercises the changed Keyboard text path, and inspected before/after images show v replaced by the complete pasted string in the remote application; scripted noVNC tests supplement modifier and lifecycle coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied Chrome → WebVNC → macOS run exercises the changed Keyboard text path, and inspected before/after images show v replaced by the complete pasted string in the remote application; scripted noVNC tests supplement modifier and lifecycle coverage.

Evidence

What I checked:

  • Current main still prevents native paste: The fetched main implementation forwards every keyboard event and calls preventDefault, including the local paste shortcut. This PR's central repair is still necessary. (ui/src/components/desktop/desktop-mobile-keyboard.ts:36, d637fe729a37)
  • Latest release retains the same paste defect: The v2026.9.2 source also unconditionally forwards and prevents keyboard events; that release does not contain this repair. (ui/src/components/desktop/desktop-mobile-keyboard.ts:36, 3928bad9badf)
  • Repair stays within the existing input boundary: The shortcut exception permits browser paste, input processing temporarily releases tracked modifiers, and connection changes clear tracking. DesktopClient continues using its existing noVNC encoder; the handoff exposes a handle only after connection readiness. No Codex runtime contract is involved. (ui/src/components/desktop/desktop-mobile-keyboard.ts:61, 283f655553cb)
  • Dependency keyboard contract inspected: OpenClaw's DesktopClient imports @novnc/novnc, pinned to 1.7.0. Upstream keyboard handling stops canvas events, suppresses duplicate releases, and releases held keys on window blur or ungrab, supporting the patch's capture listener and cleanup behavior. The upstream tag resolves to the recorded commit. (core/input/keyboard.js, 63107bd06d9e)
  • Live before/after proof inspected: The captured PR body, sourceRevision 5714e0a4df6327479f00b247e563921585ca28cf46bc032c1a8b5fc806edbdcc, describes Chrome → WebVNC → macOS using the repaired bundle. Locally inspected proof-image-1.png shows only v; proof-image-2.png shows the complete WebVNC paste 0123456789 AaBbCcDd text in the remote application. These images directly demonstrate the claimed visible result. (283f655553cb)
  • Focused regression coverage: The added browser cases check left/right Mac and Windows modifiers and physical releases after canvas or toolbar focus changes. Client cases cover blur, reset, replacement, and view-only transitions. Browser tests use real noVNC with a scripted socket and synthetic paste input, so they supplement the live proof. Tests were inspected, not executed in this read-only review. (ui/src/e2e/desktop-keyboard.e2e.test.ts:56, 283f655553cb)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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-08T07:38:03.471Z sha 283f655 :: needs changes before merge. :: none

@steipete
steipete marked this pull request as ready for review September 8, 2026 07:48
@steipete
steipete merged commit d5e6183 into main Sep 8, 2026
184 checks passed
@steipete
steipete deleted the codex/webvnc-native-paste branch September 8, 2026 08:10
@steipete

steipete commented Sep 8, 2026

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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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: M 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.

[Bug]: Desktop Keyboard sends paste shortcut instead of clipboard text

1 participant