From d70328165999bbb18a8cfd65b6ec4cf0399950ba Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Sun, 28 Jun 2026 14:53:21 +0300 Subject: [PATCH] Fixed disabled models appearing in model selector combo Models marked as "(disabled)" in the /model menu (e.g. "Fable (disabled)") were being added to the combo box with the full unavailability message as their display name. ModelMenuParser now skips any numbered menu entry whose name portion contains "(disabled)". Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 1 + pom.xml | 2 +- .../claudecodegui/process/ModelMenuParser.java | 2 ++ .../format1-with-disabled-model.expected.json | 1 + .../format1-with-disabled-model.src.txt | 17 +++++++++++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.expected.json create mode 100644 src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.src.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index bf931ce1..f32d54f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Fixed disabled models (e.g. `Fable (disabled)`) appearing in the model selector combo with an error message as their name - Fixed session becoming permanently unresponsive when the working directory is on a git branch whose name contains dots (e.g. `feature/e9.5-refactor`) # 1.2.20 (2026-06-22) diff --git a/pom.xml b/pom.xml index 6e23a2bc..8ac82eb3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbplugins netbeans-plugin-claude-code-gui - 1.2.23-SNAPSHOT + 1.2.24-SNAPSHOT nbm Netbeans Plugin Claude Code GUI NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE. diff --git a/src/main/java/io/github/nbplugins/claudecodegui/process/ModelMenuParser.java b/src/main/java/io/github/nbplugins/claudecodegui/process/ModelMenuParser.java index 3a4eb62a..16a12671 100644 --- a/src/main/java/io/github/nbplugins/claudecodegui/process/ModelMenuParser.java +++ b/src/main/java/io/github/nbplugins/claudecodegui/process/ModelMenuParser.java @@ -71,6 +71,8 @@ public ModelDiscovery parse(List lines) { String leftPart = trimmed.split("[·\u00b7]", 2)[0]; Matcher descMatcher = DESC_PAT.matcher(leftPart); if (descMatcher.find()) { + String namePart = leftPart.substring(0, descMatcher.start()).trim(); + if (namePart.toLowerCase().contains("(disabled)")) continue; String desc = descMatcher.group(1).trim() .replaceFirst("^\u2714\\s*", "").trim(); // Format 2: "(currently X)" diff --git a/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.expected.json b/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.expected.json new file mode 100644 index 00000000..1000f053 --- /dev/null +++ b/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.expected.json @@ -0,0 +1 @@ +{"models": ["Sonnet 4.6", "Sonnet 4.6", "Sonnet 4.6 with 1M context", "Opus 4.8", "Haiku 4.5"], "currentIndex": 0} diff --git a/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.src.txt b/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.src.txt new file mode 100644 index 00000000..4711ab42 --- /dev/null +++ b/src/test/resources/io/github/nbplugins/claudecodegui/process/model-menu-parser/format1-with-disabled-model.src.txt @@ -0,0 +1,17 @@ + +────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── + Select model + Switch between Claude models. Your pick becomes the default for new sessions. For other/previous model names, specify with --model. + + ❯ 1. Default (recommended) ✔ Sonnet 4.6 · Efficient for routine tasks + 2. Sonnet Sonnet 4.6 · Efficient for routine tasks + 3. Sonnet (1M context) Sonnet 4.6 with 1M context · Draws from usage credits · $3/$15 per Mtok + 4. Opus Opus 4.8 · Best for everyday, complex tasks · ~2× usage vs Sonnet + 5. Haiku Haiku 4.5 · Fastest for quick answers + 6. Fable (disabled) Claude Fable 5 is currently unavailable. Learn more: https://www.anthropic.com/news/fable-mythos-access + + ◐ Medium effort ←/→ to adjust + + Use /fast to turn on Fast mode (Opus 4.8). + + Enter to set as default · s to use this session only · Esc to cancel