Repository navigation
fix(browser): accept common keyboard aliases - #130401
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 26, 2026, 6:00 PM ET / 22:00 UTC. ClawSweeper reviewWhat this changesThe PR normalizes five common keyboard aliases before browser dispatch, documents the accepted names, and adds regression coverage for both browser backends. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The shared-boundary alias repair is coherent, but the prior blocker remains: this normal PR still edits release-owned Priority: P2 Review scores
Verification
How this fits togetherBrowser tool and CLI actions enter the browser plugin's shared request normalizer before dispatch to Playwright or Chrome MCP. The backend then performs the browser operation and returns its result to the caller. flowchart LR
A[Tool or CLI request] --> B[Browser action route]
B --> C[Shared request normalizer]
C --> D{Keyboard press}
D -->|Alias| E[Canonical key name]
D -->|Other action| F[Existing action]
E --> G[Playwright or Chrome MCP]
F --> G
G --> H[Browser result]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +92, Docs +3. Total +111 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Remove the changelog entry, retain the browser repair and PR-body release context, then recheck the exact head against current main and green CI. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main execution was available in this checkout; the route-to-normalizer-to-backend path is source-reproducible and the PR body reports isolated after-fix runs. Is this the best way to solve the issue? Yes for the keyboard behavior: normalizing at the shared action boundary covers both supported backends and nested batches without duplicating backend policy. The changelog edit is not part of that solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 99a2434f7b89. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Disposition of the latest substantive review: The changelog-removal recommendation is intentionally skipped: explicit maintainer direction requires this PR's one-line user-facing changelog closeout, using the repository's supported allowance. No version, tag, release, or publication is changed. The production increase (+19/-3, net +16) implements the finite five-alias capability and model guidance at the shared owner. Existing string coercion has no alias policy or redundant helper to absorb it. One I personally rechecked the combined normalizer: main's exact select values, inlined kind validation, and removed obsolete helper remain intact. I also directly inspected the installed Playwright 1.62.1 and Chrome MCP 1.8.0 keyboard parsers/dispatch contracts, plus Codex's The refreshed combined proof passes 166 tests across six keyboard/select suites, 15 real Playwright cases, and 13 real Chrome MCP cases through authenticated production HTTP |
|
Merged via squash.
|
* origin/main: (275 commits) fix(ai): require explicit compatible-provider endpoints (#130453) test(control-ui): guard the hand-mirrored theme --bg copies (#130444) fix(onboard): preserve the saved skills package manager (#130438) improve(worker): diagnose admission-deadline failures and widen daemon revalidation budget (#130435) fix(plugins): align diffs external install metadata (#130362) refactor(models): consolidate config normalization (#130439) fix(browser): accept common keyboard aliases (#130401) fix(release): refresh IMAP plugin baselines (#130351) fix(tests): type sticky model agent fixtures (#130441) fix(qa): track current Slack progress cards (#130354) feat(ui): refine the mobile composer (#130308) fix(ui): clarify gateway disconnect status in tab title (#130364) test(qa): await gateway startup before network probes (#130353) fix(qa): run Buzz profile scenarios with pooled credentials (#130316) fix(crabbox): keep the setup failure reason and name its phase (#130425) fix: dashboard tools target the wrong Gateway after admission (#130112) fix(ui): distinguish inherited model defaults from session pins (#120805) feat(feishu): let agents resend received stickers (#130374) refactor(models): prepare selection policy once (#130413) fix(ui): make dashboard side panels enter split view (#130426) ... # Conflicts: # test/scripts/docker-build-helper.test.ts
* fix(browser): accept common keyboard aliases * docs(browser): note keyboard alias repair
Fixes #130208. Thanks @geekforlife for the reproduction.
What Problem This Solves
Fixes an issue where browser automation using common keyboard names such as
Escfails instead of dispatching a key, while the tool schema gives the model no accepted-name guidance. The same request fails from the CLI, independently of the model.Why This Change Was Made
Normalize the five documented aliases (
Esc,Return,Del,Ctrl,Cmd) once at the shared browser action boundary, before Playwright or Chrome MCP dispatch. Nested batches use the same normalizer. Preserve printable-key case, literal+chords, unknown names, and backend-specific keys such as Playwright'sControlOrMeta.Backend-only changes would duplicate policy; schema-only guidance would leave CLI aliases broken.
Describe the contract in both nested and flattened tool arguments and the CLI docs. Shorten existing tab-reference prose without removing accepted references: after the actual OpenAI normalization and JSON projection, schemas remain 4,995 bytes (default) and 4,915 bytes (tab-bound). Codex strips parameter descriptions above 5,000 bytes, so the regression test checks the real projection rather than the smaller raw schema.
Maintainer authorization explicitly permits this focused repair despite the issue's automated triage hold; its labels are unchanged. AI-assisted implementation and review.
User Impact
Common keyboard aliases work through browser tool, CLI, and supported batch paths. Canonical names and existing key semantics remain unchanged. No configuration, dependencies, protocol, authentication, or persistent state changes.
Evidence
Verified head:
1dd4dbd22865a5096d535f3d853b4af7146da9e4(SSH-signed). Exact-head full CI and Workflow Sanity passed, including production types, test types, andopenclaw/ci-gate. The normal merge of mainde790ddc87e6e65688d2883f8674099fd665ac90preserves #130410's exact select-option values and inlined action-kind validation while retaining the shared keyboard aliases. Both conflicting files were resolved and the combined behavior was reverified./act: before the fix,Escreturns 500 with no DOM key event whileEscapereturns 200 with anEscapekeydown. Afterward both produce the same successful event.+,ControlOrMeta, nested batches, and unknown-key failure without an event.parseKeyandpress_key, the OpenClaw Codex schema projection, and Codex'sjson_schema.rsdescription-compaction contract.mailauth,mailparser,imapflow), with derivative IMAP typing errors and no browser diagnostics. IMAP sources are unchanged from main and outside this diff; shared dependencies were not modified or errors hidden. Both complete hosted typechecks now pass on this exact head, closing that environmental gap. Earlier local validation caught and corrected a test descriptor typing error and an over-limit test file; the two press requests share the full dispatch assertion without dropping coverage.Focused command:
Production LOC: +19/-3 (net +16); tests: +107/-15 (net +92, including reused dispatch assertions); docs/changelog: +3/-0. The finite alias table adds one shared conversion, with no duplicated backend policy or new production helper/export.
The maintainer-authorized one-line Unreleased changelog entry credits the reporter. This closeout uses the repository's supported per-PR changelog allowance; no release version, tag, or publication changes are included.
Latest ClawSweeper review disposition (reviewed
9eabdaf): changelog removal is intentionally skipped under the explicit maintainer closeout authorization above. The requested current-main and Codex checks were completed directly: main's normalizer remains alias-pass-through, its select-value repair is preserved by the merge, and Codex'scodex-rs/tools/src/json_schema.rs:196-253,473-600confirms normalization before the 5,000-byte description-compaction threshold. The actual pipeline regression and fresh six-suite/browser evidence above close that source-access gap. The production increase is accepted for the finite alias capability: existing string coercion does not implement key aliases, no redundant key-normalization path exists to absorb it, and deleting independent action validation would lose behavior. One table plus the existing owner's inline conversion is smaller and clearer than backend duplication or a general key validator; main's unrelated obsolete action-kind helper stays deleted.Review suggestion intentionally not implemented: exhaustive unknown-key validation or a shared accepted-name rejection hint. The backends accept different key sets, so imposing one validator would reject existing valid inputs or duplicate dependency policy. The schema now supplies corrective guidance; existing backend errors and broader error-redaction behavior remain unchanged.
Broader error handling/redaction in #130209 remains deferred and is not part of this repair.
Follow-up identified during dependency inspection: Playwright's existing invalid modifier-chord error path lacks the cleanup used by Chrome MCP. This patch does not claim to repair that separate dependency behavior.