Repository navigation
fix(ui): keep Custodian drafts when Enter confirms IME input - #199638
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe Custodian composer reuses shared IME handling so Enter can confirm composed text without submitting the draft. Example: Compose 检查配置 in Ask OpenClaw and press Enter to confirm it.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current Custodian input bug with a focused change and no actionable findings; required checks were still running at the last successful GitHub read. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Custodian surface translates browser input into session actions, which submit drafts through the existing session store to the Gateway's openclaw.chat method. flowchart LR
A[Browser composition events] --> B[Custodian composer]
B --> C[Shared IME helper]
C --> D[Retained draft]
B --> E[Session send action]
E --> F[Gateway openclaw.chat]
Technical reviewBest possible solution: Merge the existing shared-helper wiring once required checks complete successfully. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both reported event paths, and supplied baseline/candidate Gateway receipts demonstrate the failure and repair; no target code was executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete repair using the existing IME owner, with no competing state or timing policy and preserved send admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b03fd2fed062. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +13, Tests 0. Total +13 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 15, 2026, 1:37 PM ET / 18:37 UTC (Revision 3). |
|
Added the requested launched-Control-UI proof to the PR body for unchanged head @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Validated head Real entry-point before / afterAll proof ran on the host through ocx, with a task-owned loopback Gateway, isolated HOME/state/workspace/profile, production Control UI assets built from each revision, and Playwright. The Gateway ran from TypeScript through Baseline: Chromium 156: two independent runs on baseline and two on candidate. Each run used the full Composition used CDP
Counts exclude the initial no-message welcome request. Every user-request payload retained the exact CJK text, and its matching real Gateway response had The attached inspected screenshots are same-frame crops of the actual application: baseline shows the instruction already in the transcript and an empty composer; candidate shows the CJK text still in the composer. Only synthetic data is visible. Additional engine and contract boundariesWebKit 27.2: one complete baseline and candidate run passed the same request/draft/control assertions against the real Gateway. This is a scripted composition-metadata supplement, not physical-IME evidence. It used the harness-only Sensitive composer: the current wizard always sends a step, so that composer has no live route; its unit case covers only the UI contract. No sensitive-field runtime, credential or setup-flow claim is made. No physical OS IME or native Safari claim is made. Failed screenshot-helper attempts are retained separately; they are not counted as successful rounds. Standalone capture used the supplied driver's Playwright screenshot path because the repository helper requires Vitest worker state. Fonts/layout were settled, capture was bounded, and the viewport/crops came from one frame. Regression, types and packaging
Control UI gzipOfficial
This is below the assigned 600 B ceiling; no budget baseline was changed. Served gzip can vary with generated asset hashes; no timing/performance-win claim is made. Scope and creditHost-execution check: the PR diff contains only the Custodian surface and its existing page test; no manifest, lockfile, workspace, npmrc, scripts, patches or hooks changed. The fix reuses shared IME helpers, with no new state, timing policy, copy, auth or setup behavior. Production +15/-2; tests +30/-30 (net 0), no allocation file. The new 44-line standalone fixture was removed; its distinct input regressions were folded into existing send/context cases, and repeated rich-wizard headers now use the existing reply constructor without changing their fields or assertions. Worktrunk and commit hooks were disabled; packing skipped lifecycle scripts. A proof-driver-only module loader hook applied the WebKit preference above. No Docker resources were used. Reverting this change restores the prior keyboard handling; it does not migrate state or alter Gateway contracts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override: Control UI gzip growth within the bug-loop allowance. The only red job is CI hash-normalized gzip, base -> this head:
The maintainer rule for bug fixes allows up to 600 B of real Control UI gzip growth (chat boot plus startup, summed) with this override comment. All other CI jobs passed with no cancellations; exact-head review is ready (5/6). Behavior proof, inspected before/after screenshots and Gateway request counts: #199638 (comment). |
|
Landed in 7acc315. Thanks @zhangguiping-xydt. |
…w#199638) fix(ui): keep Ask OpenClaw drafts when Enter confirms IME input In Ask OpenClaw (the Custodian), the composer checked only `event.isComposing`, so an Enter that confirms Chinese or Japanese IME input and arrives as keyCode 229 or right after `compositionend` (the Safari/WebKit order) submitted the unfinished instruction and cleared the draft. The composer now uses the shared `ui/src/lib/ime.ts` guard, as the chat composer and the earlier fixes openclaw#195983 and openclaw#196151 do. The setup screen's sensitive composer gets the same guard; the current wizard always sends a step there, so that path has no live route and only its unit contract is covered. No new text. Control UI gzip grows by +416 B (startup + chat boot), within the bug-fix allowance; override receipt on the PR. Evidence: Control UI served from source by an isolated loopback Gateway; Playwright Chromium composing CJK text through CDP, twice per side, plus one WebKit 27.2 run per side (harness-only PushAPIEnabled=false). Base: the confirming Enter (keyCode 229, and Enter right after compositionend) sends the unfinished text and clears the draft; this change keeps the draft, and a following plain Enter sends it once. Gateway request counts confirm both. Plain Enter and Shift+Enter behave the same on both. Unit: three cases fail on base, 30 pass here. Screenshots and receipts: openclaw#199638 (comment). Thanks @zhangguiping-xydt. Co-authored-by: Ayaan Zaidi <[email protected]>




