You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI: typing large amounts of text into the chat input causes severe lag #49635
Typing (or dictating) a large amount of text into the TUI chat input (the prompt box) makes the UI lag heavily and effectively stop responding as the buffer grows. Pasting large blobs is usually collapsed into a "[Pasted ~N lines]" summary, so this is most visible when typing or voice-dictating directly into the input.
Root cause found while profiling: mentionTriggerIndex runs on every keystroke (onContentChange → autocomplete onInput) and performs two full-buffer Intl.Segmenter passes per keystroke. Measured per-keystroke cost:
5 KB buffer: ~3.1 ms
20 KB: ~13 ms
100 KB: ~65 ms
The underlying opentui textarea is not the bottleneck (~0.2 ms/keystroke into a 20 KB buffer).
Waiting on PR #49634 which adds cheap raw-string gates so the display-aware scan only runs when an actual @ trigger needs resolving.
Plugins
None
OpenCode version
1.18.31
Steps to reproduce
Open the opencode TUI
Type or dictate a large amount of text into the chat input (tens of KB)
Observe keystroke latency climbing as the buffer grows until the UI appears frozen
Expected behavior
Keystroke latency stays roughly constant regardless of how much text is in the input box.
Activity
github-actions commentedon Sep 17, 2026
This issue might be related to existing issues. Please check:
PromptInputV2contenteditable DOM path rather than the TUI'smentionTriggerIndex/Intl.Segmenterpath; different root cause and component, but closely related user-facing behavior.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