Skip to content

fix(browser): enable paste into agent browser panels - #148451

Merged
steipete merged 3 commits into
mainfrom
codex/mac-browser-paste
Sep 14, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/mac-browser-paste

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes paste doing nothing in Agent browser panels and Browser dashboards, including login fields in the macOS app. WebKit treated the streamed page as a noneditable canvas, so its context menu did not offer Paste.

User Impact

Users can paste plain text with ⌘V/Ctrl+V or right-click Paste into the remote field, preserving its cursor and selection. Paste waits for the remote click; failed or superseded focus attempts cannot send text to the previous field. Passwords, multiline text, Unicode, and fields inside cross-origin frames work. Native Mac tabs keep WebKit's normal editing behavior. Chrome MCP existing-session profiles show an unsupported-paste error; managed browser profiles support it.

Why This Change Was Made

An empty editable overlay lets the host deliver native paste events. The browser input owner consumes the event and sends text through the existing guarded browser action path using native text insertion. Clipboard text never enters the local textarea, does not update the remote system clipboard, and is omitted from error messages. No page-evaluation permission or new model-facing tool is needed.

Includes the one-line CI prerequisite from #148403 (thanks @vincentkoc): remove a duplicate database-worker test registration that otherwise makes current main fail preflight before tests run.

Evidence

  • Real Developer ID-signed DashboardWebView hosting the production browser panel: native Paste reaches multiline/Unicode text and a cross-origin password field, leaves the local input empty, and enables native context-menu Paste. Synthetic screenshots below show the same form before and after.
  • Delaying the remote click by 600 ms reproduced paste reaching the previous field; the repaired flow waits and inserts into the intended field.
  • Browser UI suite: 269 tests passed; regressions demonstrated the original missing handler, click-ordering failure, and settled-failure case before their fixes.
  • Browser backend: 92 focused tests passed, including the registered /act route against real Chromium with page evaluation disabled.
  • The actual CI shard planner failed before the duplicate registration was removed and succeeds after it; coverage and the duplicate-detection guard are preserved.
  • Independent review: no remaining actionable findings (P0–P2). Typechecks, repository guards, dead-export checks, and final UI/backend/style lint all passed. Exact-head CI passed. The native proof uses an isolated synthetic fixture, not a live bank login.

Before: native paste leaves the remote field empty

After: native paste reaches multiline and Unicode text

After: native paste reaches a cross-origin password field

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui extensions: browser size: L maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete
steipete marked this pull request as ready for review September 14, 2026 18:30
@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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 3:08 PM ET / 19:08 UTC (Revision 3).

ClawSweeper review

What this changes

Enables plain-text paste into streamed browser panels, preserves remote click ordering, sanitizes paste errors, adds regression coverage and documentation, and removes a duplicate test registration.

Merge readiness

✅ Ready for maintainer review

The fix remains useful: current main and the latest release lack panel paste handling. No actionable introduced defect was found, and the inspected native proof supports the changed behavior.

Priority: P2
Reviewed head: df6d4dd71e4bded3bdfb856dc5841b9b9b66c15f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing native proof, meaningful regression coverage, and no blocking correctness findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The inspected native-panel before/after screenshots show multiline Unicode and framed password input reaching the remote fields through insertText. The supplied signed DashboardWebView run exercises the changed UI entrypoint; Chromium route coverage and click-race regressions provide supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The inspected native-panel before/after screenshots show multiline Unicode and framed password input reaching the remote fields through insertText. The supplied signed DashboardWebView run exercises the changed UI entrypoint; Chromium route coverage and click-race regressions provide supplemental validation.
Evidence reviewed 9 items Introduced scope and continuity: Inspected the merge-base-to-head changes at the pinned head. The previous completed review covered this same head and recorded no findings; the input controller is also unchanged from the first reviewed head. Endpoint drift and the stale test merge were not treated as introduced changes.
Current-main and release necessity: Current main still focuses the noneditable viewport and forwards keyboard events without a paste handler. Inspection of v2026.9.4 showed the same behavior. No verified merged replacement was established.
Release comparison: The latest supplied release retains direct key forwarding and has no panel paste handler.
Findings None None.
Security None None.

How this fits together

The Control UI displays a Gateway-controlled browser as a streamed page. Local input passes through the browser plugin’s guarded action route to the focused field in the remote browser.

flowchart LR
  A[Native paste event] --> B[Browser panel input]
  C[Remote click completion] --> B
  B --> D{Current tab and connection?}
  D -->|Yes| E[Guarded browser action]
  E --> F[Focused remote field]
  D -->|No| G[Discard stale input]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +162, Tests +418, Docs +2. Total +582 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 14 178 16 +162
