Skip to content

Fixed model combo not becoming active with blocking startup dialog - #100

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/model-combo-not-populated-with-blocking-dialog
Apr 29, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/model-combo-not-populated-with-blocking-dialog

Conversation

@oleg68

@oleg68 oleg68 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When launching with --continue/--resume, Claude may show a "Resuming session" choice dialog before the input prompt is ready
  • discoverModels() was triggered immediately on READY, sent /model to PTY, but Claude couldn't process it until the dialog was dismissed
  • Discovery timed out (4.8 s), MAX_MODEL_DISCOVERY_ATTEMPTS=1 prevented retry → model combo stayed disabled for the whole session
  • Fix: pollScreenState() now defers discoverModels() while any choice menu is visible on screen or shown to the user; discovery starts cleanly after the dialog is dismissed

Test plan

  • Start session with Continue last session on a project with long history (triggers "Resuming…" dialog)
  • Confirm the dialog is shown and can be answered
  • After dismissing, verify model combo becomes active
  • Verify normal new session startup still activates the model combo correctly
  • mvn test — 721 tests pass

🤖 Generated with Claude Code

When Claude starts with --continue/--resume, it may show a "Resuming
session" choice dialog before the input prompt is ready.
discoverModels() was triggered immediately on the STARTING→READY
transition, while this dialog was still visible. The /model command
sent to the PTY was blocked until the user dismissed the dialog, but
by then discovery had already timed out (16×300ms) with empty results.
MAX_MODEL_DISCOVERY_ATTEMPTS=1 prevented any retry, so the model combo
stayed disabled for the whole session.

Fix: pollScreenState() now skips discoverModels() while any choice menu
is visible on screen (via detectChoiceMenu) or already shown to the user
(model.getActiveChoiceMenu() != null). Once the blocking dialog is
dismissed, the next poll finds a clean screen and starts discovery.

Also removed `final` from the class declaration and made discoverModels()
package-private to allow test subclassing (needed for the regression test).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 6f09d52 into nbplugins:main Apr 29, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/model-combo-not-populated-with-blocking-dialog branch April 29, 2026 07:53
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