anomalyco / anomalyco/opencode

[BUG] Lack of debounce/disabled state on prompt submit causes duplicate session creation on double Enter/click

Open
#46,844 2 comments 0 reactions 1 assignee View on GitHub

@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 Enter or 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
  1. Open OpenCode and start a new prompt.
  2. Type any prompt into the input field.
  3. Press Enter (or click the Send button).
  4. Notice the delay/lag before the UI responds.
  5. Quickly press Enter or click Send again during this delay window.
  6. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.