Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Stopped showing Claude Code's "auto mode classifier billing" session notice when using an OpenAI-compatible or ChatGPT Subscription connection type — classifier requests are billed the same as before, just without the interruption, since this connection type was never able to hand those checks off to the server in the first place

# 1.3.8 (2026-07-22)

- Fixed the OpenAI-compatible and ChatGPT Subscription connection types silently ending a prompt with no visible response when the provider returned an empty completion (typically because the conversation grew too large for the model's context/output limit) — Claude Code now shows an explanatory message, including the size of the request that triggered it, instead of just returning to the idle prompt
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.nbplugins</groupId>
<artifactId>netbeans-plugin-claude-code-gui</artifactId>
<version>1.3.28-SNAPSHOT</version>
<version>1.3.30-SNAPSHOT</version>
<packaging>nbm</packaging>
<name>Netbeans Plugin Claude Code GUI</name>
<description>NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl
env.put("ANTHROPIC_BASE_URL",
"http://127.0.0.1:" + mcpSvc.getServerPort() + "/openai-proxy/" + uuid);
env.put("ANTHROPIC_AUTH_TOKEN", "sk-proxy-internal");
disableAutoModeServerCheck(env);
LOG.info("OpenAI proxy registered: uuid=" + uuid
+ ", profile=" + profile.getName()
+ ", target=" + profile.getBaseUrl());
Expand All @@ -204,6 +205,7 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl
env.put("ANTHROPIC_BASE_URL",
"http://127.0.0.1:" + mcpSvc.getServerPort() + "/openai-proxy/" + uuid);
env.put("ANTHROPIC_AUTH_TOKEN", "sk-proxy-internal");
disableAutoModeServerCheck(env);
LOG.info("ChatGPT subscription proxy registered: uuid=" + uuid
+ ", profile=" + profile.getName());
} catch (io.github.nbplugins.claudecodegui.chatgptauth.OAuthException e) {
Expand Down Expand Up @@ -764,6 +766,31 @@ static String cleanedSettingsJson(String existingJson) {
* @param profilesDir base directory for profile config dirs
* @return mutable env map ready to pass to {@link PtyProcessBuilder}
*/
/**
* Tells Claude Code not to ask the far end of {@code ANTHROPIC_BASE_URL} to
* perform auto mode's server-side classifier checks.
*
* <p>The OpenAI-proxy and ChatGPT-subscription connection types point
* {@code ANTHROPIC_BASE_URL} at this plugin's own local servlet, which
* fully translates every request into a non-Anthropic API (OpenAI Chat
* Completions or the Codex Responses API). That backend has no concept of
* Anthropic's {@code safeguards} request field / {@code safeguard_results}
* response field, so the server-side check can never succeed here. Without
* this override, Claude Code would still try it, fall back, and show a
* one-time "session isn't eligible" notice every session; classifier
* requests are billed identically either way, so this only removes the
* interruption.
*
* <p>Uses {@code putIfAbsent} so a value the user already set explicitly
* (e.g. via a profile's extra env vars, applied by {@link #buildEnv}
* before this runs) is left untouched.
*
* @param env mutable env map being built for the child process
*/
static void disableAutoModeServerCheck(Map<String, String> env) {
env.putIfAbsent("CLAUDE_CODE_AUTO_MODE_SERVER", "0");
}

static Map<String, String> buildEnv(ClaudeProfile profile, java.nio.file.Path profilesDir) {
Map<String, String> env = new HashMap<>(System.getenv());
env.put("TERM", "xterm-256color");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,26 @@ void testCleanupRemovesApiKeyHelperButKeepsUserContent() {
assertTrue(cleaned.contains("myCustomKey"), "cleaned should preserve user content");
}

// -------------------------------------------------------------------------
// disableAutoModeServerCheck
// -------------------------------------------------------------------------

@Test
void testDisableAutoModeServerCheckSetsWhenAbsent() {
java.util.Map<String, String> env = new java.util.HashMap<>();
ClaudeProcess.disableAutoModeServerCheck(env);
assertEquals("0", env.get("CLAUDE_CODE_AUTO_MODE_SERVER"));
}

@Test
void testDisableAutoModeServerCheckKeepsUserOverride() {
java.util.Map<String, String> env = new java.util.HashMap<>();
env.put("CLAUDE_CODE_AUTO_MODE_SERVER", "1");
ClaudeProcess.disableAutoModeServerCheck(env);
assertEquals("1", env.get("CLAUDE_CODE_AUTO_MODE_SERVER"),
"an explicit user-set value must not be overridden");
}

// -------------------------------------------------------------------------
// toShellCommand
// -------------------------------------------------------------------------
Expand Down
Loading