You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
when (mistakenly) sending empty message the session stop with the error: text cannot be empty. #7493
When (mistakenly) sending an empty message the session stops with the error: Text cannot be empty.
Better behaviour:
A. Ignoring and continuing with the session
B. Blocking empty messages from being sent.
If it sounds like a better UX, I will happily contribute the fix myself.
Plugins
No response
OpenCode version
1.1.7
Steps to reproduce
start a session, give it some tasks that require few steps, then few spaces and send
I reproduced this locally in TUI. Sending a whitespace-only message creates a user text part that reaches the provider unchanged, which then returns a 400 (text cannot be empty) and ends that turn.
I’m planning to fix it by:
blocking/ignoring whitespace-only submits in TUI before request dispatch
adding a backend guard so empty-after-trim text parts can’t reach providers from any client path
Activity
phongndo commentedon Feb 23, 2026
I’d like to work on this issue. I’ll investigate and open a PR.
phongndo commentedon Feb 23, 2026
Quick update after digging in:
I reproduced this locally in TUI. Sending a whitespace-only message creates a user text part that reaches the provider unchanged, which then returns a 400 (
text cannot be empty) and ends that turn.I’m planning to fix it by:
If this plan is good, I will link a pr.
phongndo commentedon Feb 23, 2026
Implemented in #14767.
This fixes the empty-message bug by:
Message cannot be empty)400(Prompt cannot be empty)Also added regression tests for prompt schema + session route validation.
Fixes #7493.
@avifenesh could you confirm this matches the desired behavior?
github-actions commentedon Apr 25, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.