anomalyco / anomalyco/opencode

Prompt text is lost when the composer store is empty but the DOM editor still holds it

Open
#48,528 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Sep 11, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Submitting a prompt can silently lose the text the user typed.

The prompt composer keeps its text in two places: the DOM editor element and the store-backed prompt state. When the store is empty but the DOM editor still holds text (for example after a navigation or state reset), createPromptSubmit sees text.trim().length === 0 and returns early without sending anything. The typed message is lost and the user has to retype it.

Plugins

n/a

OpenCode version

latest dev

Steps to reproduce
  1. Type a message in the composer so the DOM editor contains text but the store-backed prompt state is empty.
  2. Press Enter to submit.
  3. Nothing is sent and the typed text is discarded.
Screenshot and/or share link

n/a

Operating System

n/a (all)

Terminal

n/a

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.