Skip to content

fix(browser): Space key from Control UI rejected as empty press - #150317

Merged
shakkernerd merged 3 commits into
openclaw:mainfrom
DonnieFi:fix/150298-browser-space-key
Sep 17, 2026
Merged

shakkernerd merged 3 commits into
openclaw:mainfrom
DonnieFi:fix/150298-browser-space-key

Conversation

@DonnieFi

@DonnieFi DonnieFi commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150298

What Problem This Solves

Typing into a page through the Control UI Browser panel drops spaces. The panel forwards KeyboardEvent.key, whose Space value is the literal " ". The shared browser action normalizer trims that value to an empty string and rejects the press with press requires key, so text such as a b c becomes abc in the page.

User Impact

Space presses from the Browser panel now reach the focused page field. The same normalization applies to direct browser action requests and supported nested batches. Named Space and case-insensitive space inputs are accepted, including named chords such as Ctrl+Space.

Existing letter case, keyboard aliases, literal Plus and Control++ handling remain intact. Whitespace-padded Plus inputs retain their trim-first meaning, and other empty or blank keys remain invalid. This change does not add raw Ctrl+ chord support.

Why This Change Was Made

The existing press normalizer is the shared boundary before Playwright and Chrome MCP dispatch. Mapping the exact whole Space character to its canonical key name before generic trimming preserves the intended input without changing normalization of other route fields. Keeping the correction here also covers callers that do not originate in the Browser panel.

Evidence

Current-head CI is green. The affected job includes all 41 normalization cases and 3 batch-contract cases, covering Space aliases and existing key/Plus/empty-input controls. CI run, affected test job.

The full Control UI was exercised on Linux with Node 24.19.0 and Playwright 1.63.0. Its existing E2E harness supplies the mocked Gateway transport; real Browser panel keyboard events pass through the production browser route dispatcher and Playwright to a real Chromium input. The panel uses its supported screenshot transport. One identical production UI build serves the actual baseline and fixed backend source checkouts.

Both runs clicked and focused the remote field, then pressed a, Space, b, Space, c. The baseline produced abc and rejected both Space requests with status 400. The fixed head produced a b c, accepted all five requests with status 200, and delivered both Space keydown events. Both runs had zero page errors and identical UI and remote-field geometry. The screenshots and focused recording below are from this current-head interaction; the earlier route-only capture is superseded.

Visual evidence

Open preview

Before After
Before: real Browser panel drops both Space presses and the page field reads abc After: real Browser panel preserves both Space presses and the page field reads a b c

Exact-head Browser panel keyboard interaction

openclaw-150317-after.webm

Visual verification

  • Baseline: 75ba5e3
  • Exact head: 29454443f55e5f816d7a8981658fa45669cce456
  • Scenario: Open the Control UI Browser panel, click the real remote input, and press a, Space, b, Space, c through the panel keyboard handler.
  • Runtime/build: Linux; Node v24.19.0; Playwright 1.63.0; shared production Control UI build browser-space-29454443f55e5f816d7a8981658fa45669cce456; index SHA256 10a7a916199fa20fd5374583b80a4ab594a96ce8108e4afaf11726007f81fe2d
  • Input in both runs: a, Space, b, Space, c — five actual Browser panel press requests
  • Baseline result: abc; two Space requests rejected with status 400
  • Fixed result: a b c; all five requests status 200
  • Remote keydown events: 3 before; 5 after, including both literal spaces
  • Focus and geometry: Remote field focus asserted; both target viewports 480x871 with identical field bounds
  • Page errors: 0 before and 0 after
  • Actual baseline and fixed Git identities verified before capture
  • Identical production UI source and dependencies reused for both runs
  • Mock Gateway transport bridges real UI input to production browser routes and Playwright
  • Supported screenshot fallback uses real page screenshots
  • Both PNGs inspected at full resolution; both complete recordings inspected via frame sequence and final full-resolution frames
  • No private content or credentials; only a synthetic local page and factual evidence overlay

Map KeyboardEvent.key " " to Space before string trim so Browser panel
and batch press actions deliver spaces instead of failing with press requires key.

Closes openclaw#150298
@clawsweeper

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

@DonnieFi

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 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:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:49 PM ET / September 17, 2026, 01:49 UTC (Revision 6).

ClawSweeper review

What this changes

Preserves Space keystrokes from the Control UI Browser panel by normalizing them before whitespace trimming, with regression coverage for Space, Plus, and empty inputs.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main and v2026.9.4 still reject literal Space presses. The focused fix preserves Plus-key handling, has convincing before/after evidence, and has no actionable review findings.

