Skip to content

Fixed model name detection for new CLI format with long label and spaced names - #101

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/model-name-parsing
Apr 29, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/model-name-parsing

Conversation

@oleg68

@oleg68 oleg68 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • DESC_PAT relaxed from \s{3,} to \s{2,}: the "Default (recommended)" label uses only 2-space column alignment, causing the model entry to be silently skipped
  • CURRENTLY_PAT / hintPat / currentlyPat changed from [\w/.-]+ to [^)]+?: model names with a space (e.g. "Sonnet 4") were truncated to just the first word, falling back to the full description string
  • Both fixes applied to ModelMenuParser and the three inline patterns in ClaudeSessionController.discoverModels()
  • Added two new parameterized fixture test cases covering both bugs

Test plan

  • mvn test -Dtest=ModelMenuParserTest — all 11 fixtures pass
  • Open a session, open /model menu — combo shows the correct short model name (e.g. "Haiku 4.5"), not the full description
  • With a (currently Sonnet 4)-style default entry — combo shows "Sonnet 4"

🤖 Generated with Claude Code

…ced names

- DESC_PAT: relaxed min-space threshold from 3 to 2 to handle "Default
  (recommended)" label whose 2-space column alignment was skipping the
  model entry entirely
- CURRENTLY_PAT / hintPat / currentlyPat: widened capture from [\w/.-]+
  to [^)]+? so names like "Sonnet 4" (containing a space) are extracted
  correctly instead of returning the full description string
- Applied both fixes to ModelMenuParser and the inline patterns in
  ClaudeSessionController.discoverModels()
- Added two new fixture test cases: format1-long-label and
  format2-currently-with-space

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 8c54837 into nbplugins:main Apr 29, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/model-name-parsing branch April 29, 2026 09:36
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