Description
When pasting text into the chat input and pressing Enter, the pasted text disappears instead of being sent. Typing normally (without pasting) works fine.
Steps to Reproduce
- Copy any text
- Paste it into the chat input
- Press Enter immediately after pasting
- The text vanishes
Root Cause
contenteditable div race condition: paste event and keydown (Enter) fire in parallel, DOM not updated yet when Enter checks for content, submit aborted.
Environment
-OpenCode 1.16.2 (npm: opencode-ai)
-Kubuntu Linux, KDE Konsole
Suggested Fix
-Read DOM directly on Enter instead of stale state
-Add isPasting flag
-Use requestAnimationFrame before content check
[Full report: /tmp/opencode_bug_report.md]
Description
When pasting text into the chat input and pressing Enter, the pasted text disappears instead of being sent. Typing normally (without pasting) works fine.
Steps to Reproduce
Root Cause
contenteditablediv race condition:pasteevent andkeydown(Enter) fire in parallel, DOM not updated yet when Enter checks for content, submit aborted.Environment
-OpenCode 1.16.2 (npm: opencode-ai)
-Kubuntu Linux, KDE Konsole
Suggested Fix
-Read DOM directly on Enter instead of stale state
-Add isPasting flag
-Use requestAnimationFrame before content check
[Full report: /tmp/opencode_bug_report.md]