Priority: P2
Reviewed head: 29454443f55e5f816d7a8981658fa45669cce456

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with strong runtime evidence and regression coverage for neighboring keyboard behavior.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.
Evidence reviewed 7 items Verified introduced change: The pinned base-to-head diff matches the supplied introduction evidence. Only keyboard normalization and its tests change; the exact literal space bypasses trimming, while other inputs retain the existing chord normalization.
Current main still contains the defect: Current main passes press keys through the trimming string coercer before checking for an empty key. The Control UI forwards event.key unchanged, so a literal Space still reaches this rejection path.
Latest release remains affected: The release source also trims press keys before its empty-key check. Local release-object inspection was unavailable; the read-only GitHub contents endpoint supplied the source successfully.
Findings None None.
Security None None.

How this fits together

The browser action normalizer translates Control UI and direct browser requests into actions dispatched through Playwright or Chrome MCP. Its keyboard handling determines which keystrokes reach the focused page.

flowchart LR
  A[Browser panel keyboard input] --> C[Browser action normalizer]
  B[Direct and batch requests] --> C
  C --> D{Valid key?}
  D -->|Yes| E[Playwright or Chrome MCP]
  D -->|No| F[Request error]
  E --> G[Focused page field]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +14, Tests +16. Total +30 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 5 +14
Tests 1 16 0 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 35 5 +30

Review metrics

None.

Technical review

Best possible solution:

Keep keyboard normalization at the shared browser request boundary so every supported caller delivers Space while preserving existing key contracts.

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

Yes: current-main source proves that the panel's literal Space becomes empty and is rejected; the supplied baseline recording observations and inspected screenshots corroborate the failure. This review did not execute repository code.

Is this the best way to solve the issue?

Yes: correcting the shared normalizer covers UI, direct, and nested requests without duplicating frontend policy or changing existing Plus-key semantics.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.

Label justifications:

  • P2: Repairs ordinary typing in the Browser panel with a focused change and limited blast radius.
  • 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): Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Browser panel screenshots include remote field values and key-event diagnostics, supported by captured HTTP results through the production normalizer and real Chromium on Linux; the fixed head delivers both spaces.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • shakkernerd: 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 (5 earlier review cycles)
  • reviewed 2026-09-16T21:36:53.227Z sha 34ebbf0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T21:42:39.789Z sha 34ebbf0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T21:58:12.693Z sha 34ebbf0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T22:24:30.348Z sha 961a020 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T22:48:49.522Z sha 2945444 :: needs maintainer review before merge. :: none

@DonnieFi

Copy link
Copy Markdown
Contributor Author

Playwright real-behavior proof added for literal Space through production POST /act → Chromium page field.

  • HEAD 34ebbf046e2fd7d543044afd1ec2af163d4b8baf
  • Field value: hello → hello → hello world
  • Page keydown diag includes {\"key\":\" \",\"code\":\"Space\",\"keyCode\":32}
  • Screenshots: before / after Space / after hello world (embedded in PR body)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 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:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
Only the exact KeyboardEvent.key " " bypasses trim; chord inputs still
trim first so " + " and "+ " normalize to "+" again. Prefer Ctrl+Space
for Space chords.
@DonnieFi

Copy link
Copy Markdown
Contributor Author

Addressed reviewer request-changes:

  • Exact " " → Space only (whole-value special case before trim)
  • Restored trim-first Plus contract: " + " / "+ " → "+"
  • Chord spelling uses named Ctrl+Space → Control+Space
  • Regression tests added

HEAD 961a02026587c0ce6f67d6633add51b55f8380a4

@clawsweeper re-review

@clawsweeper

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

@DonnieFi

Copy link
Copy Markdown
Contributor Author

Merged main to pick up style(ci): format ci-changed-scope test (#150330). Prior check-lint failed on that untouched file on a stale base.

HEAD 29454443f55e5f816d7a8981658fa45669cce456

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 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:

@shakkernerd shakkernerd self-assigned this Sep 17, 2026
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 17, 2026
@shakkernerd
shakkernerd merged commit 903d079 into openclaw:main Sep 17, 2026
104 checks passed
@shakkernerd

Copy link
Copy Markdown
Contributor

Fixed: Space key presses from the Browser panel now reach the page instead of being rejected as empty input.

With thanks to @DonnieFi.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…claw#150317)

Preserve literal Space keyboard input from the Control UI Browser panel through the shared browser action normalizer.

Refs openclaw#150298.
Reviewed-by: @shakkernerd
@DonnieFi
DonnieFi deleted the fix/150298-browser-space-key branch September 17, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser 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: 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.

[Bug]: Control UI Browser panel drops the Space key when typing into a page (regression in 2026.9.4)

2 participants