Tests 6 421 3 +418
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 601 19 +582

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +162 net lines; tests +419 net lines Production growth implements native paste delivery and click ordering; most added coverage protects observable input and failure behavior.

Technical review

Best possible solution:

Keep paste in the existing browser input and guarded action owners, with native Mac tabs retaining their normal editing behavior.

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

Yes: current main lacks a paste handler and focuses a noneditable viewport; the supplied native before/after fixture demonstrates the symptom. No runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes: native text insertion preserves the remote selection and frame without page evaluation or clipboard synchronization, while reusing existing routing and guards.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs paste in an existing browser panel workflow with a bounded UI and browser-plugin scope.
  • 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 inspected native-panel before/after screenshots show multiline Unicode and framed password input reaching the remote fields through insertText. The supplied signed DashboardWebView run exercises the changed UI entrypoint; Chromium route coverage and click-race regressions provide supplemental validation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The inspected native-panel before/after screenshots show multiline Unicode and framed password input reaching the remote fields through insertText. The supplied signed DashboardWebView run exercises the changed UI entrypoint; Chromium route coverage and click-race regressions provide supplemental validation.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The inspected native-panel before/after screenshots show multiline Unicode and framed password input reaching the remote fields through insertText. The supplied signed DashboardWebView run exercises the changed UI entrypoint; Chromium route coverage and click-race regressions provide supplemental validation.

Evidence

What I checked:

  • Introduced scope and continuity: Inspected the merge-base-to-head changes at the pinned head. The previous completed review covered this same head and recorded no findings; the input controller is also unchanged from the first reviewed head. Endpoint drift and the stale test merge were not treated as introduced changes. (ui/src/components/browser/browser-panel-controller-input.ts:113, df6d4dd71e4b)
  • Current-main and release necessity: Current main still focuses the noneditable viewport and forwards keyboard events without a paste handler. Inspection of v2026.9.4 showed the same behavior. No verified merged replacement was established. (ui/src/components/browser/browser-panel-controller-input.ts:109, cc01fd8aaf04)
  • Release comparison: The latest supplied release retains direct key forwarding and has no panel paste handler. (ui/src/components/browser/browser-panel-controller-input.ts:163, 3a9d69db306c)
  • Native behavior proof: Inspected all three prepared images linked in the captured PR body: the before field is empty; the after text field contains multiline Unicode text with 32 received characters; the cross-origin password fixture shows 24 received characters. The after images identify the remote insertText action. The body describes a Developer ID-signed DashboardWebView running the production panel with synthetic data. (df6d4dd71e4b)
  • Guarded native insertion: The new operation calls Playwright keyboard insertion through the existing guarded interaction owner, preserving navigation and current-authority checks. Insertion errors are sanitized. This direct Playwright call and the Chromium regression establish the relevant dependency contract; there is no Codex dependency signal. (extensions/browser/src/browser/pw-tools-core.interactions.actions.ts:226, df6d4dd71e4b)
  • Dependency insertion contract: Inspected Playwright v1.63.0, matching the browser plugin dependency: keyboard insertion delegates to native sendText, and Chromium sends Input.insertText without changing the system clipboard. The tag resolves to the recorded dependency SHA. (packages/playwright-core/src/server/chromium/crInput.ts:88, 1b025d7e20a0)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • zhangguiping-xydt: 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 (2 earlier review cycles)
  • reviewed 2026-09-14T18:38:44.415Z sha 97e99c6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T18:51:38.257Z sha df6d4dd :: needs maintainer review before merge. :: none

Reuse the one-line prerequisite from #148403 so CI can validate browser paste. Preserve the single wizard recovery registration and the duplicate-detection guard.

Co-authored-by: Vincent Koc <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final head includes lint-only cleanup and the one-line CI prerequisite credited to #148403. Native screenshots and regression evidence remain in the PR body.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 24a845b into main Sep 14, 2026
160 of 162 checks passed
@steipete
steipete deleted the codex/mac-browser-paste branch September 14, 2026 19:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
* fix(browser): enable paste into agent browser panels

* refactor(browser): finish input ownership cleanup

* fix(ci): remove duplicate test routing prerequisite

Reuse the one-line prerequisite from openclaw#148403 so CI can validate browser paste. Preserve the single wizard recovery registration and the duplicate-detection guard.

Co-authored-by: Vincent Koc <[email protected]>

---------

Co-authored-by: Vincent Koc <[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 docs Improvements or additions to documentation extensions: browser 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: L 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