anomalyco / anomalyco/opencode
[BUG] Lack of debounce/disabled state on prompt submit causes duplicate session creation on double Enter/click
@Brendonovich is already working on this.
Since Sep 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When sending a prompt (either by pressing Enter or clicking the Send button), there is an input latency/delay where the web UI does not immediately provide visual feedback (no loading state, spinner, or prompt clearing).
If the user presses Enter or clicks Send a second time during this delay window, the prompt is dispatched twice, resulting in two separate, concurrent sessions being created with the identical prompt.
Expected Behavior
- Submitting a prompt should immediately clear the input box and disable the submit trigger (debouncing/disabling the input field and Send button).
- Immediate visual feedback (e.g., loading indicator/spinner) should indicate that the session creation is in progress.
- Subsequent presses of
Enteror clicks during dispatch should be ignored to prevent race conditions or duplicate session initialization.
Actual Behavior
The input remains active and editable during network/initialization latency. Submitting again fires a second API call, creating two separate sessions running the same prompt in parallel.
Environment
- OpenCode Version: 1.18.25
- OS: Linux
- Interface: Web UI
- Model / Provider: Gemini / Claude
Additional Context
This appears to be caused by a lack of client-side debouncing and optimistic UI state locking on prompt dispatch. Related issues involving input lag and missing submit feedback:
- Missing double-submit protection on async actions
- Delayed feedback on prompt submission prior to stream initialization
Plugins
No response
OpenCode version
1.18.25
Steps to reproduce
- Open OpenCode and start a new prompt.
- Type any prompt into the input field.
- Press
Enter(or click the Send button). - Notice the delay/lag before the UI responds.
- Quickly press
Enteror click Send again during this delay window. - Observe that two distinct sessions are generated, both processing the same prompt concurrently.
Screenshot and/or share link
No response
Operating System
Linux
Terminal
Kitty
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.