Skip to content

TUI can auto-submit whitespace prompt, creating “empty user message” and breaking Claude/OpenAI-compatible proxies #8679

@breeze0015

Description

@breeze0015

Description

OpenCode sometimes sends a “user sent an empty message” even when I did not manually submit anything. This can also trigger upstream errors (e.g., Claude/Bedrock: messages: text content blocks must be non-empty) when using OpenAI-compatible proxy layers that translate requests to Anthropic format.

Plugins

No response

OpenCode version

1.1.21

Steps to reproduce

  1. Start OpenCode TUI with a whitespace-only prompt, for example:
    • opencode --prompt " "
    • or opencode --prompt "\n"
  2. Observe that OpenCode auto-submits the prompt on startup and a user message is created even though it contains only whitespace.

Screenshot and/or share link

https://opncd.ai/share/32IIf93w

Operating System

Windows 10

Terminal

opencode-desktop-windows-x64.exe

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions