Repository navigation
Description
Out of scope
Reconnect DOM continuity (#1013), shortcut redesign or changes to the data/state architecture.
Context
Package audit on 2026-10-14 found the following concrete root cause. The audit searched all-state brain-kit issue titles/bodies and read the closest candidate comments. Current open issues were rechecked before filing. Audit reproductions are observations, not passing full-suite or mutation receipts.
Composer executes application shortcuts during IME composition
Classification: correctness. Severity: medium (unintended message submission / cancellation). Confidence: high for source dispatch and the reproduced Chromium native-composition path; OS candidate UI and other-engine ordering remain unmeasured.
Evidence
- (
onKeyDown,packages/ui-kit/src/chrome/Composer.tsx:207-220) checks streaming Escape and ordinary Enter, prevents the native default, then callsonStoporonSend. It never checksevent.nativeEvent.isComposing, composition lifecycle state, or a composing key-code fallback. - (
onKeyDown={onKeyDown},packages/ui-kit/src/chrome/Composer.tsx:318) attaches that handler directly to the textarea. - Contrast demonstrating an existing intentional composition guard within the same package: (
keys,packages/ui-kit/src/chrome/Overlay.tsx:141-153) suppresses composing Escape; (registerOverlay,packages/ui-kit/src/internal/overlay-stack.ts:9-18) also rejects composing Escape. - Consumer trace checked only to establish impact, without expanding the audit ownership: (
onSend,packages/ui-react/src/components/chat/composer.tsx:855-861) can run a slash command orhandleSubmitand has no event/composition argument; (onKeyDown,packages/ui-react/src/components/chat/composer-view.tsx:113-123) is a bubbling wrapper handler that handles palette movement/recall, not a capture-phase composition guard. It cannot undo the kit callback already dispatched.
Concrete failing scenario and impact
Mount Composer with a nonempty editable draft and an onSend callback. While an input-method candidate is active, an Enter keydown with isComposing=true reaches the textarea to accept the candidate. The kit calls preventDefault() and onSend anyway. In the application this can submit the partial draft or execute a matching slash command. During a running turn, composing Escape intended to cancel an IME candidate instead calls onStop, cancelling the agent's work.
This follows directly from the event branches; it does not rely on layout or speculative caller behavior. The Chromium native-browser path is reproduced below. Any fallback for engines that end composition just before Enter needs its own measured ordering before inclusion in the complete fix.
Acceptance and verification sketch
- A native IME candidate confirmation/cancellation does not invoke Send/Stop or execute a slash command, and does not suppress the input method's own default solely because of the application shortcut.
- Ordinary Enter still sends once; Shift+Enter inserts a newline; ordinary streaming Escape still stops once.
- Add callback-level regression controls with composing keyboard events, then real Chromium native IME/CDP input coverage for the actual Composer consumer; include any supported engine fallback justified by measured event ordering.
- Show a failing-first callback/browser assertion and a guard-removal mutation that restores unintended submission/cancellation. Do not use a JSX text predicate as runtime proof.
Tracker coverage check
Searched all 989 snapshot issues, all states, titles and bodies, using IME, isComposing, compositionend, compositionstart, Japanese, Chinese, Korean, input method, and broader composition/Composer terms. Closest candidates:
- ui-react: keep layout, focus, selection, IME and scroll intact through repeated connection drops #1013 (closed): reconnect continuity preserves a native composition, focus, selection and DOM identity through transport drops. Read current body and comments. Its tests/acceptance cover remaining composed through loss and normal commit, not distinguishing candidate-confirmation Enter or candidate-dismissal Escape from Send/Stop.
- ui-react: persist the draft and work context locally in an account partition #1014 (closed): persisted per-account draft/work context, not composing shortcut dispatch.
- ui-react: on auth expiry stop capture, save the work context, unmount protected views and restore after same-account sign-in #1018 (closed): auth-expiry work preservation, not textarea shortcuts.
- Epic: preserve layout, content and input across offline transitions #578 (open epic): offline continuity scope; does not own ordinary online Composer IME shortcut semantics.
No existing specific issue covering this root cause was found. This is suitable for an ordinary public issue; no security-advisory routing indicated.
Scope
Distinguish input-method candidate keys from application Send/Stop shortcuts in the actual Composer consumer.
Acceptance criteria
- Composing Enter/Escape does not invoke Send/Stop or suppress the input method default for the app shortcut.
- Ordinary Enter sends once, Shift+Enter inserts a newline and ordinary streaming Escape stops once.
- Native/browser event ordering is measured, including any supported composing-key fallback; slash-command submission is covered.
- A named behavioral test fails on the current code for the reported reason and passes after the correction; a restored semantic mutation demonstrates that the guard is effective. For pure unused-code cleanup, production-path proof and the caller/export inventory replace a fabricated behavior mutation.
- Implementation updates relevant documentation/citations and supplies the required focused and hosted proof.
Verification
Use deterministic, keyless, offline fixtures and the real operation/runtime at the implicated boundary. Preserve the repository network guards. Source-only or operation-mirroring audit probes do not replace real browser/native-runtime proof where the behavior depends on it.
bun run test packages/ui-kit
bun run typecheck
bun run lint
bun run check:pr --base origin/mainFor UI/render changes, run the relevant pinned browser/layout/accessibility project and inspect rendered output; retain named failing-first and restored mutation receipts. Existing audit module-load failures establish no behavioral failure or green suite. Any missing original-failure reproduction or policy choice is identified by the needs label and must be resolved before marking agent-ready.
Contract impact
Published behavior correction needs a changeset. Preserve existing CLI/MCP/wire/configuration and public signatures. Reassess the integration contract against the final implementation; any contract change needs the relevant documentation, label and CONTRACT: commit prefix, and a breaking change needs a maintainer ruling.
Unscheduled standalone repair. Severity in the audit describes impact, not a release commitment or assigned priority. Related issues are references unless their full epic outcome explicitly owns this repair.
Reproduction evidence — 2026-10-14
The initial synthetic-event receipt at main 4af7b2f20a43d23260c2ee5e3bac3896aee971bd observed sends=1, stops=1 and defaultPrevented=true. A later isolated native-browser follow-up at main 5cf1d548f7bd3a314eb36394dc5db0268db97da6 resolves the original-failure prerequisite: the existing keyless real-host continuity fixture mounts the actual AppShell/ChatPage/Composer consumer in Chromium 152.0.7977.82, Playwright 1.63.0 and lockfile-pinned React 19.3.0. CDP Input.imeSetComposition starts Chromium composition; Playwright keyboard input emits trusted composing keys rather than page-created KeyboardEvents.
With an enabled, nonempty Odysseus draft in a new conversation, trusted Enter (isTrusted=true, isComposing=true, keyCode=13) during that composition sends one real chat_message frame and clears the draft. The named assertion composing Enter must not send a chat_message fails with expected 0, received 1. During a scripted running turn, trusted composing Escape (keyCode=27) sends one cancel frame. Composing Enter on /search opens a dialog (0 before, 1 after) and clears the command draft. Ordinary controls show one chat_message for Enter, no chat_message and a newline for Shift+Enter, and one cancel for ordinary streaming Escape.
A pending-attachment scene was an initial negative control: its send-disabled Composer dispatched no message. The enabled-draft case above removes that condition and fails for the reported reason. The probe preserves the test network preload and the browser origin allowlist, uses only loopback/keyless fictional fixtures, and changes no implementation. Initial disk-quota/truncated-file and probe-recorder failures were tooling errors, not defect receipts; the final runtime assertion is independent of them.
Chromium CDP proves a native browser composition path with trusted composing keys. It does not measure an OS input-method candidate window, Safari/Firefox ordering, or a fallback for engines that end composition before Enter. The implementation must justify any fallback it adds and retain native/browser coverage; these platform limits do not negate the reproduced composing-key defect. Native default-prevention was not reliably measured by this follow-up's target listener; retain the earlier synthetic-event receipt without interpreting the follow-up logger's potentially pre-delegation value.
Updated 2026-10-14: folded native Chromium full-consumer Send/Stop/slash-command observations and ordinary-key controls into the brief. Original-failure reproduction is sufficient; no unresolved product/design/access prerequisite was found. No correction, complete suite, or mutation-after-fix result is claimed.
Activity
schlessera commentedon Oct 14, 2026
2026-10-14 triage at main
4af7b2f20a43d23260c2ee5e3bac3896aee971bd: verified the named source anchors and scope. Priority p2 means wanted but unscheduled; the audit severity does not create a release commitment. The body now states the remaining repro prerequisite and the evidence/ruling that resolves it. Agent readiness remains absent.schlessera commentedon Oct 14, 2026
2026-10-14 browser follow-up: after correcting the isolated fixture listener, T3 preview mounted the unmodified kit Composer at main
4af7b2f20a43d23260c2ee5e3bac3896aee971bdwith pinned React/ReactDOM 19.3.0 and lucide-react 0.460.0. A compositionstart followed by composing Enter/Escape yielded sends=1, stops=1 and defaultPrevented=true for both. This is real browser/React callback evidence from synthetic events; it is not a native IME candidate-ordering or full app-consumer receipt. Folded the result and its limits into the body, corrected the Overlay keys anchor, and retained needs: repro for native ordering. No implementation changed.schlessera commentedon Oct 14, 2026
2026-10-14 reproduction follow-up at main
5cf1d548f7bd3a314eb36394dc5db0268db97da6: reproduced in the actual consumer, using the existing offline/keyless real-host AppShell/ChatPage continuity fixture, Chromium 152.0.7977.82, Playwright 1.63.0 and React 19.3.0. This differs from the prior page-created KeyboardEvent probe:Input.imeSetCompositioncreates browser composition and Playwright keyboard input produces trusted composing Enter/Escape.Observed:
isTrusted=true,isComposing=true, keyCode=13, one outgoingchat_message, draft cleared. Named assertioncomposing Enter must not send a chat_messagefails: expected 0, received 1.cancel./search+ composing Enter: dialog count 0 → 1, draft cleared.Command in the isolated inspected worktree (temporary probe inserted into the selected existing case; already-built isolated outputs reused on follow-ups):
Final receipt: 0 pass, 1 fail, 14 filtered, 11 assertions, exit 1; failure is the message-count assertion above, not module loading. Network guards and browser origin restrictions remained active. No implementation changed.
The initial disk-quota/truncated-file and intermediate probe setup errors prove no defect; the final bounded runtime run independently reaches the expected behavioral assertion. The target-level default-prevention logger may observe the event before React delegation; it is not treated as a reliable final-default receipt. OS candidate UI and non-Chromium fallback ordering remain unmeasured, explicitly stated in the body; the native Chromium path nevertheless supplies the missing original-failure proof. Folded these corrections into the body, removed
needs: reproand addedagent-ready; no other prerequisites, assignment, milestone or epic changes.schlessera commentedon Oct 23, 2026
2026-10-24 restructuring: attached to #2576. Its outcome includes "Enter never submits half-composed IME text", #2579 explicitly assigns Composer IME handling to this issue, and the two together now cover the whole outcome.