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 @@
- 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)

- Fixed subagents and background requests failing with "model is not supported when using Codex with a ChatGPT account" for ChatGPT Subscription profiles: model aliases from the Model Aliases dialog (e.g. haiku, sonnet) are now applied to ChatGPT Subscription sessions too
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.51-SNAPSHOT</version>
<version>1.3.53-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 @@ -801,7 +801,7 @@ private void sendShiftTabsUntilMode(EditMode targetMode) {
modeSwitchInProgress = true;
Thread t = new Thread(() -> {
try {
LOG.info("sendShiftTabsUntilMode: target=" + targetMode
LOG.fine("sendShiftTabsUntilMode: target=" + targetMode
+ " currentModel=" + model.getEditMode());
if (trySendShiftTabsUntilMode(targetMode)) return;
// AUTO mode not found — older CC doesn't support it; try fallbacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
bodyBytes = in.readAllBytes();
}
String body = new String(bodyBytes, StandardCharsets.UTF_8);
LOGGER.log(Level.INFO, "PreToolUse hook received: {0}", body);
LOGGER.log(Level.FINE, "PreToolUse hook received: {0} bytes", bodyBytes.length);

jakarta.servlet.AsyncContext asyncCtx = req.startAsync(req, resp);
asyncCtx.setTimeout(590_000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private void sendAsyncToolResponse(Integer requestId, Object result,
if (!sessionQueue.offer(json)) {
LOGGER.warning("SSE session queue full; async tool response dropped");
}
LOGGER.log(Level.INFO, "Sent async tool response for request ID: {0}", requestId);
LOGGER.log(Level.FINE, "Sent async tool response for request ID: {0}", requestId);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Error sending async tool response", e);
}
Expand Down Expand Up @@ -519,10 +519,10 @@ public CompletableFuture<String> handlePreToolUse(String hookJson) {
String toolName = hook.has("tool_name") ? hook.get("tool_name").asText() : "";
JsonNode toolInput = hook.has("tool_input") ? hook.get("tool_input") : objectMapper.createObjectNode();

LOGGER.info("handlePreToolUse: tool=" + toolName);
LOGGER.fine("handlePreToolUse: tool=" + toolName);

if (!isFileEditTool(toolName)) {
LOGGER.info("Auto-allowing non-file-edit tool: " + toolName);
LOGGER.fine("Auto-allowing non-file-edit tool: " + toolName);
return CompletableFuture.completedFuture(hookAllowJson());
}

Expand All @@ -531,16 +531,17 @@ public CompletableFuture<String> handlePreToolUse(String hookJson) {
EditMode editMode = getEditModeForCwd(cwd);
// Session root is the key that matched in the registry (may differ from hook cwd when Claude cd'd into a subdir)
String sessionRoot = getSessionRootForCwd(cwd);
LOGGER.info("handlePreToolUse: editMode=" + editMode + " cwd=" + cwd + " sessionRoot=" + sessionRoot);

String filePath = getFilePath(toolInput);
LOGGER.fine("handlePreToolUse: editMode=" + editMode + " file=" + filePath
+ " cwd=" + cwd + " sessionRoot=" + sessionRoot);

// AUTO or higher (BYPASS_PERMISSIONS): auto-allow regardless of location
// ACCEPT_EDITS or higher (but below AUTO): auto-allow only inside the session root
if (editMode.ordinal() >= EditMode.AUTO.ordinal()
|| (editMode.ordinal() >= EditMode.ACCEPT_EDITS.ordinal()
&& io.github.nbplugins.claudecodegui.ui.FileDiffOpener.isFileUnderDirectory(filePath, sessionRoot))) {
LOGGER.info(editMode.key() + " mode — auto-allowing: " + filePath);
LOGGER.fine(editMode.key() + " mode — auto-allowing: " + filePath);
return CompletableFuture.completedFuture(hookAllowJson());
}
// PLAN / DEFAULT / ACCEPT_EDITS-outside: fall through to show diff dialog
Expand Down Expand Up @@ -946,7 +947,7 @@ private void stopDiffTabTracking() {
private void handleDiffTabClosed(String tabName) {
AsyncHandler handler = DiffTabTracker.remove(tabName);
if (handler != null) {
LOGGER.log(Level.INFO, "Diff tab closed: {0}", tabName);
LOGGER.log(Level.FINE, "Diff tab closed: {0}", tabName);

// Create response with DIFF_REJECTED status
List<Content> contentList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private DiffTabTracker() {}
* @param handler Handler to call when the diff is accepted or rejected
*/
public static void register(String tabName, AsyncHandler handler) {
LOGGER.info("Registering async handler for diff tab: " + tabName);
LOGGER.fine("Registering async handler for diff tab: " + tabName);
pendingDiffs.put(tabName, handler);
}

Expand All @@ -43,7 +43,7 @@ public static void register(String tabName, AsyncHandler handler) {
public static AsyncHandler remove(String tabName) {
AsyncHandler handler = pendingDiffs.remove(tabName);
if (handler != null) {
LOGGER.info("Removed async handler for diff tab: " + tabName);
LOGGER.fine("Removed async handler for diff tab: " + tabName);
}
return handler;
}
Expand Down Expand Up @@ -74,12 +74,12 @@ public static void setResponse(String tabName, OpenDiffResult result) {
public static void setRejected(String tabName) {
AsyncHandler handler = pendingDiffs.remove(tabName);
if (handler != null) {
LOGGER.info("Diff rejected for tab: " + tabName);
LOGGER.fine("Diff rejected for tab: " + tabName);
java.util.List<org.openbeans.claude.netbeans.tools.params.Content> contentList = new java.util.ArrayList<>();
contentList.add(new org.openbeans.claude.netbeans.tools.params.Content("text", "FILE_REJECTED"));
handler.sendResponse(new OpenDiffResult(contentList));
} else {
LOGGER.info("No pending handler for tab (already resolved or never registered): " + tabName);
LOGGER.fine("No pending handler for tab (already resolved or never registered): " + tabName);
}
}

Expand All @@ -103,7 +103,7 @@ public static boolean isTracked(String tabName) {
* @return the future that will be completed with {@code "allow"} or {@code "deny"}
*/
public static CompletableFuture<String> registerHookFuture(String tabName) {
LOGGER.info("Registering hook future for tab: " + tabName);
LOGGER.fine("Registering hook future for tab: " + tabName);
CompletableFuture<String> future = new CompletableFuture<>();
pendingHookFutures.put(tabName, future);
return future;
Expand All @@ -118,7 +118,7 @@ public static CompletableFuture<String> registerHookFuture(String tabName) {
public static void resolveHook(String tabName, String jsonResponse) {
CompletableFuture<String> future = pendingHookFutures.remove(tabName);
if (future != null) {
LOGGER.info("Hook resolved for tab: " + tabName);
LOGGER.fine("Hook resolved for tab: " + tabName);
future.complete(jsonResponse);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected List<Diagnostic> extractDiagnosticsFromFile(String filePath) {
}

List<ErrorDescription> errors = getErrorDescriptions(fileObject);
LOGGER.log(Level.INFO, "getDiagnostics: {0} errors for {1}",
LOGGER.log(Level.FINE, "getDiagnostics: {0} errors for {1}",
new Object[]{errors.size(), filePath});

for (ErrorDescription ed : errors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public Writer createWriter(Difference[] conflicts) throws IOException {
approveButton.setToolTipText("Approve and apply this diff");
approveButton.addActionListener(e -> {
// Get the handler from DiffTabTracker
LOGGER.info("Diff approved: " + finalDiffTabName);
LOGGER.fine("Diff approved: " + finalDiffTabName);

//NOTE: While the message says FILE_SAVED, the IDE does not need to save it. Claude will want to write to it.

Expand All @@ -255,7 +255,7 @@ public Writer createWriter(Difference[] conflicts) throws IOException {
javax.swing.JButton rejectButton = new javax.swing.JButton("✗ Reject");
rejectButton.setToolTipText("Reject this diff — Claude will not apply the change");
rejectButton.addActionListener(e -> {
LOGGER.info("Diff rejected by user: " + finalDiffTabName);
LOGGER.fine("Diff rejected by user: " + finalDiffTabName);
DiffTabTracker.setRejected(finalDiffTabName);
diffTC.close();
});
Expand All @@ -277,7 +277,7 @@ public Writer createWriter(Difference[] conflicts) throws IOException {
return new AsyncResponse<OpenDiffResult>() {
@Override
public void setHandler(AsyncHandler<OpenDiffResult> handler) {
LOGGER.info("Registering async handler for diff tab: " + finalDiffTabName);
LOGGER.fine("Registering async handler for diff tab: " + finalDiffTabName);
DiffTabTracker.register(finalDiffTabName, handler);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ public AsyncResponse<List<Content>> run(Params params) throws Exception {
String toolName = params.getToolName();
JsonNode toolInput = params.getToolInput();

LOGGER.info("permission_prompt called for tool: " + toolName);
LOGGER.fine("permission_prompt called for tool: " + toolName);

// For non-file-editing tools, auto-allow.
if (!isFileEditTool(toolName)) {
LOGGER.info("Auto-allowing non-file-edit tool: " + toolName);
LOGGER.fine("Auto-allowing non-file-edit tool: " + toolName);
return syncAllow();
}

Expand All @@ -126,22 +126,22 @@ public AsyncResponse<List<Content>> run(Params params) throws Exception {

return handler -> FileDiffOpener.open(filePath, before, after, finalTabName, null,
() -> {
LOGGER.info("Permission granted for tab: " + finalTabName);
LOGGER.fine("Permission granted for tab: " + finalTabName);
AsyncHandler<List<Content>> h = DiffTabTracker.remove(finalTabName);
if (h != null) h.sendResponse(allowResult());
},
reason -> {
// reason is not forwarded in the MCP protocol — tool returns just "deny"
LOGGER.info("Permission denied for tab: " + finalTabName);
LOGGER.fine("Permission denied for tab: " + finalTabName);
DiffTabTracker.setRejected(finalTabName);
},
() -> {
LOGGER.info("Permission cancelled for tab: " + finalTabName);
LOGGER.fine("Permission cancelled for tab: " + finalTabName);
DiffTabTracker.setRejected(finalTabName);
FileDiffOpener.cancelCurrentPromptForFile(filePath);
},
() -> {
LOGGER.info("Permission tab closed for tab: " + finalTabName);
LOGGER.fine("Permission tab closed for tab: " + finalTabName);
if (DiffTabTracker.isTracked(finalTabName)) {
DiffTabTracker.setRejected(finalTabName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public PtyProcess start(String workingDir, ClaudeProfile profile, String extraCl
List<String> cmd = new ArrayList<>();
cmd.add(executable);
ClaudeCodeStatusService mcp = Lookup.getDefault().lookup(ClaudeCodeStatusService.class);
LOG.info("MCP service lookup: " + (mcp == null ? "null" : mcp.getClass().getName())
LOG.fine("MCP service lookup: " + (mcp == null ? "null" : mcp.getClass().getName())
+ ", running=" + (mcp != null && mcp.isServerRunning())
+ ", port=" + (mcp != null ? mcp.getServerPort() : -1));
if (mcp != null && mcp.isServerRunning()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private void onFetch() {
try {
List<String> ids = get();
applyFetchedIds(ids);
LOG.info("Fetch models: " + ids.size() + " models returned");
LOG.fine("Fetch models: " + ids.size() + " models returned");
setStatus("Fetched " + ids.size() + " models, " + countAvailable() + " available", false);
} catch (Exception ex) {
Throwable cause = ex.getCause() != null ? ex.getCause() : ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void show(ChoiceMenuModel model, Consumer<String> callback, boolean grabF

// --- Question label — full width ---
String questionText = model.text();
LOG.info("[ChoiceMenuPanel] question: " + questionText);
LOG.fine("[ChoiceMenuPanel] question: " + questionText);
if (questionText != null && !questionText.isBlank()) {
JLabel questionLabel = new JLabel("<html>" + escapeHtml(questionText) + "</html>");
questionLabel.setFont(questionLabel.getFont().deriveFont(questionLabel.getFont().getSize() * 1.5f));
Expand Down Expand Up @@ -128,7 +128,7 @@ public void show(ChoiceMenuModel model, Consumer<String> callback, boolean grabF
JButton btn = new JButton(label);
UiUtils.applyActionStyle(btn, display.equalsIgnoreCase("Yes"));
btn.addActionListener(e -> {
LOG.info("[ChoiceMenuPanel] yes/no clicked: \"" + display + "\" → \"" + response + "\"");
LOG.fine("[ChoiceMenuPanel] yes/no clicked: \"" + display + "\" → \"" + response + "\"");
submitAnswer(response);
});
yesNoBtns.add(btn);
Expand Down Expand Up @@ -278,7 +278,7 @@ public void keyPressed(java.awt.event.KeyEvent e) {
JButton cancelBtn = new JButton("Cancel");
cancelBtn.setAlignmentX(Component.CENTER_ALIGNMENT);
cancelBtn.addActionListener(e -> {
LOG.info("[ChoiceMenuPanel] Cancel clicked");
LOG.fine("[ChoiceMenuPanel] Cancel clicked");
cancel();
});
rightCol.add(cancelBtn);
Expand Down Expand Up @@ -821,7 +821,7 @@ public void keyPressed(java.awt.event.KeyEvent e) {
/** Hides the panel if a prompt is still pending (called when Claude accepted input via terminal). */
public void dismissIfActive() {
if (callback != null) {
LOG.info("[ChoiceMenuPanel] dismissing — Claude accepted terminal input");
LOG.fine("[ChoiceMenuPanel] dismissing — Claude accepted terminal input");
Consumer<String> cb = callback;
setVisible(false);
callback = null;
Expand Down Expand Up @@ -891,7 +891,7 @@ public Dimension getMinimumSize() {

private void submitAnswer(String answer) {
Consumer<String> cb = callback;
LOG.info("[ChoiceMenuPanel] submitAnswer: \"" + answer + "\", cb=" + cb);
LOG.fine("[ChoiceMenuPanel] submitAnswer: \"" + answer + "\"");
setVisible(false);
callback = null;
removeAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,6 @@ public static String resolveTabLabel(File dir) {
return NbBundle.getMessage(ClaudeSessionSelectorPanel.class, "TAB_NewSession");
}
Project[] openProjects = OpenProjects.getDefault().getOpenProjects();
LOG.info("resolveTabLabel: dir=" + dir.getAbsolutePath()
+ " openProjects=" + openProjects.length);
for (Project p : openProjects) {
File projDir = FileUtil.toFile(p.getProjectDirectory());
String projName = ProjectUtils.getInformation(p).getDisplayName();
LOG.info(" comparing with project '" + projName
+ "' dir=" + (projDir != null ? projDir.getAbsolutePath() : "null")
+ " equal=" + dir.equals(projDir));
}
for (Project p : openProjects) {
File projDir = FileUtil.toFile(p.getProjectDirectory());
if (projDir == null) continue;
Expand All @@ -365,7 +356,7 @@ public static String resolveTabLabel(File dir) {
}
try {
if (dir.getCanonicalPath().equals(projDir.getCanonicalPath())) {
LOG.info(" canonical match found for project '"
LOG.fine(" canonical match found for project '"
+ ProjectUtils.getInformation(p).getDisplayName() + "'");
return ProjectUtils.getInformation(p).getDisplayName();
}
Expand Down
Loading