What Problem This Solves
Confirming CJK IME input in Ask OpenClaw can submit an unfinished instruction and clear the draft. The composer checked only
event.isComposing, missing keyCode 229 and an Enter delivered immediately aftercompositionendwith composition flags cleared.User Impact
IME confirmation keeps the instruction editable. A following ordinary Enter sends it once; Shift+Enter still inserts a newline. No input text, copy, provider selection, auth or setup behavior changes.
Why This Change Was Made
Reuse
isComposingKeyboardEvent,recordCompositionEndandclearCompositionEndfrom the shared IME owner, as in #195983 and #196151. Composition tracking stays input-local and uses the existing timing policy; key-up and blur clear it. No new state, renderer, listener convention or timing policy.Sensitive composer boundary: the current wizard always sends a step, so that composer has no live route; its unit case covers only the UI contract. The contributor's harmless shared-helper wiring to that field is retained; no sensitive-field runtime claim is made.
Evidence
Validated head:
d99b4c9f39b3bb0c6ce3cc87df13d5e4019b472b.Real-Gateway before/after receipts and four inspected screenshots.
isComposing=false, as keyCode 229 or Enter immediately after compositionend. Baseline sent one acknowledged user request and cleared the draft; candidate sent zero and retained it. After key-up, ordinary Enter sent exactly once. Ordinary Enter and native Shift+Enter controls matched both sides.openclaw.chatrequest ids with successful responses from the actual Gateway, excluding welcome requests. A local OpenAI-compatible fixture provided immediate valid model responses; no Gateway response or component state was mocked, and no real provider/account credentials were used.Page.overrideSetting PushAPIEnabled=false; production settings are unchanged. No physical OS IME or native Safari claim.custodian-page.test.tsproduced three intended baseline failures and 27 passes; candidate passed 30/30. Sensitive input is contract-only coverage, not live setup proof. Matching test typecheck, production UI typecheck and focused formatting passed.ocx build --dtsand offline packed CLI/version/help plus candidate Control UI index smoke passed. The package smoke reused installed dependencies; no fresh dependency-install claim.All final execution was on the host through ocx. The diff touches only the surface and its existing page test, with no package, lockfile, workspace, npmrc, scripts, patches or Git-hook changes.
Control UI Gzip
Official hash-normalized production metrics on the same host/toolchain: startup JS +0 B, chat boot JS +137 B, startup/chat CSS +0 B. Summed growth: +137 B, below the assigned 600 B ceiling. No budget baseline was changed and no timing/performance-win claim is made.
Scope and Credit
Production +15/-2; tests +30/-30 (net 0), no allocation record. The new standalone composer fixture was removed; distinct regressions now extend existing send/context cases. Three repeated rich-wizard headers reuse the existing reply constructor without changing fields or assertions.
The original human commit by zhangguiping-xydt is retained. The follow-up only consolidates tests.
Merge Risk
Two-way door: reverting restores prior keyboard handling. No configuration, schema, persistent-state or Gateway-contract change. Blast radius is the Custodian composer's Enter/IME handling; ordinary Enter and Shift+Enter controls were exercised on both revisions.