Skip to content

The agent that grows with you

fix(desktop): extend stale-flag self-heal and keyCode 229 guard to the edit composer

Teknium587788405a7e
diff --git a/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx b/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx
index a9b4fd05164..c54e9ec6f6c 100644
--- a/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx
@@ -650,10 +650,23 @@ export const UserEditComposer: FC<UserEditComposerProps> = ({ cwd, gateway, sess
)
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ // Self-heal a stale composition flag (same recovery as the main composer's
+ // handleEditorKeyDown, #44135): compositionend can be missed, and a wedged
+ // composingRef would swallow every Enter until the edit composer remounts.
+ if (composingRef.current && !event.nativeEvent.isComposing) {
+ composingRef.current = false
+ }
+
if (composingRef.current || event.nativeEvent.isComposing) {
return
}
+ // IME commit Enter still carrying keyCode 229 (VK_PROCESSKEY) after
+ // compositionend — same guard as the main composer.
+ if (event.key === 'Enter' && event.keyCode === 229) {
+ return
+ }
+
if (trigger && triggerItems.length > 0) {
if (event.key === 'ArrowDown') {
event.preventDefault()