diff --git a/CHANGELOG.md b/CHANGELOG.md index f27d061..680879e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Fixed "OpenAI-compatible API" connection type being reset to "Claude-compatible API" on the Default profile (https://github.com/nbplugins/NetbeansPluginClaudeCodeGui/issues/191) - Improved the IDE log (messages.log): per-request and per-click diagnostics (tab label polling, PreToolUse hooks with file contents, diff tabs, choice menus, permission prompts) are now written only when debug logging is enabled, so the log is no longer flooded and no longer contains edited code # 1.3.28 (2026-10-07) diff --git a/pom.xml b/pom.xml index ca0c1a1..3c22317 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbplugins netbeans-plugin-claude-code-gui - 1.3.53-SNAPSHOT + 1.3.56-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/ClaudeProcess.java b/src/main/java/io/github/nbplugins/claudecodegui/process/ClaudeProcess.java index 137ef3c..d5f9d0a 100644 --- a/src/main/java/io/github/nbplugins/claudecodegui/process/ClaudeProcess.java +++ b/src/main/java/io/github/nbplugins/claudecodegui/process/ClaudeProcess.java @@ -161,7 +161,7 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl // OpenAI proxy: register session and inject ANTHROPIC_BASE_URL pointing to internal proxy if (profile != null - && profile.computeConnectionType() == ClaudeProfile.ConnectionType.OPENAI_PROXY) { + && profile.getConnectionType() == ClaudeProfile.ConnectionType.OPENAI_PROXY) { ClaudeCodeStatusService mcpSvc = Lookup.getDefault().lookup(ClaudeCodeStatusService.class); if (mcpSvc != null && mcpSvc.isServerRunning()) { String uuid = UUID.randomUUID().toString(); @@ -191,7 +191,7 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl // ChatGPT subscription: pre-emptively refresh the OAuth token, register the // session, and inject ANTHROPIC_BASE_URL pointing to the internal Codex proxy. if (profile != null - && profile.computeConnectionType() == ClaudeProfile.ConnectionType.OPENAI_SUBSCRIPTION) { + && profile.getConnectionType() == ClaudeProfile.ConnectionType.OPENAI_SUBSCRIPTION) { ClaudeCodeStatusService mcpSvc = Lookup.getDefault().lookup(ClaudeCodeStatusService.class); if (mcpSvc != null && mcpSvc.isServerRunning()) { try { @@ -219,9 +219,9 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl } boolean apiKeyHelper = profile != null && !profile.getApiKey().isBlank() && profile.getBaseUrl().isBlank() - && profile.computeConnectionType() != ClaudeProfile.ConnectionType.OPENAI_PROXY - && profile.computeConnectionType() != ClaudeProfile.ConnectionType.OPENAI_SUBSCRIPTION; - LOG.info("Starting Claude: profile=" + (profile != null ? profile.getName() + " (" + profile.computeConnectionType() + ")" : "Default") + && profile.getConnectionType() != ClaudeProfile.ConnectionType.OPENAI_PROXY + && profile.getConnectionType() != ClaudeProfile.ConnectionType.OPENAI_SUBSCRIPTION; + LOG.info("Starting Claude: profile=" + (profile != null ? profile.getName() + " (" + profile.getConnectionType() + ")" : "Default") + ", apiKeyHelper=" + (apiKeyHelper ? "SET" : "NOT SET") + ", ANTHROPIC_AUTH_TOKEN=" + (!env.getOrDefault("ANTHROPIC_AUTH_TOKEN", "").isBlank() ? "SET" : "NOT SET") + ", ANTHROPIC_BASE_URL=" + env.getOrDefault("ANTHROPIC_BASE_URL", "(not set)") diff --git a/src/main/java/io/github/nbplugins/claudecodegui/settings/ClaudeProfile.java b/src/main/java/io/github/nbplugins/claudecodegui/settings/ClaudeProfile.java index de70b45..446229c 100644 --- a/src/main/java/io/github/nbplugins/claudecodegui/settings/ClaudeProfile.java +++ b/src/main/java/io/github/nbplugins/claudecodegui/settings/ClaudeProfile.java @@ -1,6 +1,7 @@ package io.github.nbplugins.claudecodegui.settings; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSetter; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -17,9 +18,13 @@ * programmatically. * *

Connection type

- * {@link ConnectionType} is not stored — it is derived from the - * credential fields by {@link #computeConnectionType()}: + * The {@link ConnectionType} is stored explicitly (see {@link #getConnectionType()}). + * Settings written by older plugin versions have no stored type (only the legacy + * {@code openaiProxy} / {@code openaiSubscription} flags and the credential fields); + * for them the type is derived on read: *