Repository navigation
[BUG] Autocomplete dropdown conflicts with permission dialog - visual overlap and keyboard event capture #5820
Description
Description
When the autocomplete dropdown (@ for files/agents or / for commands) is open and a permission request arrives (e.g., tool approval for bash/edit), there is a visual and functional conflict:
-
Visual conflict: The autocomplete dropdown (
zIndex={100}) visually overlaps and covers the permission options rendered inline in the messages area, making it impossible to see what permission is being requested. -
Keyboard conflict: Both components capture the same keys:
- Autocomplete:
escape,enter,tab,up,down - Permission dialog:
enter(accept once),a(always),d(deny),escape(reject)
- Autocomplete:
The autocomplete processes keyboard events first, so when both are active, the permission dialog cannot receive input correctly.
Steps to Reproduce
- Start typing a message with
@or/to open the autocomplete dropdown - While the dropdown is open, have the LLM trigger a tool that requires permission (e.g., bash command, file edit)
- Observe that:
- The permission request appears behind/under the autocomplete dropdown
- Keyboard shortcuts for accepting/denying the permission don't work as expected
Alternate scenario:
- Have the LLM running and generating content
- Start typing
@or/to open autocomplete - A permission request arrives mid-interaction
- Cannot see the permission options while autocomplete is open
Expected Behavior
When a permission request arrives:
- The autocomplete should close automatically (since the prompt is disabled anyway when
permissions().length > 0) - OR the permission UI should have higher visual priority (z-index)
- Keyboard events should be routed to the permission handler, not the autocomplete
Actual Behavior
- The autocomplete remains visible and covers the permission options
- Keyboard events are captured by the autocomplete, preventing permission responses
- User must manually dismiss autocomplete (if possible) to interact with permissions
Technical Analysis
Relevant code locations:
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx:420-439- Autocomplete haszIndex={100}and no logic to close when permissions arrivepackages/opencode/src/cli/cmd/tui/routes/session/index.tsx:197-218- Permission keyboard handler checks for dialogs but not autocomplete statepackages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1001- Prompt is disabled when permissions pending, but autocomplete isn't notifiedpackages/opencode/src/cli/cmd/tui/component/prompt/index.tsx:764- Autocomplete processesonKeyDownbefore other handlers
Proposed Solution
The simplest fix would be to close the autocomplete when permissions are pending:
- Pass a
disabledorhiddenprop toAutocompletecomponent - When
permissions().length > 0, set this prop totrue - In
Autocomplete, callhide()when this prop becomestrue
This aligns with the existing behavior where the prompt is already disabled during permission requests.
OpenCode version
Latest
Operating System
Any
Terminal
Any
Activity
github-actions commentedon Dec 19, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 19, 2025
Dax is reworking permissions stuff inclduing UI, this shoudl be fixed soon
anntnzrb commentedon Dec 19, 2025
Thanks for the quick response @rekram1-node! Good to know this is already being addressed in the permissions UI rework.
I'll keep an eye on the related issues (#3455, #4092) for updates. Feel free to close this if it's covered by the upcoming changes.
rekram1-node commentedon Dec 20, 2025
ill leave open and see once his changes land if this is still an issue or not