opencode
opencode copied to clipboard
[BUG]: UI becomes unresponsive when tool permission dialog appears
Description
When a tool call triggers a permission dialog (e.g., bash command, file edit), the UI becomes unresponsive. The input area seems to freeze and keyboard input is sluggish or ignored.
This appears related to #5820 (autocomplete/permission conflict) and #3846 (no response to user input), but is a distinct symptom focused on the permission dialog itself causing unresponsiveness.
Symptoms
- Input field becomes unresponsive when permission dialog appears
- Keyboard events are delayed or not processed
- UI may show visual artifacts or text appearing in wrong places
- Sometimes need to wait several seconds before input is accepted
Possible Causes (from code analysis)
-
Keyboard event conflicts:
permission.tsxhas its ownuseKeyboardhandler that may conflict with other handlers insession/index.tsx -
Diff rendering blocking: Large diffs in the permission preview (
EditBodycomponent) could block the main thread -
State synchronization: Permission state syncing via
useSyncmight be causing render blocking
Relevant Code Locations
-
packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx- Permission prompt component with keyboard handler -
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1024-1033- Permission rendering and prompt disable logic -
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx- Prompt component that gets disabled during permissions
OpenCode version
1.0.223
Steps to reproduce
- Start opencode
- Ask the agent to run a bash command or edit a file (with permission set to "ask")
- When the permission dialog appears, try to interact with the UI
- Observe sluggishness/unresponsiveness
Operating System
macOS
Terminal
Ghostty / iTerm2