Skip to content

fix(tui): apply model selection on blank submit - #49374

Merged
thdxr merged 3 commits into
v2from
blank-model-switch
Sep 16, 2026
Merged

thdxr merged 3 commits into
v2from
blank-model-switch

Conversation

@thdxr

@thdxr thdxr commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

User-reported; no linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Blank Enter now commits the composer selection before the queued-prompt action, then returns without sending an empty message or clearing the composer.

The submission flow shares selection preparation and failure/restoration handling, consolidates queue checks, and handles blank submission explicitly. Revert still finishes before optimistic prompt admission; model commits remain ordered after earlier admissions.

How did you verify your code works?

  • bun run check passed.
  • 78 existing tests passed, including real Prompt command-selection and compaction-ordering tests.
  • Fable used temporary full-app tests to compare eight scenarios against both the pre-refactor and refactored implementations: model/agent switching and queue promotion, unchanged selections, switch failure, blank queue/shell submissions, revert ordering, queued exit rejection, and home-session creation. All passed; temporary tests were removed.

Screenshots / recordings

None; submission behavior change with no layout changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

from OpenCode

@thdxr
thdxr enabled auto-merge (squash) September 16, 2026 19:13
@thdxr
thdxr merged commit 7df0935 into v2 Sep 16, 2026
14 of 15 checks passed
@thdxr
thdxr deleted the blank-model-switch branch September 16, 2026 19:32
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Apply the selected model on blank Enter and simplify shared prompt submission setup and recovery.\n\nfrom OpenCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant