From 70289809e230b1239b6ed9a14414dc0d4a71a121 Mon Sep 17 00:00:00 2001 From: wenyutang-ms Date: Wed, 26 Nov 2025 15:22:16 +0800 Subject: [PATCH 01/15] feat: mcp toool --- README.md | 34 +++ package.json | 57 +++- src/extension.ts | 6 + src/languageModelTool.ts | 630 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 724 insertions(+), 3 deletions(-) create mode 100644 src/languageModelTool.ts diff --git a/README.md b/README.md index 54e122f1..040536ef 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ A lightweight Java Debugger based on [Java Debug Server](https://github.com/Micr - Debug console - Evaluation - Hot Code Replace +- **[NEW]** No-Config Debug (debug Java apps without launch.json) +- **[NEW]** AI-Assisted Debugging (GitHub Copilot integration) ## Requirements - JDK (version 1.8.0 or later) @@ -41,6 +43,38 @@ ext install vscode-java-debug Please also check the documentation of [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) if you have trouble setting up your project. +## No-Config Debug + +You can now debug Java applications without creating a `launch.json` file! Simply open a terminal in VS Code and use the `debugjava` command: + +```bash +# Debug a main class +debugjava -cp bin com.example.Main + +# Debug a JAR file +debugjava -jar target/myapp.jar + +# Debug with arguments +debugjava -cp bin com.example.Main arg1 arg2 +``` + +The debugger will automatically attach. See [No-Config Debug Documentation](bundled/scripts/noConfigScripts/README.md) for more details. + +## AI-Assisted Debugging + +When using GitHub Copilot Chat, you can now ask AI to help you debug Java applications! The extension provides a Language Model Tool that enables natural language debugging: + +- "Debug my Spring Boot application" +- "Debug the Main class in this project" +- "Debug Calculator with arguments 10 and 5" + +The AI will automatically: +1. Detect your project type (Maven/Gradle/VS Code) +2. Build/compile your project +3. Start debugging with appropriate configuration + +See [Language Model Tool Documentation](docs/LANGUAGE_MODEL_TOOL.md) for more details. + ## Options ### Launch diff --git a/package.json b/package.json index 9cadc3c8..6d4487c2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "debugger" ], "engines": { - "vscode": "^1.75.0" + "vscode": "^1.95.0" }, "license": "SEE LICENSE IN LICENSE.txt", "repository": { @@ -42,7 +42,8 @@ "onDebugInitialConfigurations", "onDebugResolve:java", "onCommand:JavaDebug.SpecifyProgramArgs", - "onCommand:JavaDebug.PickJavaProcess" + "onCommand:JavaDebug.PickJavaProcess", + "onLanguageModelTool:debug_java_application" ], "main": "./dist/extension", "contributes": { @@ -985,7 +986,57 @@ "default": false } } - } + }, + "languageModelTools": [ + { + "name": "debug_java_application", + "displayName": "Debug Java Application", + "modelDescription": "Debug a Java application with proper classpath resolution. CRITICAL WORKFLOW: 1) FIRST call 'rebuild_java_project' tool to compile the project and get the correct classpath (outputPath), 2) THEN call this tool with the classpath from rebuild result. This ensures accurate classpath resolution. The tool starts debugging with 'debugjava' command and attaches the debugger automatically. IMPORTANT: If user requests debugging, you MUST call rebuild_java_project FIRST to get classpath, then pass it to this tool via the 'classpath' parameter. Set 'skipBuild: true' since rebuild was already done. The debug process will run indefinitely until the user stops it. Examples: 'Debug App' (after rebuild), 'Debug com.example.Main with args' (after rebuild), 'Debug target/app.jar'.", + "toolReferenceName": "debugJavaApplication", + "tags": [ + "java", + "debug", + "debugger", + "build", + "compile" + ], + "icon": "$(debug-alt)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "target": { + "type": "string", + "description": "What to debug: 1) Main class name - can be simple (e.g., 'App') or fully qualified (e.g., 'com.example.Main'). Tool auto-detects package from source files. 2) JAR file path (e.g., 'target/app.jar'). 3) Raw java arguments (e.g., '-cp bin com.example.Main'). IMPORTANT: For simple class names without packages, just use 'App' - the tool will find the .class file automatically." + }, + "workspacePath": { + "type": "string", + "description": "Absolute path to the Java project root directory containing pom.xml, build.gradle, or .java source files. This is the working directory for compilation and debugging." + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional command-line arguments to pass to the Java main method (e.g., ['arg1', 'arg2', '--flag=value']). These are program arguments, not JVM arguments." + }, + "skipBuild": { + "type": "boolean", + "description": "Whether to skip compilation before debugging. DEFAULT: false (will compile automatically). Set to true when you have already called 'rebuild_java_project' tool and obtained the classpath. Set to false if rebuilding within this tool is needed (fallback scenario).", + "default": false + }, + "classpath": { + "type": "string", + "description": "CRITICAL: The classpath obtained from 'rebuild_java_project' tool's outputPath field. This ensures accurate classpath resolution. REQUIRED when skipBuild is true. Format: absolute paths separated by system path delimiter (';' on Windows, ':' on Unix). Example: 'C:\\project\\target\\classes;C:\\project\\lib\\dep.jar' or '/project/target/classes:/project/lib/dep.jar'. If not provided, tool will attempt to infer classpath (less accurate)." + } + }, + "required": [ + "target", + "workspacePath" + ] + } + } + ] }, "scripts": { "vscode:prepublish": "npm run build", diff --git a/src/extension.ts b/src/extension.ts index 867b2c02..2ef16796 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -18,6 +18,7 @@ import { handleHotCodeReplaceCustomEvent, initializeHotCodeReplace, NO_BUTTON, Y import { JavaDebugAdapterDescriptorFactory } from "./javaDebugAdapterDescriptorFactory"; import { JavaInlineValuesProvider } from "./JavaInlineValueProvider"; import { logJavaException, logJavaInfo } from "./javaLogger"; +import { registerLanguageModelTool } from "./languageModelTool"; import { IMainClassOption, IMainMethod, resolveMainMethod } from "./languageServerPlugin"; import { mainClassPicker } from "./mainClassPicker"; import { pickJavaProcess } from "./processPicker"; @@ -40,6 +41,11 @@ export async function activate(context: vscode.ExtensionContext): Promise { ); context.subscriptions.push(noConfigDisposable); + // Register Language Model Tool for AI-assisted debugging + if (vscode.lm && vscode.lm.registerTool) { + registerLanguageModelTool(context); + } + return instrumentOperation("activation", initializeExtension)(context); } diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts new file mode 100644 index 00000000..acbce8c7 --- /dev/null +++ b/src/languageModelTool.ts @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +import * as fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; +import { sendError, sendInfo } from "vscode-extension-telemetry-wrapper"; + +interface DebugJavaApplicationInput { + target: string; + workspacePath: string; + args?: string[]; + skipBuild?: boolean; + classpath?: string; +} + +interface DebugJavaApplicationResult { + success: boolean; + message: string; + terminalName?: string; +} + +// Type definitions for Language Model API (these will be in future VS Code versions) +// For now, we use 'any' to allow compilation with older VS Code types +interface LanguageModelTool { + invoke(options: { input: T }, token: vscode.CancellationToken): Promise; +} + +/** + * Registers the Language Model Tool for debugging Java applications. + * This allows AI assistants to help users debug Java code by invoking the debugjava command. + */ +export function registerLanguageModelTool(context: vscode.ExtensionContext): vscode.Disposable | undefined { + // Check if the Language Model API is available + const lmApi = (vscode as any).lm; + if (!lmApi || typeof lmApi.registerTool !== 'function') { + // Language Model API not available in this VS Code version + return undefined; + } + + const tool: LanguageModelTool = { + async invoke(options: { input: DebugJavaApplicationInput }, token: vscode.CancellationToken): Promise { + sendInfo('', { + operationName: 'languageModelTool.debugJavaApplication.invoke', + target: options.input.target, + skipBuild: options.input.skipBuild?.toString() || 'false', + }); + + try { + const result = await debugJavaApplication(options.input, token); + + // Format the message for AI - use simple text, not JSON + const message = result.success + ? `✓ ${result.message}` + : `✗ ${result.message}`; + + // Return result in the expected format - simple text part + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(message) + ]); + } catch (error) { + sendError(error as Error); + + const errorMessage = error instanceof Error ? error.message : String(error); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Debug failed: ${errorMessage}`) + ]); + } + } + }; + + const disposable = lmApi.registerTool('debug_java_application', tool); + context.subscriptions.push(disposable); + return disposable; +} + +/** + * Main function to debug a Java application. + * This function handles: + * 1. Project type detection + * 2. Building the project if needed + * 3. Executing the debugjava command + */ +async function debugJavaApplication( + input: DebugJavaApplicationInput, + token: vscode.CancellationToken +): Promise { + if (token.isCancellationRequested) { + return { + success: false, + message: 'Operation cancelled by user' + }; + } + + // Validate workspace path + const workspaceUri = vscode.Uri.file(input.workspacePath); + if (!fs.existsSync(input.workspacePath)) { + return { + success: false, + message: `Workspace path does not exist: ${input.workspacePath}` + }; + } + + // Step 1: Detect project type + const projectType = detectProjectType(input.workspacePath); + + // Step 2: Build the project if needed + if (!input.skipBuild) { + const buildResult = await buildProject(workspaceUri, projectType, token); + if (!buildResult.success) { + return buildResult; + } + } + + // Step 3: Construct and execute the debugjava command + const debugCommand = constructDebugCommand(input, projectType); + + // Validate that we can construct a valid command + if (!debugCommand || debugCommand === 'debugjava') { + return { + success: false, + message: 'Failed to construct debug command. Please check the target parameter.' + }; + } + + // Step 4: Execute in terminal (non-blocking) + const terminal = vscode.window.createTerminal({ + name: 'Java Debug', + cwd: input.workspacePath, + hideFromUser: false, + isTransient: false // Keep terminal alive even after process exits + }); + + terminal.show(); + + // Send the command and return immediately - don't wait for process to finish + // This is crucial because the Java process will run until user stops it + terminal.sendText(debugCommand); + + // Give a brief moment for the command to start + await new Promise(resolve => setTimeout(resolve, 500)); + + // Build info message for AI + let targetInfo = input.target; + let warningNote = ''; + + if (input.target.endsWith('.jar')) { + targetInfo = input.target; + } else if (input.target.includes('.')) { + targetInfo = input.target; + } else { + // Simple class name - check if we successfully detected the full name + const detectedClassName = findFullyQualifiedClassName(input.workspacePath, input.target, projectType); + if (detectedClassName) { + targetInfo = `${detectedClassName} (detected from ${input.target})`; + } else { + targetInfo = input.target; + warningNote = ' ⚠️ Note: Could not auto-detect package name. If you see "ClassNotFoundException", please provide the fully qualified class name (e.g., "com.example.App" instead of "App").'; + } + } + + return { + success: true, + message: `Debug session started for ${targetInfo}. The Java application is now running in debug mode in terminal '${terminal.name}'. The VS Code debugger should attach automatically. You can set breakpoints in your Java source files.${warningNote}`, + terminalName: terminal.name + }; +} + +/** + * Detects the type of Java project based on build files present. + */ +function detectProjectType(workspacePath: string): 'maven' | 'gradle' | 'vscode' | 'unknown' { + if (fs.existsSync(path.join(workspacePath, 'pom.xml'))) { + return 'maven'; + } + + if (fs.existsSync(path.join(workspacePath, 'build.gradle')) || + fs.existsSync(path.join(workspacePath, 'build.gradle.kts'))) { + return 'gradle'; + } + + // Check if VS Code Java extension is likely managing compilation + const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(workspacePath)); + if (workspaceFolder) { + const javaExt = vscode.extensions.getExtension('redhat.java'); + if (javaExt?.isActive) { + return 'vscode'; + } + } + + return 'unknown'; +} + +/** + * Builds the Java project based on its type. + */ +async function buildProject( + workspaceUri: vscode.Uri, + projectType: 'maven' | 'gradle' | 'vscode' | 'unknown', + _token: vscode.CancellationToken +): Promise { + switch (projectType) { + case 'maven': + return await buildMavenProject(workspaceUri); + + case 'gradle': + return await buildGradleProject(workspaceUri); + + case 'vscode': + return await ensureVSCodeCompilation(workspaceUri); + + case 'unknown': + // Try to proceed anyway - user might have manually compiled + return { + success: true, + message: 'Unknown project type. Skipping build step. Ensure your Java files are compiled.' + }; + } +} + +/** + * Builds a Maven project using mvn compile. + */ +async function buildMavenProject( + workspaceUri: vscode.Uri +): Promise { + return new Promise((resolve) => { + // Use task API for better control + const task = new vscode.Task( + { type: 'shell', task: 'maven-compile' }, + vscode.workspace.getWorkspaceFolder(workspaceUri)!, + 'Maven Compile', + 'Java Debug', + new vscode.ShellExecution('mvn compile', { cwd: workspaceUri.fsPath }) + ); + + // Set a timeout to avoid hanging indefinitely + const timeout = setTimeout(() => { + resolve({ + success: true, + message: 'Maven compile command sent. Build may still be in progress.' + }); + }, 60000); // 60 second timeout + + vscode.tasks.executeTask(task).then((execution) => { + let resolved = false; + + const disposable = vscode.tasks.onDidEndTask((e) => { + if (e.execution === execution && !resolved) { + resolved = true; + clearTimeout(timeout); + disposable.dispose(); + resolve({ + success: true, + message: 'Maven project compiled successfully' + }); + } + }); + + const errorDisposable = vscode.tasks.onDidEndTaskProcess((e) => { + if (e.execution === execution && e.exitCode !== 0 && !resolved) { + resolved = true; + clearTimeout(timeout); + errorDisposable.dispose(); + resolve({ + success: false, + message: `Maven build failed with exit code ${e.exitCode}. Please check the terminal output.` + }); + } + }); + }); + }); +} + +/** + * Builds a Gradle project using gradle classes. + */ +async function buildGradleProject( + workspaceUri: vscode.Uri +): Promise { + return new Promise((resolve) => { + const gradleWrapper = process.platform === 'win32' ? 'gradlew.bat' : './gradlew'; + const gradleCommand = fs.existsSync(path.join(workspaceUri.fsPath, gradleWrapper)) + ? gradleWrapper + : 'gradle'; + + const task = new vscode.Task( + { type: 'shell', task: 'gradle-classes' }, + vscode.workspace.getWorkspaceFolder(workspaceUri)!, + 'Gradle Classes', + 'Java Debug', + new vscode.ShellExecution(`${gradleCommand} classes`, { cwd: workspaceUri.fsPath }) + ); + + // Set a timeout to avoid hanging indefinitely + const timeout = setTimeout(() => { + resolve({ + success: true, + message: 'Gradle compile command sent. Build may still be in progress.' + }); + }, 60000); // 60 second timeout + + vscode.tasks.executeTask(task).then((execution) => { + let resolved = false; + + const disposable = vscode.tasks.onDidEndTask((e) => { + if (e.execution === execution && !resolved) { + resolved = true; + clearTimeout(timeout); + disposable.dispose(); + resolve({ + success: true, + message: 'Gradle project compiled successfully' + }); + } + }); + + const errorDisposable = vscode.tasks.onDidEndTaskProcess((e) => { + if (e.execution === execution && e.exitCode !== 0 && !resolved) { + resolved = true; + clearTimeout(timeout); + errorDisposable.dispose(); + resolve({ + success: false, + message: `Gradle build failed with exit code ${e.exitCode}. Please check the terminal output.` + }); + } + }); + }); + }); +} + +/** + * Ensures VS Code Java Language Server has compiled the files. + */ +async function ensureVSCodeCompilation(workspaceUri: vscode.Uri): Promise { + try { + // Check for compilation errors using VS Code diagnostics + const javaFiles = await vscode.workspace.findFiles( + new vscode.RelativePattern(workspaceUri, '**/*.java'), + '**/node_modules/**', + 100 // Limit to 100 files for performance + ); + + let hasErrors = false; + for (const file of javaFiles) { + const diagnostics = vscode.languages.getDiagnostics(file); + const errors = diagnostics.filter(d => d.severity === vscode.DiagnosticSeverity.Error); + if (errors.length > 0) { + hasErrors = true; + break; + } + } + + if (hasErrors) { + return { + success: false, + message: 'Compilation errors detected in the project. Please fix the errors before debugging.' + }; + } + + // Check if Java extension is active and in standard mode + const javaExt = vscode.extensions.getExtension('redhat.java'); + if (!javaExt?.isActive) { + return { + success: true, + message: 'Java Language Server is not active. Proceeding with debug, but ensure your code is compiled.' + }; + } + + return { + success: true, + message: 'VS Code Java compilation verified' + }; + } catch (error) { + // If we can't verify, proceed anyway + return { + success: true, + message: 'Unable to verify compilation status. Proceeding with debug.' + }; + } +} + +/** + * Constructs the debugjava command based on input parameters. + */ +function constructDebugCommand( + input: DebugJavaApplicationInput, + projectType: 'maven' | 'gradle' | 'vscode' | 'unknown' +): string { + let command = 'debugjava'; + + // Handle JAR files + if (input.target.endsWith('.jar')) { + command += ` -jar ${input.target}`; + } + // Handle raw java command arguments (starts with - like -cp, -jar, etc) + else if (input.target.startsWith('-')) { + command += ` ${input.target}`; + } + // Handle class name (with or without package) + else { + let className = input.target; + + // If target doesn't contain a dot and we can find the Java file, + // try to detect the fully qualified class name + if (!input.target.includes('.')) { + const detectedClassName = findFullyQualifiedClassName(input.workspacePath, input.target, projectType); + if (detectedClassName) { + sendInfo('', { + operationName: 'languageModelTool.classNameDetection', + simpleClassName: input.target, + detectedClassName: detectedClassName, + projectType: projectType + }); + className = detectedClassName; + } else { + // No package detected - class is in default package + sendInfo('', { + operationName: 'languageModelTool.classNameDetection.noPackage', + simpleClassName: input.target, + projectType: projectType + }); + } + } + + // Use provided classpath if available, otherwise infer it + const classpath = input.classpath || inferClasspath(input.workspacePath, projectType); + + command += ` -cp "${classpath}" ${className}`; + } + + // Add arguments if provided + if (input.args && input.args.length > 0) { + command += ' ' + input.args.join(' '); + } + + return command; +} + +/** + * Tries to find the fully qualified class name by searching for the Java file. + * This helps when user provides just "App" instead of "com.example.App". + */ +function findFullyQualifiedClassName( + workspacePath: string, + simpleClassName: string, + projectType: 'maven' | 'gradle' | 'vscode' | 'unknown' +): string | null { + // Determine source directories based on project type + const sourceDirs: string[] = []; + + switch (projectType) { + case 'maven': + sourceDirs.push(path.join(workspacePath, 'src', 'main', 'java')); + break; + case 'gradle': + sourceDirs.push(path.join(workspacePath, 'src', 'main', 'java')); + break; + case 'vscode': + sourceDirs.push(path.join(workspacePath, 'src')); + break; + case 'unknown': + // Try all common locations + sourceDirs.push( + path.join(workspacePath, 'src', 'main', 'java'), + path.join(workspacePath, 'src'), + workspacePath + ); + break; + } + + // Search for the Java file + for (const srcDir of sourceDirs) { + if (!fs.existsSync(srcDir)) { + continue; + } + + try { + const javaFile = findJavaFile(srcDir, simpleClassName); + if (javaFile) { + // Extract package name from the file + const packageName = extractPackageName(javaFile); + if (packageName) { + return `${packageName}.${simpleClassName}`; + } else { + // No package, use simple name + return simpleClassName; + } + } + } catch (error) { + // Continue searching in other directories + } + } + + return null; +} + +/** + * Recursively searches for a Java file with the given class name. + */ +function findJavaFile(dir: string, className: string): string | null { + try { + const files = fs.readdirSync(dir); + + for (const file of files) { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + + if (stat.isDirectory()) { + // Skip common non-source directories + if (file === 'node_modules' || file === '.git' || file === 'target' || file === 'build') { + continue; + } + const found = findJavaFile(filePath, className); + if (found) { + return found; + } + } else if (file === `${className}.java`) { + return filePath; + } + } + } catch (error) { + // Ignore permission errors or other file system issues + } + + return null; +} + +/** + * Extracts the package name from a Java source file. + */ +function extractPackageName(javaFilePath: string): string | null { + try { + const content = fs.readFileSync(javaFilePath, 'utf-8'); + const packageMatch = content.match(/^\s*package\s+([\w.]+)\s*;/m); + return packageMatch ? packageMatch[1] : null; + } catch (error) { + return null; + } +} + +/** + * Checks if a directory contains any .class files. + */ +function hasClassFiles(dir: string): boolean { + try { + const files = fs.readdirSync(dir); + for (const file of files) { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + + if (stat.isFile() && file.endsWith('.class')) { + return true; + } else if (stat.isDirectory()) { + // Recursively check subdirectories (but limit depth) + if (hasClassFiles(filePath)) { + return true; + } + } + } + } catch (error) { + // Ignore errors + } + return false; +} + +/** + * Infers the classpath based on project type and common conventions. + */ +function inferClasspath(workspacePath: string, projectType: 'maven' | 'gradle' | 'vscode' | 'unknown'): string { + const classpaths: string[] = []; + + switch (projectType) { + case 'maven': + // Maven standard output directory + const mavenTarget = path.join(workspacePath, 'target', 'classes'); + if (fs.existsSync(mavenTarget)) { + classpaths.push(mavenTarget); + } + break; + + case 'gradle': + // Gradle standard output directories + const gradleMain = path.join(workspacePath, 'build', 'classes', 'java', 'main'); + if (fs.existsSync(gradleMain)) { + classpaths.push(gradleMain); + } + break; + + case 'vscode': + // VS Code Java extension default output + const vscodeOut = path.join(workspacePath, 'bin'); + if (fs.existsSync(vscodeOut)) { + classpaths.push(vscodeOut); + } + break; + } + + // Fallback to common locations + if (classpaths.length === 0) { + const commonPaths = [ + path.join(workspacePath, 'bin'), // VS Code default + path.join(workspacePath, 'out'), // IntelliJ default + path.join(workspacePath, 'target', 'classes'), // Maven + path.join(workspacePath, 'build', 'classes', 'java', 'main'), // Gradle + path.join(workspacePath, 'build', 'classes'), + ]; + + // Check each common path + for (const p of commonPaths) { + if (fs.existsSync(p)) { + // Check if there are actually .class files in this directory + if (hasClassFiles(p)) { + classpaths.push(p); + break; + } + } + } + } + + // If still no classpath found, use current directory + // This is common for simple projects where .class files are alongside .java files + if (classpaths.length === 0) { + classpaths.push('.'); + } + + return classpaths.join(path.delimiter); +} From 7812075ea7ad4a5f209b507969fa6150521d5905 Mon Sep 17 00:00:00 2001 From: wenyutang-ms Date: Thu, 27 Nov 2025 09:32:57 +0800 Subject: [PATCH 02/15] feat: add agent.md --- bundled/agents/debug.agent.md | 252 ++++++++++++++++++++++++++++++++++ package.json | 11 +- 2 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 bundled/agents/debug.agent.md diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md new file mode 100644 index 00000000..bcc1e53a --- /dev/null +++ b/bundled/agents/debug.agent.md @@ -0,0 +1,252 @@ + +# Debug Orchestrator for Java (VS Code + No‑Config Debug) + +> This agent integrates with the VS Code Debug extension’s **languageModelTools** to implement the critical workflow: +> 1) **First call** `java_project_rebuild` (toolReferenceName: `java-project-rebuild`) to perform a clean rebuild and return the **classpath** (`outputPath`). +> 2) **Then call** `debug_java_application` (toolReferenceName: `debugJavaApplication`) with `skipBuild: true` and pass the classpath from step 1. +> +> Internally, the tool uses `debugjava` to start the JVM and automatically attach the VS Code Java debugger. The agent monitors breakpoints, stack traces, variables, and execution flow using VS Code Debug APIs and DAP. + +--- + +## 🎯 Goals +- Start Java debugging in VS Code **without `launch.json`** (No‑Config Debug) and auto-attach. +- Enforce a unified workflow: **rebuild → debug → monitor/control → (optional) adjust logging level or hand off to a coding agent for fixes**. +- Use **context-isolated subagents** for safe separation of responsibilities: breakpoint management, diagnostics, and logging level changes. + +--- + +## 🧩 Integrated languageModelTools + +### `java_project_rebuild` (toolReferenceName: `java-project-rebuild`) +**Purpose**: Trigger a clean rebuild to recompile source files and resolve dependencies. Can rebuild all projects in the workspace or a specific project. + +**Input** (optional): +- `resourcePath: string` — File path or URI to determine which project to rebuild. If omitted, rebuilds all projects in the workspace. + +**Output (expected)**: +- `outputPath: string` — Accurate classpath (absolute paths separated by `:` on Unix or `;` on Windows). + +> Note: `debug_java_application` requires the `outputPath` from this tool as its `classpath` argument when `skipBuild` is true. + +--- + +### `debug_java_application` (toolReferenceName: `debugJavaApplication`) +**Purpose**: Start a Java application using `debugjava` and attach the debugger automatically. The session runs until the user stops it. + +**Workflow requirement**: Must call `java_project_rebuild` first to get the classpath. + +**Input**: +- `target: string` (required) — One of: + 1) Main class name (simple or fully qualified, e.g., `App` or `com.example.Main`). + 2) JAR file path (e.g., `build/libs/app.jar`). + 3) Raw Java arguments (e.g., `-cp bin com.example.Main`). +- `workspacePath: string` (required) — Absolute path to the project root. +- `args: string[]` (optional) — Program arguments for `main(String[])`. +- `skipBuild: boolean` (default: false) — Set to **true** after rebuild. +- `classpath: string` — Required when `skipBuild` is true; obtained from `outputPath`. + +**Behavior**: +- Internally runs `debugjava` → JVM starts with JDWP → VS Code auto-attaches the debugger. + +--- + +## 🔄 Debugging Workflow (Agent Orchestration) + +### 1) Detect intent → choose launch mode +Examples: +- “Debug `com.example.app.Application` with logging level DEBUG” +- “Debug JAR and set port to 8081” + +### 2) **Rebuild first** (compute classpath) +```pseudo +call tool: java-project-rebuild + with: { resourcePath?: "/absolute/path/to/project" } +receive: { outputPath: CP } # Accurate classpath +cache: CP +``` + +### 3) **Start No‑Config Debug** (auto-attach) +```pseudo +call tool: debugJavaApplication + with: { + target: "com.example.app.Application" | "build/libs/app.jar" | "-cp ... Main", + workspacePath: "/absolute/path/to/project", + args: ["--server.port=8081", "--logging.level.root=DEBUG"], + skipBuild: true, + classpath: CP + } +# debugjava starts → VS Code auto-attaches → session active +``` + +### 4) **Monitor and control the session** (VS Code Debug API / DAP) +- Subscribe to: `onDidStartDebugSession`, `onDidTerminateDebugSession`, `stopped` events. +- On breakpoint hit (`stopped`): + - Request `stackTrace → scopes → variables` + - Render summary in Chat (thread, top frames, key variables). +- Execution control: `continue`, `stepOver`, `stepInto`, `stepOut`, `pause`. +- Breakpoint management: list/add/remove line, conditional, and logpoints. +- Evaluate expressions: `evaluate { expression: "a + b" }`. + +### 5) **Adjust logging level** (two options) +- **Restart with args** (simple and reliable): + - Stop current session → call `debugJavaApplication` again with updated `args`: + `--logging.level.root=TRACE --logging.level.com.example.app=DEBUG` +- **Hot change via Spring Boot Actuator** (if enabled): + - `POST /actuator/loggers/{logger}` with `{ "configuredLevel": "DEBUG" }`. + +### 6) **(Optional) Handoff to Coding Agent** +- Provide context (stack, variables, file/line, fix intent) to Coding Agent. +- Coding Agent applies changes, rebuilds, runs tests, creates PR. +- Return to this agent to verify fix. + +--- + +## 🔒 Context-Isolated Subagents (Recommended) + +### Subagent: **Breakpoints** +- Capabilities: read/write breakpoints, conditional/logpoints. +- No network or file write permissions. + +### Subagent: **Diagnostics** +- Capabilities: read-only DAP data (threads, stack, variables), summarize for Chat. +- Cannot modify code or breakpoints. + +### Subagent: **Logging** +- Capabilities: restart with new args or call Actuator endpoint to change log level. +- No code editing. + +--- + +## 🛠 Agent Tool Declarations (Mapping to languageModelTools and VS Code APIs) + +### `invokeRebuild` +```tool +name: invokeRebuild +description: Call languageModelTool `java-project-rebuild` to perform a clean rebuild and return classpath. +input_schema: + type: object + properties: + resourcePath: { type: string } +impl: + kind: languageModelTool.invoke + toolReferenceName: java-project-rebuild +output_schema: + type: object + properties: + outputPath: { type: string, description: "Accurate classpath" } +``` + +### `startNoConfigDebug` +```tool +name: startNoConfigDebug +description: Call `debugJavaApplication` (skipBuild=true) with classpath from rebuild to start debugjava and auto-attach. +input_schema: + type: object + properties: + target: { type: string } + workspacePath: { type: string } + args: { type: array, items: { type: string } } + classpath: { type: string } + required: [target, workspacePath, classpath] +impl: + kind: languageModelTool.invoke + toolReferenceName: debugJavaApplication + fixed_args: { skipBuild: true } +``` + +### `watchSession` +```tool +name: watchSession +description: Subscribe to VS Code debug session events; on 'stopped', fetch stack/scopes/variables and summarize. +impl: + kind: vscode.debug.subscribe +``` + +### `dapControl` +```tool +name: dapControl +description: Send a DAP command to the active session (continue, stepOver, stepInto, pause, evaluate). +input_schema: + type: object + properties: + command: { type: string, enum: ["continue","pause","stepOver","stepInto","stepOut","evaluate"] } + arguments: { type: object } + required: [command] +impl: + kind: vscode.debug.customRequest +``` + +### `breakpoints` +```tool +name: breakpoints +description: List/add/remove/update breakpoints and logpoints. +impl: + kind: vscode.debug.manageBreakpoints +``` + +### `switchLogLevel` +```tool +name: switchLogLevel +description: Adjust logging level via restart (args) or Spring Boot Actuator. +input_schema: + type: object + properties: + mode: { type: string, enum: ["restart","actuator"] } + root: { type: string, enum: ["TRACE","DEBUG","INFO","WARN","ERROR"] } + packages: + type: array + items: { type: object, properties: { logger: { type: string }, level: { type: string } } } + actuatorUrl: { type: string } +impl: + kind: composite + steps: + - when: "mode == 'restart'" + run: languageModelTool.invoke + toolReferenceName: debugJavaApplication + argsFromContext: + target: "" + workspacePath: "" + classpath: "" + skipBuild: true + args: "--logging.level.root=${root} ${packages.map(p => `--logging.level.${p.logger}=${p.level}`).join(' ')}" + - when: "mode == 'actuator'" + forEach: "packages" + run: http.request + request: + method: "POST" + url: "${actuatorUrl}/${item.logger}" + json: { configuredLevel: "${item.level}" } +``` + +--- + +## 🧪 Prompt → Flow Examples +- **“Rebuild and debug `com.example.app.Application` with logging level DEBUG”**: + 1) `invokeRebuild({ resourcePath: "/abs/project" })` → `CP` + 2) `startNoConfigDebug({ target: "com.example.app.Application", workspacePath: "/abs/project", classpath: CP, args: ["--logging.level.root=DEBUG"] })` + 3) `watchSession()` → On breakpoint hit, show stack and variables. + +- **“Debug JAR with port 8081 and log variables on breakpoint”**: + 1) `invokeRebuild({})` → `CP` + 2) `startNoConfigDebug({ target: "build/libs/app.jar", workspacePath: "/abs/project", classpath: CP, args: ["--server.port=8081"] })` + 3) `breakpoints.add({ file: "CalcService.java", line: 18, logMessage: "a=${a}, b=${b}" })` + 4) `dapControl({ command: "stepOver" })` + +- **“Change log level for `com.example.app` to TRACE (no breakpoint)”**: + - `switchLogLevel({ mode: "restart", root: "INFO", packages: [{ logger: "com.example.app", level: "TRACE" }] })` + +--- + +## ⚠️ Notes +- Always follow the sequence: **rebuild → debug**. +- Accurate classpath is critical for debugging; ensure `outputPath` is absolute and properly formatted. +- No‑Config Debug and `launch.json` are not mutually exclusive; keep `launch.json` for remote attach or repeatable tasks if needed. + +--- + +## 📋 How does this agent implement debugging? +1. **Build**: Calls `java-project-rebuild` to get accurate classpath. +2. **Start**: Calls `debugJavaApplication` with `skipBuild=true` and `classpath` → extension runs `debugjava` → VS Code auto-attaches. +3. **Monitor/control**: Subscribes to debug events and uses DAP for stack/variables, execution control, and breakpoints. +4. **Adjust logging**: Restart with args or use Actuator; optionally hand off to Coding Agent for code fixes and PR creation. diff --git a/package.json b/package.json index 6d4487c2..7122c58c 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "debugger" ], "engines": { - "vscode": "^1.95.0" + "vscode": "^1.106.3" }, "license": "SEE LICENSE IN LICENSE.txt", "repository": { @@ -1036,6 +1036,13 @@ ] } } + ], + "chatAgents": [ + { + "name": "JavaDebugAgent", + "path": "./bundled/agents/debug.agent.md", + "description": "Custome Agent for debugging Java applications." + } ] }, "scripts": { @@ -1072,4 +1079,4 @@ "vscode-languageserver-types": "3.16.0", "vscode-tas-client": "^0.1.84" } -} +} \ No newline at end of file From a4d6ed32bcc5a7064b05d48fad07360a4218aaa0 Mon Sep 17 00:00:00 2001 From: wenyutang-ms Date: Fri, 5 Dec 2025 10:35:37 +0800 Subject: [PATCH 03/15] feat: debug agent design --- bundled/agents/debug.agent.md | 804 +++++++++++++++++++++++++--------- package-lock.json | 21 +- package.json | 271 +++++++++++- src/extension.ts | 31 +- src/languageModelTool.ts | 502 ++++++++++++++++++++- 5 files changed, 1380 insertions(+), 249 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index bcc1e53a..63f33dd9 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -1,252 +1,626 @@ - -# Debug Orchestrator for Java (VS Code + No‑Config Debug) - -> This agent integrates with the VS Code Debug extension’s **languageModelTools** to implement the critical workflow: -> 1) **First call** `java_project_rebuild` (toolReferenceName: `java-project-rebuild`) to perform a clean rebuild and return the **classpath** (`outputPath`). -> 2) **Then call** `debug_java_application` (toolReferenceName: `debugJavaApplication`) with `skipBuild: true` and pass the classpath from step 1. -> -> Internally, the tool uses `debugjava` to start the JVM and automatically attach the VS Code Java debugger. The agent monitors breakpoints, stack traces, variables, and execution flow using VS Code Debug APIs and DAP. - --- - -## 🎯 Goals -- Start Java debugging in VS Code **without `launch.json`** (No‑Config Debug) and auto-attach. -- Enforce a unified workflow: **rebuild → debug → monitor/control → (optional) adjust logging level or hand off to a coding agent for fixes**. -- Use **context-isolated subagents** for safe separation of responsibilities: breakpoint management, diagnostics, and logging level changes. - +description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow +tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] --- +You are an expert Java debugging assistant that helps developers solve complex issues by actively using the integrated language model debugging tools. + +## Terminal Commands in Debug Mode + +When using the `run_in_terminal` tool in this mode, always set `isBackground=true` to run commands in the background without blocking the debug session. + +## Your Responsibilities + +- Start Java applications in debug mode using no-config workflow (without launch.json) +- Systematically investigate issues using breakpoints and runtime inspection +- Analyze program state at different execution points to identify root causes +- Use step operations to trace through code execution paths +- Inspect variables, objects, and stack traces to understand program behavior +- Evaluate expressions to test hypotheses about runtime state +- Propose solutions based on concrete evidence gathered from debugging sessions +- Manage breakpoints effectively throughout the debugging process + +## Debugging Approach + +1. **Understand the problem**: Ask clarifying questions about the issue, expected vs actual behavior + +2. **Locate the code**: Use semantic search or grep to find relevant code sections. When reading files to identify breakpoint locations, use `read_file` to see exact line numbers for setting accurate breakpoints. + +3. **Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: + - Use `set_java_breakpoint` to place breakpoints at specific lines + - **Important**: You can (and should) set breakpoints BEFORE the debug session starts + - Breakpoints set before debugging will automatically activate when the session starts + - Only set breakpoints on valid executable code lines (not comments, blank lines, or declarations) + - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42)` + - Optional: Use conditions, hit conditions, or log messages for more targeted debugging + + **Breakpoint placement strategy**: + - **To inspect what happened at line N**: Set breakpoint at line N+1 (the next executable line) + - **Why?** When execution stops at line N+1, line N has already executed, so you can see its effects + - **Example**: To see what `int result = calculate(x, y);` computed, set breakpoint on the line AFTER it + - This allows you to inspect variables modified by line N and evaluate expressions with those values + - For method entry inspection, set breakpoint at the first executable line inside the method body + + **Why set breakpoints first?** + - The program will stop at your breakpoints as soon as it reaches them + - No need to scramble to set breakpoints while the program is already running + - More efficient workflow: prepare → launch → inspect + +4. **Start the debug session**: Use the `debug_java_application` tool to launch the Java application in debug mode: + - Identify the main class or JAR file to debug + - Determine the workspace path (project root directory) + - Prepare any program arguments needed + - The tool will automatically handle compilation and classpath resolution + - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project", args=["--port=8080"])` + + **Important - Check for existing sessions**: + - If a debug session is already running, consider waiting for it to complete naturally + - Starting a new debug session while one is running may cause conflicts + - If the current session is stuck or needs to be replaced, stop it first (user can terminate via VS Code UI) + - For quick iterations, you can reuse the same debug session by setting new breakpoints and using `continue` + + **Note**: The debug process runs in the background. The tool starts the JVM with debug agent and VS Code automatically attaches the debugger. Any breakpoints you set in step 3 will automatically activate. + +5. **Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: + + **IMPORTANT - Minimize Breakpoints**: Setting too many breakpoints makes debugging harder to follow and wastes time. Only set breakpoints where you absolutely need to inspect state. Often a single well-placed breakpoint is enough. + + **Choose ONE of these strategies**: + - **If you know the failure location**: Set ONE breakpoint at the line where the error/exception occurs to inspect the immediate state + - **If investigating logic flow**: Set ONE breakpoint at the method entry point to verify inputs and step through from there + - **If tracing data corruption**: Set ONE breakpoint where the data is first used incorrectly, then work backward if needed + + **After inspecting the first breakpoint**, decide if you need more based on what you learned: + - If the issue is clear from the first breakpoint, propose a solution immediately + - If you need to see an earlier state, remove the current breakpoint and set ONE new breakpoint further upstream + - Only set a second breakpoint if you specifically need to compare state at two different points + + **Important**: Set breakpoints only on valid executable code lines, not on: + - Comments or blank lines + - Method signatures or class declarations (use the first executable line inside the method body instead) + - Package declarations or import statements + - Closing braces + + Use `set_java_breakpoint` tool: + - Required: `filePath` (absolute path to Java file), `lineNumber` (1-based) + - Optional: `condition` (e.g., "count > 10"), `hitCondition` (e.g., ">5"), `logMessage` (for logpoints) + - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42, condition="userId == 123")` + +5. **Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. + +7. **Inspect execution state**: When breakpoints are hit: + - Use `get_debug_variables` to inspect variable values and object state + - Optional: `frameId` (default 0 for current frame), `scopeType` ("local", "static", "all"), `filter` (pattern match) + - Example: `get_debug_variables(scopeType="local", filter="user*")` + - Use `get_debug_stack_trace` to understand the call chain and execution path + - Optional: `threadId`, `maxDepth` (default 50) + - Example: `get_debug_stack_trace(maxDepth=10)` + - Use `evaluate_debug_expression` to test hypotheses about variable values + - Required: `expression`, Optional: `frameId`, `context` ("watch", "repl", "hover") + - Example: `evaluate_debug_expression(expression="user.getName()", context="repl")` + - Use `get_debug_threads` to see all active threads (useful for concurrent issues) + - Example: `get_debug_threads()` + +8. **Navigate execution**: Prefer stepping over setting multiple breakpoints: + - Use `debug_step_operation` to control program flow: + - `operation="stepOver"` to execute the current line and move to the next + - `operation="stepInto"` to dive into method calls and examine internal behavior + - `operation="stepOut"` to return from the current method + - `operation="continue"` only if you have another specific breakpoint to reach + - `operation="pause"` to pause running execution + - Optional: `threadId` for thread-specific operations + - Example: `debug_step_operation(operation="stepInto")` + +9. **Iterate minimally**: Based on observations: + - **Prefer stepping** through code over setting new breakpoints + - If you must set another breakpoint, **remove the previous one first** using `remove_java_breakpoints` + - **Never set multiple breakpoints on the same line** - if a breakpoint already exists at a line, remove it before setting a new one + - Adjust variable inspection for complex objects if needed + - Keep only 1-2 active breakpoints at any time + +10. **Identify root cause**: Use collected data to pinpoint the issue: + - Compare variable values across different execution points + - Trace unexpected values back to their source + - Identify logic errors or incorrect state transitions + - Use expression evaluation to verify assumptions + +11. **Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging + +12. **Clean up and stop**: After investigation is complete: + - Remove breakpoints using `remove_java_breakpoints`: + - Remove specific breakpoint: `remove_java_breakpoints(filePath="/path/to/Main.java", lineNumber=42)` + - Remove all breakpoints in a file: `remove_java_breakpoints(filePath="/path/to/Main.java")` + - Remove all breakpoints: `remove_java_breakpoints()` + - Stop the debug session using `stop_debug_session`: + - `stop_debug_session(reason="Investigation complete")` + - This terminates the Java process and closes the debug session cleanly + +## Language Model Debugging Tools + +### Session Management + +**debug_java_application** - Start Java application in debug mode +- **Purpose**: Launch or attach to a Java application with automatic classpath resolution +- **Parameters**: + - `target` (required): Main class name (e.g., "App" or "com.example.Main"), JAR path, or raw Java arguments + - `workspacePath` (required): Absolute path to project root directory + - `args` (optional): Program arguments array (e.g., ["--port=8080", "--debug"]) + - `skipBuild` (optional): Skip compilation if already built (default: false) + - `classpath` (optional): Explicit classpath (required if skipBuild=true) + - `waitForSession` (optional): Wait for debug session to start (default: false) + - `false`: Returns immediately after sending debug command (faster, but session status unknown) + - `true`: Waits up to 30 seconds for VS Code to confirm session started (slower, but confirms debugger is ready) +- **Usage**: Always start with this tool to initiate a debug session. The tool handles compilation, classpath resolution, and debugger attachment automatically. +- **Behavior**: + - Starts JVM with JDWP enabled → VS Code auto-attaches debugger → session runs in background + - With `waitForSession=true`: Confirms debugger attachment before returning (recommended when immediately setting breakpoints) + - With `waitForSession=false`: Returns quickly but session may still be starting (default behavior) + +### Breakpoint Management + +**set_java_breakpoint** - Set breakpoint at specific line +- **Purpose**: Pause execution at a specific line to inspect program state +- **Important**: Can be used BEFORE or DURING a debug session. Breakpoints set before debugging will activate automatically when the session starts. +- **Parameters**: + - `filePath` (required): Absolute path to Java source file + - `lineNumber` (required): Line number (1-based, must be executable code) + - `condition` (optional): Conditional expression (e.g., "count > 10", "userName.equals(\"admin\")") + - `hitCondition` (optional): Hit count condition (e.g., ">5", "==3", "%2") + - `logMessage` (optional): Log message for logpoints (e.g., "Counter: {count}") +- **Usage**: Set minimal strategic breakpoints; prefer 1-2 at a time +- **Best Practice**: To inspect line N's effects, set breakpoint at line N+1 (the line after). When execution stops at N+1, line N has completed and you can see its results. +- **Returns**: Success/failure status with breakpoint information + +**remove_java_breakpoints** - Remove breakpoints +- **Purpose**: Clean up breakpoints when investigation is done or before setting new ones +- **Important**: Can be used BEFORE or DURING a debug session, or even after the session ends. +- **Parameters**: + - `filePath` (optional): File path (omit to remove all breakpoints) + - `lineNumber` (optional): Line number (omit to remove all in file) +- **Usage**: Always clean up after investigation; remove before setting new ones to avoid clutter +- **Returns**: Number of breakpoints removed + +### Execution Control + +**debug_step_operation** - Control program execution +- **Purpose**: Navigate through code execution without setting multiple breakpoints +- **Parameters**: + - `operation` (required): + - "stepIn" - Enter method calls to examine internal behavior + - "stepOut" - Exit current method and return to caller + - "stepOver" - Execute current line and move to next line + - "continue" - Resume execution until next breakpoint or program end + - "pause" - Pause running execution + - `threadId` (optional): Target specific thread (use get_debug_threads to find IDs) +- **Usage**: Prefer stepping over setting multiple breakpoints for efficient debugging +- **Returns**: Execution state after operation + +### State Inspection + +**get_debug_variables** - Inspect variables in current frame +- **Purpose**: Examine variable values, types, and object state when stopped at breakpoint +- **Parameters**: + - `frameId` (optional): Stack frame index (default 0 = current/top frame) + - `scopeType` (optional): "local" (locals and parameters), "static" (class variables), "all" (both) + - `filter` (optional): Variable name pattern with wildcards (e.g., "user*", "*Config") +- **Usage**: Check variable values when stopped at breakpoint to understand program state +- **Returns**: List of variables with names, types, and values + +**get_debug_stack_trace** - Get call stack +- **Purpose**: Understand execution flow and identify how current code was reached +- **Parameters**: + - `threadId` (optional): Thread ID (defaults to current thread) + - `maxDepth` (optional): Maximum frames to retrieve (default: 50) +- **Usage**: Understand execution flow and identify unexpected code paths +- **Returns**: Call stack with method names, source files, and line numbers + +**evaluate_debug_expression** - Evaluate Java expressions +- **Purpose**: Test hypotheses about variable values and object state without modifying code +- **Parameters**: + - `expression` (required): Java expression to evaluate (e.g., "user.getName()", "list.size() > 10") + - `frameId` (optional): Stack frame index for evaluation context (default: 0) + - `context` (optional): "watch", "repl", "hover" - affects side effect handling +- **Usage**: Test hypotheses, invoke methods, check complex conditions during debugging +- **Returns**: Expression result with type information + +**get_debug_threads** - List all threads +- **Purpose**: Identify threads in multi-threaded applications for concurrent debugging +- **Parameters**: None +- **Usage**: Essential for multi-threaded debugging; provides thread IDs for thread-specific operations +- **Returns**: List of threads with IDs, names, and states (running, suspended, blocked) + +### Session Control + +**stop_debug_session** - Stop the active debug session +- **Purpose**: Terminate the debug session when investigation is complete or restart is needed +- **Parameters**: + - `reason` (optional): Reason for stopping (e.g., "Investigation complete", "Root cause identified", "Need to restart") +- **Usage**: Use this to cleanly stop the debug session after you've identified the root cause, need to restart with different parameters, or investigation is complete. This terminates the Java process and closes the debug session. +- **Important**: Can be called at any time during an active debug session. No session required if none is active (will return harmlessly). +- **Returns**: Confirmation message with session info and reason + +## Best Practices + +- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), then start debug session with debug_java_application +- **When to use waitForSession=true**: Use when you need immediate confirmation that the debugger is ready (e.g., automated testing, CI/CD pipelines, or when setting breakpoints programmatically right after launch). For interactive debugging, the default (false) is usually sufficient. +- **Breakpoints work without active session**: You can set/remove breakpoints anytime - they'll activate when debugging starts +- **Check for running sessions**: Before starting a new debug session, check if one is already running. Let it complete naturally or stop it first +- **Breakpoint placement for inspection**: To inspect line N's results, set breakpoint at line N+1. When stopped at N+1, line N has executed and its effects are visible +- **MINIMIZE BREAKPOINTS**: Start with ONE breakpoint, inspect, then decide if you need more. Prefer stepping over setting multiple breakpoints +- **Remove before adding**: If you need a new breakpoint, remove the previous one first to keep the session clean +- **Never duplicate line breakpoints**: Before setting a breakpoint, consider removing any existing breakpoint at that line first +- **Verify breakpoint lines**: Only set breakpoints on executable code lines (not comments, blank lines, or declarations) +- **Step instead of breakpoint**: When already at a breakpoint, use step operations to move through code rather than setting another breakpoint +- **Compare states systematically**: Inspect variables at multiple points by stepping, not by setting multiple breakpoints +- **Use stack traces effectively**: Understand execution flow and identify unexpected code paths +- **Evaluate expressions liberally**: Test hypotheses without modifying code +- **Thread awareness**: Use get_debug_threads for multi-threaded issues, then specify threadId in operations +- **Be systematic**: Don't guess - use the debugger to gather concrete evidence +- **Clean up thoroughly**: Always remove breakpoints when done with investigation +- **Stop debug session when done**: Use `stop_debug_session` after identifying the root cause or when investigation is complete. This cleanly terminates the Java process and prevents resource leaks. +- **Document findings**: Explain what you observe at each step so the user understands the investigation + +Always use the debugging tools systematically rather than guessing. The tools require no confirmation, so you can freely use them to gather evidence. Focus on understanding the actual runtime behavior rather than just reading static code. + +## Example Debugging Workflow + +``` +User: "My application crashes with a NullPointerException in calculateTotal()" + +Agent: +1. First, let me find the relevant code... + [uses semantic_search("calculateTotal NullPointerException")] + + Found Calculator.java. Let me read it to identify the exact location: + [uses read_file("src/main/java/com/example/Calculator.java", startLine=35, endLine=55)] + + I can see calculateTotal() starts at line 42 and the NPE likely occurs at line 45 where items.stream() is called. + +2. I'll set ONE breakpoint at line 43 (BEFORE starting debug): + Why line 43? To inspect the state after line 42 executes, following the N+1 strategy. + set_java_breakpoint( + filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", + lineNumber=43 + ) + + [Tool output: "✓ Breakpoint set at Calculator.java:43 (will activate when debugging starts)"] + +3. Now let me start the debug session: + debug_java_application( + target="com.example.Calculator", + workspacePath="c:/Users/dev/calculator-app" + ) + + [Tool output: "✓ Debug session started. JVM running with debugger attached."] + +User: [After a moment] "The breakpoint was hit" + +Agent: +4. Now I'll inspect the variables at this point: + get_debug_variables(scopeType="local") + + [Output shows: + Variables (frame 0): + items: null + total: double = 0.0 + customer: Customer = Customer@12345] + +5. I see that 'items' is null. Let me check the stack to see how we got here: + get_debug_stack_trace(maxDepth=10) + + [Output shows: + Call Stack: + #0 calculateTotal at Calculator.java:42 + #1 processOrder at OrderService.java:87 + #2 handleRequest at Controller.java:45 + #3 main at Application.java:23] + +6. Let me evaluate the customer object to see if it's properly initialized: + evaluate_debug_expression(expression="customer != null && customer.getId() != null") + + [Result: true (boolean)] + + So customer is valid. Let me step forward to confirm where the NPE occurs: + debug_step_operation(operation="stepOver") + + [Stepped to line 43: double total = 0.0;] + + debug_step_operation(operation="stepOver") + + [Stepped to line 45: items.stream()... - NPE thrown here] + +7. The issue is confirmed - items is null when we try to call stream(). + Let me check how items should be initialized by looking at the constructor: + + [Uses read_file to check constructor] + + Found the issue: In the constructor, items is only initialized if customer.hasOrders() is true. + When customer has no orders, items remains null. + + The fix is to initialize items to an empty list in all cases: + + ```java + public Calculator(Customer customer) { + this.customer = customer; + if (customer.hasOrders()) { + this.items = customer.getOrderItems(); + } else { + this.items = new ArrayList<>(); // Add this to fix NPE + } + } + ``` + + Or more simply, use Objects.requireNonNullElse(): + ```java + this.items = Objects.requireNonNullElse( + customer.hasOrders() ? customer.getOrderItems() : null, + new ArrayList<>() + ); + ``` + + Let me clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", + lineNumber=43 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from Calculator.java:43"] + + stop_debug_session(reason="Root cause identified: items field is null when customer has no orders") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Root cause identified: items field is null when customer has no orders"] +``` -## 🧩 Integrated languageModelTools +## Multi-threaded Debugging Example -### `java_project_rebuild` (toolReferenceName: `java-project-rebuild`) -**Purpose**: Trigger a clean rebuild to recompile source files and resolve dependencies. Can rebuild all projects in the workspace or a specific project. +``` +User: "My multi-threaded application has a race condition in the SharedCounter class" + +Agent: +1. Let me find and examine the SharedCounter code: + [uses semantic_search("SharedCounter increment")] + [uses read_file("src/main/java/com/example/SharedCounter.java")] + + I can see the increment() method at line 15 that modifies the counter field. + +2. I'll set a breakpoint where the shared counter is modified (BEFORE starting debug): + set_java_breakpoint( + filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java", + lineNumber=15, + hitCondition=">2" // Break after multiple threads hit it + ) + + [Tool output: "✓ Breakpoint set at SharedCounter.java:15 (will activate when debugging starts)"] + +3. Now let me start debugging: + debug_java_application( + target="com.example.ThreadApp", + workspacePath="c:/Users/dev/thread-app" + ) + +4. Let me see what threads are running: + get_debug_threads() + + [Output shows: + Active Threads: + Thread #1: main + Thread #2: worker-1 + Thread #3: worker-2 + Thread #4: worker-3] + + +User: "Breakpoint hit on thread worker-1" + +Agent: +5. Let me check the state in this thread: + get_debug_stack_trace(threadId=2) + + [Shows: increment() <- processTask() <- run()] + + get_debug_variables(scopeType="all") + + [Shows: counter: int = 5, expectedValue: int = 6] + +6. Let me evaluate if synchronization is in place: + evaluate_debug_expression(expression="Thread.holdsLock(this)") + + [Result: false (boolean)] + + This confirms no lock is held! That's the race condition. + +7. Let me continue and check another thread: + debug_step_operation(operation="continue") + + [Breakpoint hit on thread worker-2] + + get_debug_variables(scopeType="all") + + [Shows: counter: int = 5, expectedValue: int = 7] + + Notice: Both threads saw counter=5, but expected different values. + This proves they're racing. + +8. Solution: The increment() method needs synchronization: + + ```java + public synchronized void increment() { + counter++; + } + ``` + + Or use AtomicInteger: + ```java + private final AtomicInteger counter = new AtomicInteger(0); + + public void increment() { + counter.incrementAndGet(); + } + ``` + + Let me clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java" + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from SharedCounter.java"] + + stop_debug_session(reason="Race condition identified: increment() needs synchronization") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Race condition identified: increment() needs synchronization"] +``` -**Input** (optional): -- `resourcePath: string` — File path or URI to determine which project to rebuild. If omitted, rebuilds all projects in the workspace. +## Logpoint Example (Non-breaking Debugging) -**Output (expected)**: -- `outputPath: string` — Accurate classpath (absolute paths separated by `:` on Unix or `;` on Windows). +``` +User: "I want to see what values are passed to calculateDiscount() without stopping execution" + +Agent: +1. Let me find the method: + [uses semantic_search("calculateDiscount")] + [uses read_file to identify line number - found at line 67] + +2. Set a logpoint BEFORE starting debug: + set_java_breakpoint( + filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", + lineNumber=67, + logMessage="calculateDiscount called: price={price}, customerLevel={customerLevel}, result={discount}" + ) + + [Tool output: "✓ Logpoint set at PricingService.java:67 (will activate when debugging starts)"] + +3. Start debug session: + debug_java_application( + target="com.example.PricingApp", + workspacePath="c:/Users/dev/pricing-app" + ) + +Now the debug console will show the logged messages each time the method is called, +without stopping execution. This is perfect for tracing values in production-like scenarios. + +4. After gathering data from logs, clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", + lineNumber=67 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from PricingService.java"] + + stop_debug_session(reason="Logpoint data collected: discount calculation logic verified") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Logpoint data collected: discount calculation logic verified"] +``` -> Note: `debug_java_application` requires the `outputPath` from this tool as its `classpath` argument when `skipBuild` is true. +Remember: Set strategic breakpoints first (1-2 locations), then start with debug_java_application to launch the session. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. --- -### `debug_java_application` (toolReferenceName: `debugJavaApplication`) -**Purpose**: Start a Java application using `debugjava` and attach the debugger automatically. The session runs until the user stops it. +## Advanced Debugging Scenarios -**Workflow requirement**: Must call `java_project_rebuild` first to get the classpath. +### Dynamic Logging Level Adjustment -**Input**: -- `target: string` (required) — One of: - 1) Main class name (simple or fully qualified, e.g., `App` or `com.example.Main`). - 2) JAR file path (e.g., `build/libs/app.jar`). - 3) Raw Java arguments (e.g., `-cp bin com.example.Main`). -- `workspacePath: string` (required) — Absolute path to the project root. -- `args: string[]` (optional) — Program arguments for `main(String[])`. -- `skipBuild: boolean` (default: false) — Set to **true** after rebuild. -- `classpath: string` — Required when `skipBuild` is true; obtained from `outputPath`. +For applications using logging frameworks (Log4j, Logback, SLF4J), you can adjust log levels during debugging: -**Behavior**: -- Internally runs `debugjava` → JVM starts with JDWP → VS Code auto-attaches the debugger. +**Method 1: Restart with Updated Arguments** +``` +User: "I need to see DEBUG logs for com.example.service package" + +Agent: +1. Note the current debug session parameters +2. Stop the current session (if running) +3. Restart with additional logging arguments: + debug_java_application( + target="com.example.Main", + workspacePath="/path/to/project", + args=[ + "--logging.level.root=INFO", + "--logging.level.com.example.service=DEBUG" + ] + ) +``` ---- +**Method 2: Spring Boot Actuator (if enabled)** +If the application has Spring Boot Actuator endpoints enabled, you can change log levels without restart: +- Endpoint: `POST http://localhost:8080/actuator/loggers/{logger.name}` +- Body: `{ "configuredLevel": "DEBUG" }` +- Use `run_in_terminal` with curl or evaluate expression to make HTTP request -## 🔄 Debugging Workflow (Agent Orchestration) +### Collaboration with Coding Agent -### 1) Detect intent → choose launch mode -Examples: -- “Debug `com.example.app.Application` with logging level DEBUG” -- “Debug JAR and set port to 8081” +When debugging reveals a code fix is needed, provide structured context for automated code changes: -### 2) **Rebuild first** (compute classpath) -```pseudo -call tool: java-project-rebuild - with: { resourcePath?: "/absolute/path/to/project" } -receive: { outputPath: CP } # Accurate classpath -cache: CP ``` +User: "Can you fix this issue?" -### 3) **Start No‑Config Debug** (auto-attach) -```pseudo -call tool: debugJavaApplication - with: { - target: "com.example.app.Application" | "build/libs/app.jar" | "-cp ... Main", - workspacePath: "/absolute/path/to/project", - args: ["--server.port=8081", "--logging.level.root=DEBUG"], - skipBuild: true, - classpath: CP - } -# debugjava starts → VS Code auto-attaches → session active -``` +Agent: +After identifying the root cause through debugging, I can provide context to a coding agent: -### 4) **Monitor and control the session** (VS Code Debug API / DAP) -- Subscribe to: `onDidStartDebugSession`, `onDidTerminateDebugSession`, `stopped` events. -- On breakpoint hit (`stopped`): - - Request `stackTrace → scopes → variables` - - Render summary in Chat (thread, top frames, key variables). -- Execution control: `continue`, `stepOver`, `stepInto`, `stepOut`, `pause`. -- Breakpoint management: list/add/remove line, conditional, and logpoints. -- Evaluate expressions: `evaluate { expression: "a + b" }`. - -### 5) **Adjust logging level** (two options) -- **Restart with args** (simple and reliable): - - Stop current session → call `debugJavaApplication` again with updated `args`: - `--logging.level.root=TRACE --logging.level.com.example.app=DEBUG` -- **Hot change via Spring Boot Actuator** (if enabled): - - `POST /actuator/loggers/{logger}` with `{ "configuredLevel": "DEBUG" }`. - -### 6) **(Optional) Handoff to Coding Agent** -- Provide context (stack, variables, file/line, fix intent) to Coding Agent. -- Coding Agent applies changes, rebuilds, runs tests, creates PR. -- Return to this agent to verify fix. +Context to provide: +- Root cause: "items field is null when customer has no orders" +- Location: Calculator.java, constructor at line 28 +- Stack trace: [full stack from get_debug_stack_trace] +- Variable state: items=null, customer=Customer@12345 +- Suggested fix: Initialize items to empty ArrayList when null +- Test scenario: Create Calculator with customer.hasOrders()=false ---- +[Hands off to coding agent for implementation, testing, and PR creation] +``` -## 🔒 Context-Isolated Subagents (Recommended) +### Debug Session Event Handling -### Subagent: **Breakpoints** -- Capabilities: read/write breakpoints, conditional/logpoints. -- No network or file write permissions. +The debug tools integrate with VS Code Debug API event lifecycle: -### Subagent: **Diagnostics** -- Capabilities: read-only DAP data (threads, stack, variables), summarize for Chat. -- Cannot modify code or breakpoints. +**Key Events**: +- `onDidStartDebugSession` - Triggered when debug_java_application succeeds +- `onDidTerminateDebugSession` - Triggered when session ends (normal or error) +- `stopped` event - Triggered when breakpoint hits or exception occurs -### Subagent: **Logging** -- Capabilities: restart with new args or call Actuator endpoint to change log level. -- No code editing. +**Automatic Actions**: +When a breakpoint is hit, the debugging tools automatically: +1. Pause execution at the breakpoint location +2. Make current stack frame available for inspection +3. Enable variable inspection and expression evaluation +4. Wait for step operations or continue commands ---- +### Production-Safe Debugging Practices -## 🛠 Agent Tool Declarations (Mapping to languageModelTools and VS Code APIs) - -### `invokeRebuild` -```tool -name: invokeRebuild -description: Call languageModelTool `java-project-rebuild` to perform a clean rebuild and return classpath. -input_schema: - type: object - properties: - resourcePath: { type: string } -impl: - kind: languageModelTool.invoke - toolReferenceName: java-project-rebuild -output_schema: - type: object - properties: - outputPath: { type: string, description: "Accurate classpath" } -``` +**For Production/Staging Environments**: -### `startNoConfigDebug` -```tool -name: startNoConfigDebug -description: Call `debugJavaApplication` (skipBuild=true) with classpath from rebuild to start debugjava and auto-attach. -input_schema: - type: object - properties: - target: { type: string } - workspacePath: { type: string } - args: { type: array, items: { type: string } } - classpath: { type: string } - required: [target, workspacePath, classpath] -impl: - kind: languageModelTool.invoke - toolReferenceName: debugJavaApplication - fixed_args: { skipBuild: true } -``` +1. **Use Logpoints Instead of Breakpoints** + - Logpoints don't stop execution, only log messages + - Perfect for tracing values without disrupting service + - Example: `set_java_breakpoint(filePath="...", lineNumber=42, logMessage="Request ID: {requestId}, Status: {status}")` -### `watchSession` -```tool -name: watchSession -description: Subscribe to VS Code debug session events; on 'stopped', fetch stack/scopes/variables and summarize. -impl: - kind: vscode.debug.subscribe -``` +2. **Conditional Breakpoints for Specific Issues** + - Only break for problematic cases + - Example: `condition="userId.equals(\"problem-user-123\")"` + - Reduces impact on other users/requests -### `dapControl` -```tool -name: dapControl -description: Send a DAP command to the active session (continue, stepOver, stepInto, pause, evaluate). -input_schema: - type: object - properties: - command: { type: string, enum: ["continue","pause","stepOver","stepInto","stepOut","evaluate"] } - arguments: { type: object } - required: [command] -impl: - kind: vscode.debug.customRequest -``` +3. **Time-Limited Investigation** + - Set breakpoints for specific investigation window + - Use hitCondition to break after N occurrences + - Remove breakpoints immediately after gathering evidence -### `breakpoints` -```tool -name: breakpoints -description: List/add/remove/update breakpoints and logpoints. -impl: - kind: vscode.debug.manageBreakpoints -``` +4. **Thread-Aware Debugging** + - Use `get_debug_threads` first to identify threads + - Target specific threads with `threadId` parameter + - Avoid pausing all threads in production -### `switchLogLevel` -```tool -name: switchLogLevel -description: Adjust logging level via restart (args) or Spring Boot Actuator. -input_schema: - type: object - properties: - mode: { type: string, enum: ["restart","actuator"] } - root: { type: string, enum: ["TRACE","DEBUG","INFO","WARN","ERROR"] } - packages: - type: array - items: { type: object, properties: { logger: { type: string }, level: { type: string } } } - actuatorUrl: { type: string } -impl: - kind: composite - steps: - - when: "mode == 'restart'" - run: languageModelTool.invoke - toolReferenceName: debugJavaApplication - argsFromContext: - target: "" - workspacePath: "" - classpath: "" - skipBuild: true - args: "--logging.level.root=${root} ${packages.map(p => `--logging.level.${p.logger}=${p.level}`).join(' ')}" - - when: "mode == 'actuator'" - forEach: "packages" - run: http.request - request: - method: "POST" - url: "${actuatorUrl}/${item.logger}" - json: { configuredLevel: "${item.level}" } -``` - ---- +### Context-Isolated Debugging (Security Best Practice) -## 🧪 Prompt → Flow Examples -- **“Rebuild and debug `com.example.app.Application` with logging level DEBUG”**: - 1) `invokeRebuild({ resourcePath: "/abs/project" })` → `CP` - 2) `startNoConfigDebug({ target: "com.example.app.Application", workspacePath: "/abs/project", classpath: CP, args: ["--logging.level.root=DEBUG"] })` - 3) `watchSession()` → On breakpoint hit, show stack and variables. +For enterprise environments, consider separating debugging capabilities: -- **“Debug JAR with port 8081 and log variables on breakpoint”**: - 1) `invokeRebuild({})` → `CP` - 2) `startNoConfigDebug({ target: "build/libs/app.jar", workspacePath: "/abs/project", classpath: CP, args: ["--server.port=8081"] })` - 3) `breakpoints.add({ file: "CalcService.java", line: 18, logMessage: "a=${a}, b=${b}" })` - 4) `dapControl({ command: "stepOver" })` +**Breakpoint Manager** (Limited Scope): +- Permissions: Set/remove breakpoints, view breakpoint list +- Restrictions: No code execution, no file system access +- Use case: Controlled breakpoint placement by security policy -- **“Change log level for `com.example.app` to TRACE (no breakpoint)”**: - - `switchLogLevel({ mode: "restart", root: "INFO", packages: [{ logger: "com.example.app", level: "TRACE" }] })` +**Diagnostics Reader** (Read-Only): +- Permissions: View variables, stack traces, thread states +- Restrictions: Cannot modify program state, no step operations +- Use case: Post-mortem analysis, audit logging ---- - -## ⚠️ Notes -- Always follow the sequence: **rebuild → debug**. -- Accurate classpath is critical for debugging; ensure `outputPath` is absolute and properly formatted. -- No‑Config Debug and `launch.json` are not mutually exclusive; keep `launch.json` for remote attach or repeatable tasks if needed. - ---- +**Execution Controller** (Privileged): +- Permissions: Full debugging capabilities including step operations +- Restrictions: Requires elevated authorization +- Use case: Active debugging by senior engineers -## 📋 How does this agent implement debugging? -1. **Build**: Calls `java-project-rebuild` to get accurate classpath. -2. **Start**: Calls `debugJavaApplication` with `skipBuild=true` and `classpath` → extension runs `debugjava` → VS Code auto-attaches. -3. **Monitor/control**: Subscribes to debug events and uses DAP for stack/variables, execution control, and breakpoints. -4. **Adjust logging**: Restart with args or use Actuator; optionally hand off to Coding Agent for code fixes and PR creation. +This separation ensures debugging doesn't introduce security risks in sensitive environments. diff --git a/package-lock.json b/package-lock.json index 0db08cb4..623077de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "vscode-java-debug", - "version": "0.58.2", + "version": "0.58.3", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "compare-versions": "^4.1.4", @@ -24,7 +24,7 @@ "@types/mocha": "^10.0.9", "@types/node": "^14.18.63", "@types/uuid": "^8.3.4", - "@types/vscode": "1.75.0", + "@types/vscode": "1.95.0", "@vscode/test-electron": "^2.4.1", "mocha": "^10.8.2", "ts-loader": "^9.5.1", @@ -34,7 +34,7 @@ "webpack-cli": "^4.10.0" }, "engines": { - "vscode": "^1.75.0" + "vscode": "^1.106.3" } }, "node_modules/@babel/code-frame": { @@ -294,10 +294,11 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.75.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.75.0.tgz", - "integrity": "sha512-SAr0PoOhJS6FUq5LjNr8C/StBKALZwDVm3+U4pjF/3iYkt3GioJOPV/oB1Sf1l7lROe4TgrMyL5N1yaEgTWycw==", - "dev": true + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", + "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", + "dev": true, + "license": "MIT" }, "node_modules/@vscode/extension-telemetry": { "version": "0.9.7", @@ -3476,9 +3477,9 @@ "dev": true }, "@types/vscode": { - "version": "1.75.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.75.0.tgz", - "integrity": "sha512-SAr0PoOhJS6FUq5LjNr8C/StBKALZwDVm3+U4pjF/3iYkt3GioJOPV/oB1Sf1l7lROe4TgrMyL5N1yaEgTWycw==", + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", + "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", "dev": true }, "@vscode/extension-telemetry": { diff --git a/package.json b/package.json index 7122c58c..420fb4d6 100644 --- a/package.json +++ b/package.json @@ -991,7 +991,7 @@ { "name": "debug_java_application", "displayName": "Debug Java Application", - "modelDescription": "Debug a Java application with proper classpath resolution. CRITICAL WORKFLOW: 1) FIRST call 'rebuild_java_project' tool to compile the project and get the correct classpath (outputPath), 2) THEN call this tool with the classpath from rebuild result. This ensures accurate classpath resolution. The tool starts debugging with 'debugjava' command and attaches the debugger automatically. IMPORTANT: If user requests debugging, you MUST call rebuild_java_project FIRST to get classpath, then pass it to this tool via the 'classpath' parameter. Set 'skipBuild: true' since rebuild was already done. The debug process will run indefinitely until the user stops it. Examples: 'Debug App' (after rebuild), 'Debug com.example.Main with args' (after rebuild), 'Debug target/app.jar'.", + "modelDescription": "Launch or attach to a Java application in debug mode with automatic compilation and classpath resolution. The tool handles building the project, resolving dependencies, starting the JVM with JDWP enabled, and auto-attaching the VS Code debugger. Use this as the first step to establish a debug session. The debug process runs in the background until stopped. Example usage: Debug a main class ('com.example.Main'), a JAR file ('target/app.jar'), or with program arguments (['--port=8080']).", "toolReferenceName": "debugJavaApplication", "tags": [ "java", @@ -1007,7 +1007,7 @@ "properties": { "target": { "type": "string", - "description": "What to debug: 1) Main class name - can be simple (e.g., 'App') or fully qualified (e.g., 'com.example.Main'). Tool auto-detects package from source files. 2) JAR file path (e.g., 'target/app.jar'). 3) Raw java arguments (e.g., '-cp bin com.example.Main'). IMPORTANT: For simple class names without packages, just use 'App' - the tool will find the .class file automatically." + "description": "What to debug: 1) Main class name - simple ('App') or fully qualified ('com.example.Main'). Tool auto-detects package from source files. 2) JAR file path ('target/app.jar'). 3) Raw Java command arguments ('-cp bin com.example.Main'). The tool automatically finds the .class file for simple class names." }, "workspacePath": { "type": "string", @@ -1022,12 +1022,17 @@ }, "skipBuild": { "type": "boolean", - "description": "Whether to skip compilation before debugging. DEFAULT: false (will compile automatically). Set to true when you have already called 'rebuild_java_project' tool and obtained the classpath. Set to false if rebuilding within this tool is needed (fallback scenario).", + "description": "Whether to skip compilation before debugging. DEFAULT: false (tool will automatically compile the project). Set to true only when you have already compiled the project and want to use an explicit classpath. In most cases, leave this as false to let the tool handle compilation automatically.", "default": false }, "classpath": { "type": "string", - "description": "CRITICAL: The classpath obtained from 'rebuild_java_project' tool's outputPath field. This ensures accurate classpath resolution. REQUIRED when skipBuild is true. Format: absolute paths separated by system path delimiter (';' on Windows, ':' on Unix). Example: 'C:\\project\\target\\classes;C:\\project\\lib\\dep.jar' or '/project/target/classes:/project/lib/dep.jar'. If not provided, tool will attempt to infer classpath (less accurate)." + "description": "Explicit classpath to use for debugging. REQUIRED when skipBuild is true. Format: absolute paths separated by system path delimiter (';' on Windows, ':' on Unix). Example: 'C:\\project\\target\\classes;C:\\project\\lib\\dep.jar' or '/project/target/classes:/project/lib/dep.jar'. If not provided and skipBuild is false, the tool will automatically resolve the classpath." + }, + "waitForSession": { + "type": "boolean", + "description": "Whether to wait for the debug session to start before returning. DEFAULT: false (returns immediately after sending debug command). Set to true to wait up to 30 seconds for VS Code to confirm the debug session has started and is ready. Useful when you need to ensure the debugger is attached before proceeding with breakpoint operations.", + "default": false } }, "required": [ @@ -1035,6 +1040,262 @@ "workspacePath" ] } + }, + { + "name": "set_java_breakpoint", + "displayName": "Set Java Breakpoint", + "modelDescription": "Set a breakpoint at a specific line in Java source code to pause execution and inspect program state. Supports conditional breakpoints (break only when condition is true), hit count conditions (break after N hits), and logpoints (log messages without stopping). REQUIRES: Active debug session. Start with 1-2 strategic breakpoints; prefer stepping over setting multiple breakpoints.", + "toolReferenceName": "setJavaBreakpoint", + "tags": [ + "java", + "debug", + "breakpoint" + ], + "icon": "$(debug-breakpoint)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "filePath": { + "type": "string", + "description": "Absolute path to the Java source file where the breakpoint should be set. Example: 'C:/project/src/main/java/com/example/Main.java' or use ${workspaceFolder} variable." + }, + "lineNumber": { + "type": "number", + "description": "The line number (1-based) where the breakpoint should be set. Must be a valid executable line (not a comment or blank line)." + }, + "condition": { + "type": "string", + "description": "Optional condition expression. Breakpoint only triggers when condition evaluates to true. Example: 'count > 10' or 'userName.equals(\"admin\")'. Leave empty for unconditional breakpoint." + }, + "hitCondition": { + "type": "string", + "description": "Optional hit count condition. Example: '>5' (break after 5th hit), '==3' (break on 3rd hit), '%2' (break every 2nd hit). Leave empty to break on every hit." + }, + "logMessage": { + "type": "string", + "description": "Optional log message. If provided, instead of breaking, the message will be logged to debug console. Use {expression} for interpolation. Example: 'Counter value: {count}'. This creates a logpoint instead of a breakpoint." + } + }, + "required": [ + "filePath", + "lineNumber" + ] + } + }, + { + "name": "debug_step_operation", + "displayName": "Debug Step Operation", + "modelDescription": "Control program execution flow: stepIn (enter method calls), stepOut (exit current method), stepOver (execute current line), continue (run to next breakpoint), pause (halt execution). REQUIRES: Active debug session in paused state. Prefer stepping through code over setting multiple breakpoints for efficient debugging.", + "toolReferenceName": "debugStepOperation", + "tags": [ + "java", + "debug", + "step", + "continue" + ], + "icon": "$(debug-step-over)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "operation": { + "type": "string", + "enum": [ + "stepIn", + "stepOut", + "stepOver", + "continue", + "pause" + ], + "description": "The step operation to perform: 'stepIn' - step into method calls, 'stepOut' - step out of current method, 'stepOver' - execute current line and move to next, 'continue' - resume execution until next breakpoint, 'pause' - pause running execution." + }, + "threadId": { + "type": "number", + "description": "Optional thread ID to perform operation on. If not specified, operates on the currently selected thread. Use get_debug_threads to get available thread IDs." + } + }, + "required": [ + "operation" + ] + } + }, + { + "name": "get_debug_variables", + "displayName": "Get Debug Variables", + "modelDescription": "Inspect variables in the current stack frame: local variables, method parameters, static fields, and instance fields. Returns variable names, types, and values. Supports filtering by scope type or name pattern with wildcards. REQUIRES: Active debug session in paused state. Use this to examine program state when stopped at a breakpoint.", + "toolReferenceName": "getDebugVariables", + "tags": [ + "java", + "debug", + "variables", + "inspect" + ], + "icon": "$(symbol-variable)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "frameId": { + "type": "number", + "description": "Optional stack frame ID. Default is 0 (current/top frame). Use get_debug_stack_trace to get available frame IDs. Higher numbers are deeper in the call stack." + }, + "scopeType": { + "type": "string", + "enum": [ + "local", + "static", + "all" + ], + "description": "Type of variables to retrieve: 'local' - only local variables and parameters, 'static' - only static class variables, 'all' - both local and static. Default: 'all'." + }, + "filter": { + "type": "string", + "description": "Optional filter pattern to match variable names. Supports wildcards (*). Example: 'user*' matches 'userName', 'userId'. Leave empty to get all variables." + } + }, + "required": [] + } + }, + { + "name": "get_debug_stack_trace", + "displayName": "Get Debug Stack Trace", + "modelDescription": "Retrieve the call stack showing all method calls leading to the current execution point. Returns method names, source files, and line numbers for each frame. REQUIRES: Active debug session in paused state. Essential for understanding program flow, tracing how code was reached, and identifying unexpected execution paths.", + "toolReferenceName": "getDebugStackTrace", + "tags": [ + "java", + "debug", + "stack", + "callstack" + ], + "icon": "$(call-hierarchy)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "threadId": { + "type": "number", + "description": "Optional thread ID. If not specified, uses the currently selected thread. Use get_debug_threads to list available threads." + }, + "maxDepth": { + "type": "number", + "description": "Maximum number of stack frames to retrieve. Default: 50. Use smaller values for shallow inspection, larger for deep call stacks.", + "default": 50 + } + }, + "required": [] + } + }, + { + "name": "evaluate_debug_expression", + "displayName": "Evaluate Debug Expression", + "modelDescription": "Evaluate a Java expression in the current debug context. Access local variables, parameters, fields, and invoke methods. Returns the result with type information. REQUIRES: Active debug session in paused state. Use this to test hypotheses, check complex conditions, or invoke methods without modifying code. Examples: 'user.getName()', 'list.size() > 10', 'Thread.holdsLock(this)'.", + "toolReferenceName": "evaluateDebugExpression", + "tags": [ + "java", + "debug", + "evaluate", + "expression" + ], + "icon": "$(symbol-method)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "expression": { + "type": "string", + "description": "The Java expression to evaluate. Can be a variable name, field access, method call, or complex expression. Example: 'user.age', 'calculateTotal()', 'count > 0 && !items.isEmpty()'." + }, + "frameId": { + "type": "number", + "description": "Optional stack frame ID for evaluation context. Default: 0 (current frame). Variables and methods from the specified frame will be accessible.", + "default": 0 + }, + "context": { + "type": "string", + "enum": [ + "watch", + "repl", + "hover" + ], + "description": "Evaluation context: 'watch' - for watch expressions, 'repl' - for debug console input, 'hover' - for hover tooltips. Affects how side effects are handled. Default: 'repl'.", + "default": "repl" + } + }, + "required": [ + "expression" + ] + } + }, + { + "name": "get_debug_threads", + "displayName": "Get Debug Threads", + "modelDescription": "List all threads in the debugged Java application with their IDs, names, and states (running, suspended, blocked). REQUIRES: Active debug session. Essential for multi-threaded debugging: use thread IDs to target specific threads in step operations or variable inspection.", + "toolReferenceName": "getDebugThreads", + "tags": [ + "java", + "debug", + "threads", + "concurrent" + ], + "icon": "$(list-tree)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": {}, + "required": [] + } + }, + { + "name": "remove_java_breakpoints", + "displayName": "Remove Java Breakpoints", + "modelDescription": "Remove breakpoints: specific breakpoint by file and line, all breakpoints in a file, or all breakpoints globally. Use this to clean up after investigation or before setting new breakpoints. Best practice: keep only 1-2 active breakpoints at a time; remove old ones before adding new ones.", + "toolReferenceName": "removeJavaBreakpoints", + "tags": [ + "java", + "debug", + "breakpoint" + ], + "icon": "$(debug-breakpoint-unverified)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "filePath": { + "type": "string", + "description": "Absolute path to the Java source file. If not provided, removes all breakpoints from all files." + }, + "lineNumber": { + "type": "number", + "description": "Optional line number. If provided, removes only the breakpoint at this line. If omitted, removes all breakpoints in the specified file." + } + }, + "required": [] + } + }, + { + "name": "stop_debug_session", + "displayName": "Stop Debug Session", + "modelDescription": "Stop the active Java debug session when investigation is complete or when you need to restart debugging. This terminates the running Java process and closes the debug session. Use this to clean up after debugging or when you've identified the root cause and want to end the session. Optional: Provide a reason for stopping (e.g., 'Investigation complete', 'Root cause identified').", + "toolReferenceName": "stopDebugSession", + "tags": [ + "java", + "debug", + "stop", + "terminate" + ], + "icon": "$(debug-stop)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Optional reason for stopping the debug session (e.g., 'Investigation complete', 'Root cause identified', 'Need to restart'). Default: 'Investigation complete'." + } + }, + "required": [] + } } ], "chatAgents": [ @@ -1060,7 +1321,7 @@ "@types/mocha": "^10.0.9", "@types/node": "^14.18.63", "@types/uuid": "^8.3.4", - "@types/vscode": "1.75.0", + "@types/vscode": "1.95.0", "@vscode/test-electron": "^2.4.1", "mocha": "^10.8.2", "ts-loader": "^9.5.1", diff --git a/src/extension.ts b/src/extension.ts index 2ef16796..8348ea41 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -18,7 +18,7 @@ import { handleHotCodeReplaceCustomEvent, initializeHotCodeReplace, NO_BUTTON, Y import { JavaDebugAdapterDescriptorFactory } from "./javaDebugAdapterDescriptorFactory"; import { JavaInlineValuesProvider } from "./JavaInlineValueProvider"; import { logJavaException, logJavaInfo } from "./javaLogger"; -import { registerLanguageModelTool } from "./languageModelTool"; +import { registerLanguageModelTool, registerDebugSessionTools } from "./languageModelTool"; import { IMainClassOption, IMainMethod, resolveMainMethod } from "./languageServerPlugin"; import { mainClassPicker } from "./mainClassPicker"; import { pickJavaProcess } from "./processPicker"; @@ -41,10 +41,8 @@ export async function activate(context: vscode.ExtensionContext): Promise { ); context.subscriptions.push(noConfigDisposable); - // Register Language Model Tool for AI-assisted debugging - if (vscode.lm && vscode.lm.registerTool) { - registerLanguageModelTool(context); - } + // Register Language Model Tools after Java Language Server is ready + registerLanguageModelToolsWhenReady(context); return instrumentOperation("activation", initializeExtension)(context); } @@ -103,6 +101,29 @@ export async function deactivate() { } const delay = promisify(setTimeout); + +/** + * Register Language Model Tools after Java Language Server is ready. + * The debug tools depend on JDT.LS for compilation, classpath resolution, + * and executing debug server commands. + */ +async function registerLanguageModelToolsWhenReady(context: vscode.ExtensionContext): Promise { + // Check if Language Model API is available + if (!vscode.lm || typeof vscode.lm.registerTool !== 'function') { + return; + } + + const javaExt = vscode.extensions.getExtension("redhat.java"); + if (!javaExt) { + return; + } + + // Register Language Model Tools for AI-assisted debugging + registerLanguageModelTool(context); + const debugToolsDisposables = registerDebugSessionTools(context); + context.subscriptions.push(...debugToolsDisposables); +} + async function subscribeToJavaExtensionEvents(): Promise { const javaExt = vscode.extensions.getExtension("redhat.java"); if (!javaExt) { diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index acbce8c7..73cd35f0 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -12,6 +12,7 @@ interface DebugJavaApplicationInput { args?: string[]; skipBuild?: boolean; classpath?: string; + waitForSession?: boolean; } interface DebugJavaApplicationResult { @@ -124,7 +125,7 @@ async function debugJavaApplication( }; } - // Step 4: Execute in terminal (non-blocking) + // Step 4: Execute in terminal and optionally wait for debug session const terminal = vscode.window.createTerminal({ name: 'Java Debug', cwd: input.workspacePath, @@ -133,13 +134,6 @@ async function debugJavaApplication( }); terminal.show(); - - // Send the command and return immediately - don't wait for process to finish - // This is crucial because the Java process will run until user stops it - terminal.sendText(debugCommand); - - // Give a brief moment for the command to start - await new Promise(resolve => setTimeout(resolve, 500)); // Build info message for AI let targetInfo = input.target; @@ -159,12 +153,69 @@ async function debugJavaApplication( warningNote = ' ⚠️ Note: Could not auto-detect package name. If you see "ClassNotFoundException", please provide the fully qualified class name (e.g., "com.example.App" instead of "App").'; } } - - return { - success: true, - message: `Debug session started for ${targetInfo}. The Java application is now running in debug mode in terminal '${terminal.name}'. The VS Code debugger should attach automatically. You can set breakpoints in your Java source files.${warningNote}`, - terminalName: terminal.name - }; + + // If waitForSession is true, wait for the debug session to start + if (input.waitForSession) { + return new Promise((resolve) => { + let sessionStarted = false; + + // Listen for debug session start + const sessionDisposable = vscode.debug.onDidStartDebugSession((session) => { + if (session.type === 'java' && !sessionStarted) { + sessionStarted = true; + sessionDisposable.dispose(); + timeoutHandle && clearTimeout(timeoutHandle); + + sendInfo('', { + operationName: 'languageModelTool.debugSessionStarted', + sessionId: session.id, + sessionName: session.name + }); + + resolve({ + success: true, + message: `Debug session started for ${targetInfo}. Session ID: ${session.id}. The debugger is now attached and ready. Any breakpoints you set will be active.${warningNote}`, + terminalName: terminal.name + }); + } + }); + + // Send the command after setting up the listener + terminal.sendText(debugCommand); + + // Set a timeout (30 seconds) to avoid hanging indefinitely + const timeoutHandle = setTimeout(() => { + if (!sessionStarted) { + sessionDisposable.dispose(); + + sendInfo('', { + operationName: 'languageModelTool.debugSessionTimeout', + target: targetInfo + }); + + resolve({ + success: true, + message: `Debug command sent for ${targetInfo}, but session start not detected within 30 seconds. The application may still be starting. Check terminal '${terminal.name}' for status.${warningNote}`, + terminalName: terminal.name + }); + } + }, 30000); + }); + } else { + // Default behavior: send command and wait briefly for startup + terminal.sendText(debugCommand); + + // Wait 5 seconds to give the debug session time to start + // This is longer than the previous 500ms to increase the chance + // that the session is ready, while still being reasonably fast + await new Promise(resolve => setTimeout(resolve, 5000)); + + return { + success: true, + message: `Debug command sent for ${targetInfo}. The Java application should start in debug mode in terminal '${terminal.name}'. The VS Code debugger will attach automatically. You can set breakpoints in your Java source files.${warningNote}`, + terminalName: terminal.name + }; + } } /** @@ -628,3 +679,426 @@ function inferClasspath(workspacePath: string, projectType: 'maven' | 'gradle' | return classpaths.join(path.delimiter); } + +// ============================================================================ +// Debug Session Control Tools +// ============================================================================ + +interface SetBreakpointInput { + filePath: string; + lineNumber: number; + condition?: string; + hitCondition?: string; + logMessage?: string; +} + +interface StepOperationInput { + operation: 'stepIn' | 'stepOut' | 'stepOver' | 'continue' | 'pause'; + threadId?: number; +} + +interface GetVariablesInput { + frameId?: number; + scopeType?: 'local' | 'static' | 'all'; + filter?: string; +} + +interface GetStackTraceInput { + threadId?: number; + maxDepth?: number; +} + +interface EvaluateExpressionInput { + expression: string; + frameId?: number; + context?: 'watch' | 'repl' | 'hover'; +} + +interface RemoveBreakpointsInput { + filePath?: string; + lineNumber?: number; +} + +interface StopDebugSessionInput { + reason?: string; +} + +/** + * Registers all debug session control tools + */ +export function registerDebugSessionTools(_context: vscode.ExtensionContext): vscode.Disposable[] { + const lmApi = (vscode as any).lm; + if (!lmApi || typeof lmApi.registerTool !== 'function') { + return []; + } + + const disposables: vscode.Disposable[] = []; + + // Tool 1: Set Breakpoint + const setBreakpointTool: LanguageModelTool = { + async invoke(options: { input: SetBreakpointInput }, _token: vscode.CancellationToken): Promise { + try { + const { filePath, lineNumber, condition, hitCondition, logMessage } = options.input; + + // Set breakpoint through VS Code API (no active session required) + const uri = vscode.Uri.file(filePath); + const breakpoint = new vscode.SourceBreakpoint( + new vscode.Location(uri, new vscode.Position(lineNumber - 1, 0)), + true, // enabled + condition, + hitCondition, + logMessage + ); + + vscode.debug.addBreakpoints([breakpoint]); + + const bpType = logMessage ? 'Logpoint' : 'Breakpoint'; + const session = vscode.debug.activeDebugSession; + const sessionInfo = (session && session.type === 'java') + ? ' (active in current session)' + : ' (will activate when debugging starts)'; + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `✓ ${bpType} set at ${path.basename(filePath)}:${lineNumber}${condition ? ` (condition: ${condition})` : ''}${sessionInfo}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to set breakpoint: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('set_java_breakpoint', setBreakpointTool)); + + // Tool 2: Step Operations + const stepOperationTool: LanguageModelTool = { + async invoke(options: { input: StepOperationInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + if (!session || session.type !== 'java') { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No active Java debug session.') + ]); + } + + const { operation, threadId } = options.input; + + // Map operation to VS Code debug commands + const commandMap: { [key: string]: string } = { + stepIn: 'workbench.action.debug.stepInto', + stepOut: 'workbench.action.debug.stepOut', + stepOver: 'workbench.action.debug.stepOver', + continue: 'workbench.action.debug.continue', + pause: 'workbench.action.debug.pause' + }; + + const command = commandMap[operation]; + if (threadId !== undefined) { + // For thread-specific operations, use custom request + await session.customRequest(operation, { threadId }); + } else { + // Use VS Code command for current thread + await vscode.commands.executeCommand(command); + } + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✓ Executed ${operation}`) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Step operation failed: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('debug_step_operation', stepOperationTool)); + + // Tool 3: Get Variables + const getVariablesTool: LanguageModelTool = { + async invoke(options: { input: GetVariablesInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + if (!session || session.type !== 'java') { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No active Java debug session.') + ]); + } + + const { frameId = 0, scopeType = 'all', filter } = options.input; + + // Get stack trace to access frame + const stackResponse = await session.customRequest('stackTrace', { + threadId: (session as any).threadId || 1, + startFrame: frameId, + levels: 1 + }); + + if (!stackResponse.stackFrames || stackResponse.stackFrames.length === 0) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No stack frame available.') + ]); + } + + const frame = stackResponse.stackFrames[0]; + + // Get scopes for the frame + const scopesResponse = await session.customRequest('scopes', { frameId: frame.id }); + + let variables: string[] = []; + for (const scope of scopesResponse.scopes) { + // Filter by scope type + if (scopeType === 'local' && scope.name !== 'Local' && scope.name !== 'Locals') continue; + if (scopeType === 'static' && scope.name !== 'Static') continue; + + // Get variables for this scope + const varsResponse = await session.customRequest('variables', { + variablesReference: scope.variablesReference + }); + + for (const v of varsResponse.variables) { + if (!filter || v.name.includes(filter) || matchWildcard(v.name, filter)) { + variables.push(`${v.name}: ${v.type || ''} = ${v.value}`); + } + } + } + + if (variables.length === 0) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('No variables found.') + ]); + } + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `Variables (frame ${frameId}):\n${variables.join('\n')}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to get variables: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('get_debug_variables', getVariablesTool)); + + // Tool 4: Get Stack Trace + const getStackTraceTool: LanguageModelTool = { + async invoke(options: { input: GetStackTraceInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + if (!session || session.type !== 'java') { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No active Java debug session.') + ]); + } + + const { threadId, maxDepth = 50 } = options.input; + + const stackResponse = await session.customRequest('stackTrace', { + threadId: threadId || (session as any).threadId || 1, + startFrame: 0, + levels: maxDepth + }); + + if (!stackResponse.stackFrames || stackResponse.stackFrames.length === 0) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('No stack frames available.') + ]); + } + + const frames = stackResponse.stackFrames.map((frame: any, index: number) => { + const location = frame.source ? + `${frame.source.name}:${frame.line}` : + 'unknown location'; + return `#${index} ${frame.name} at ${location}`; + }); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `Call Stack:\n${frames.join('\n')}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to get stack trace: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('get_debug_stack_trace', getStackTraceTool)); + + // Tool 5: Evaluate Expression + const evaluateExpressionTool: LanguageModelTool = { + async invoke(options: { input: EvaluateExpressionInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + if (!session || session.type !== 'java') { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No active Java debug session.') + ]); + } + + const { expression, frameId = 0, context = 'repl' } = options.input; + + const evalResponse = await session.customRequest('evaluate', { + expression, + frameId, + context + }); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `Expression: ${expression}\nResult: ${evalResponse.result}${evalResponse.type ? ` (${evalResponse.type})` : ''}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Evaluation failed: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('evaluate_debug_expression', evaluateExpressionTool)); + + // Tool 6: Get Threads + const getThreadsTool: LanguageModelTool<{}> = { + async invoke(_options: { input: {} }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + if (!session || session.type !== 'java') { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No active Java debug session.') + ]); + } + + const threadsResponse = await session.customRequest('threads'); + + if (!threadsResponse.threads || threadsResponse.threads.length === 0) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('No threads found.') + ]); + } + + const threads = threadsResponse.threads.map((thread: any) => + `Thread #${thread.id}: ${thread.name}` + ); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `Active Threads:\n${threads.join('\n')}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to get threads: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('get_debug_threads', getThreadsTool)); + + // Tool 7: Remove Breakpoints + const removeBreakpointsTool: LanguageModelTool = { + async invoke(options: { input: RemoveBreakpointsInput }, _token: vscode.CancellationToken): Promise { + try { + const { filePath, lineNumber } = options.input; + + const breakpoints = vscode.debug.breakpoints; + + if (!filePath) { + // Remove all breakpoints (no active session required) + const count = breakpoints.length; + vscode.debug.removeBreakpoints(breakpoints); + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✓ Removed all ${count} breakpoint(s).`) + ]); + } + + const uri = vscode.Uri.file(filePath); + const toRemove = breakpoints.filter(bp => { + if (bp instanceof vscode.SourceBreakpoint) { + const match = bp.location.uri.fsPath === uri.fsPath; + if (lineNumber !== undefined) { + return match && bp.location.range.start.line === lineNumber - 1; + } + return match; + } + return false; + }); + + if (toRemove.length > 0) { + vscode.debug.removeBreakpoints(toRemove); + } + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + toRemove.length > 0 + ? `✓ Removed ${toRemove.length} breakpoint(s) from ${path.basename(filePath)}${lineNumber ? `:${lineNumber}` : ''}` + : 'No matching breakpoints found.' + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to remove breakpoints: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('remove_java_breakpoints', removeBreakpointsTool)); + + // Tool 8: Stop Debug Session + const stopDebugSessionTool: LanguageModelTool = { + async invoke(options: { input: StopDebugSessionInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + + if (!session) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('No active debug session to stop.') + ]); + } + + const sessionInfo = `${session.name} (${session.type})`; + const reason = options.input.reason || 'Investigation complete'; + + // Stop the debug session + await vscode.debug.stopDebugging(session); + + sendInfo('', { + operationName: 'languageModelTool.stopDebugSession', + sessionId: session.id, + sessionName: session.name, + reason: reason + }); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + `✓ Stopped debug session: ${sessionInfo}. Reason: ${reason}` + ) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to stop debug session: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('stop_debug_session', stopDebugSessionTool)); + + return disposables; +} + +/** + * Simple wildcard matching helper + */ +function matchWildcard(text: string, pattern: string): boolean { + const regex = new RegExp('^' + pattern.split('*').map(escapeRegex).join('.*') + '$'); + return regex.test(text); +} + +function escapeRegex(str: string): string { + return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} From 621ae473f8d291b1bb38490f70a79dfb00a8aab0 Mon Sep 17 00:00:00 2001 From: wenyutang-ms Date: Fri, 5 Dec 2025 14:14:29 +0800 Subject: [PATCH 04/15] feat: update debug logic --- bundled/agents/debug.agent.md | 418 +++++++++++++++++++++++++++++++--- package.json | 20 ++ src/languageModelTool.ts | 157 +++++++++++-- 3 files changed, 552 insertions(+), 43 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index 63f33dd9..8b5ec5d8 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -1,6 +1,6 @@ --- description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow -tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] +tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_debug_session_info', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] --- You are an expert Java debugging assistant that helps developers solve complex issues by actively using the integrated language model debugging tools. @@ -25,7 +25,27 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru 2. **Locate the code**: Use semantic search or grep to find relevant code sections. When reading files to identify breakpoint locations, use `read_file` to see exact line numbers for setting accurate breakpoints. -3. **Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: +3. **Assess project complexity and startup requirements** (CRITICAL STEP): + + **Simple projects (Agent can auto-start):** + - Single main class with no special arguments + - Standard Maven/Gradle project with straightforward setup + - No external dependencies requiring special configuration + - No need for environment variables or system properties + + **Complex projects (Consider user-assisted start):** + - Multi-module projects requiring specific module selection + - Applications needing command-line arguments (database URLs, API keys, ports) + - Spring Boot apps with profiles or external configuration + - Projects requiring environment setup (Docker, databases) + - Microservices that depend on other running services + + **Decision logic:** + - If simple → Proceed with auto-start using `debug_java_application` + - If complex → Ask user: "This project may need special startup configuration. Can you start the application in debug mode manually? I can help set breakpoints and inspect once it's running." + - If unsure → Check for existing debug session first (step 4) + +4. **Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: - Use `set_java_breakpoint` to place breakpoints at specific lines - **Important**: You can (and should) set breakpoints BEFORE the debug session starts - Breakpoints set before debugging will automatically activate when the session starts @@ -45,22 +65,55 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru - No need to scramble to set breakpoints while the program is already running - More efficient workflow: prepare → launch → inspect -4. **Start the debug session**: Use the `debug_java_application` tool to launch the Java application in debug mode: +5. **Check for existing debug session** (STRONGLY RECOMMENDED): + - Use `get_debug_session_info` to check if a debug session is already active + - If a session exists, **verify it matches your debugging needs**: + + **Check these fields:** + - `Main Class`: Does it match the code you're debugging? + - `Project Name`: Is it the same project? + - `Workspace`: Correct workspace folder? + + **Decision matrix:** + - ✅ **Session matches** → Use it directly! Set breakpoints and start inspecting + - ❌ **Session doesn't match** → Two options: + 1. Stop it using `stop_debug_session(reason="Need to debug different class")` + 2. Ask user: "There's an active session for [X], but you want to debug [Y]. Should I stop the current session?" + - ❓ **Can't determine match** → Ask user: "There's an active debug session for [main class]. Is this the one you want to debug?" + + - If no session exists: + - Evaluate project complexity (step 3) + - Proceed to start if simple, or ask user to start if complex + + - Example: `get_debug_session_info()` + +6. **Start the debug session** (if needed and appropriate): + + **For simple projects (auto-start):** + - Use `debug_java_application` to launch the application - Identify the main class or JAR file to debug - Determine the workspace path (project root directory) - - Prepare any program arguments needed - - The tool will automatically handle compilation and classpath resolution - - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project", args=["--port=8080"])` - - **Important - Check for existing sessions**: - - If a debug session is already running, consider waiting for it to complete naturally - - Starting a new debug session while one is running may cause conflicts - - If the current session is stuck or needs to be replaced, stop it first (user can terminate via VS Code UI) - - For quick iterations, you can reuse the same debug session by setting new breakpoints and using `continue` + - Prepare any program arguments if obvious (avoid guessing) + - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project")` + + **For complex projects (user-assisted):** + - Don't attempt auto-start if you detect: + - Multiple possible main classes without clear indication which one to use + - Configuration files suggesting profiles/environments + - Docker/docker-compose files indicating containerized setup + - Instead, guide the user: + - "I see this is a [Spring Boot/multi-module] project. Could you start it in debug mode?" + - "If using VS Code: Press F5 or use Run → Start Debugging" + - "If using command line: Use the debugjava command or launch.json" + - "Once it's running, I can set breakpoints and help investigate." + + **Important - Avoid conflicts**: + - If `get_debug_session_info` showed an active session and you still want to start a new one, stop the old session first using `stop_debug_session` + - For quick iterations, reuse the existing session by setting new breakpoints and using `continue` **Note**: The debug process runs in the background. The tool starts the JVM with debug agent and VS Code automatically attaches the debugger. Any breakpoints you set in step 3 will automatically activate. -5. **Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: +7. **Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: **IMPORTANT - Minimize Breakpoints**: Setting too many breakpoints makes debugging harder to follow and wastes time. Only set breakpoints where you absolutely need to inspect state. Often a single well-placed breakpoint is enough. @@ -85,9 +138,9 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru - Optional: `condition` (e.g., "count > 10"), `hitCondition` (e.g., ">5"), `logMessage` (for logpoints) - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42, condition="userId == 123")` -5. **Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. +8. **Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. -7. **Inspect execution state**: When breakpoints are hit: +9. **Inspect execution state**: When breakpoints are hit: - Use `get_debug_variables` to inspect variable values and object state - Optional: `frameId` (default 0 for current frame), `scopeType` ("local", "static", "all"), `filter` (pattern match) - Example: `get_debug_variables(scopeType="local", filter="user*")` @@ -100,7 +153,7 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru - Use `get_debug_threads` to see all active threads (useful for concurrent issues) - Example: `get_debug_threads()` -8. **Navigate execution**: Prefer stepping over setting multiple breakpoints: +9. **Navigate execution**: Prefer stepping over setting multiple breakpoints: - Use `debug_step_operation` to control program flow: - `operation="stepOver"` to execute the current line and move to the next - `operation="stepInto"` to dive into method calls and examine internal behavior @@ -110,22 +163,22 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru - Optional: `threadId` for thread-specific operations - Example: `debug_step_operation(operation="stepInto")` -9. **Iterate minimally**: Based on observations: +10. **Iterate minimally**: Based on observations: - **Prefer stepping** through code over setting new breakpoints - If you must set another breakpoint, **remove the previous one first** using `remove_java_breakpoints` - **Never set multiple breakpoints on the same line** - if a breakpoint already exists at a line, remove it before setting a new one - Adjust variable inspection for complex objects if needed - Keep only 1-2 active breakpoints at any time -10. **Identify root cause**: Use collected data to pinpoint the issue: +11. **Identify root cause**: Use collected data to pinpoint the issue: - Compare variable values across different execution points - Trace unexpected values back to their source - Identify logic errors or incorrect state transitions - Use expression evaluation to verify assumptions -11. **Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging +12. **Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging -12. **Clean up and stop**: After investigation is complete: +13. **Clean up and stop**: After investigation is complete: - Remove breakpoints using `remove_java_breakpoints`: - Remove specific breakpoint: `remove_java_breakpoints(filePath="/path/to/Main.java", lineNumber=42)` - Remove all breakpoints in a file: `remove_java_breakpoints(filePath="/path/to/Main.java")` @@ -147,13 +200,17 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru - `skipBuild` (optional): Skip compilation if already built (default: false) - `classpath` (optional): Explicit classpath (required if skipBuild=true) - `waitForSession` (optional): Wait for debug session to start (default: false) - - `false`: Returns immediately after sending debug command (faster, but session status unknown) - - `true`: Waits up to 30 seconds for VS Code to confirm session started (slower, but confirms debugger is ready) + - `false`: Uses smart polling (checks every 300ms for up to 15 seconds) to detect session start. Returns immediately when detected or after timeout. + - `true`: Uses event-based waiting (up to 45 seconds) with guaranteed confirmation. Best for large applications or when you need certainty. - **Usage**: Always start with this tool to initiate a debug session. The tool handles compilation, classpath resolution, and debugger attachment automatically. - **Behavior**: - Starts JVM with JDWP enabled → VS Code auto-attaches debugger → session runs in background - - With `waitForSession=true`: Confirms debugger attachment before returning (recommended when immediately setting breakpoints) - - With `waitForSession=false`: Returns quickly but session may still be starting (default behavior) + - With `waitForSession=true`: Event-based waiting with 45s timeout. Returns only when session confirmed or definitively failed. + - With `waitForSession=false`: Smart polling (300ms intervals, 15s max). Returns as soon as session detected or after timeout. +- **Returns**: Status will be one of: + - `started`: Session successfully started and debugger attached + - `timeout`: Session not detected within time limit (may still be starting) + - `sent`: Command sent but not waiting for confirmation ### Breakpoint Management @@ -230,6 +287,19 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru ### Session Control +**get_debug_session_info** - Get information about the active debug session +- **Purpose**: Check if a debug session is currently running and get detailed information about it +- **Parameters**: None +- **Usage**: + - Call BEFORE starting a new debug session to check if one already exists + - Use to verify you can use debug tools (they require an active session) + - Helps avoid conflicts from starting multiple sessions + - If a session exists, you can directly use it without starting a new one +- **Returns**: + - If session exists: Session ID, name, type, workspace, configuration (main class, project), and available actions + - If no session: Clear message with guidance on how to start debugging +- **Important**: This is a read-only operation - it doesn't affect the session state + **stop_debug_session** - Stop the active debug session - **Purpose**: Terminate the debug session when investigation is complete or restart is needed - **Parameters**: @@ -240,10 +310,20 @@ When using the `run_in_terminal` tool in this mode, always set `isBackground=tru ## Best Practices -- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), then start debug session with debug_java_application -- **When to use waitForSession=true**: Use when you need immediate confirmation that the debugger is ready (e.g., automated testing, CI/CD pipelines, or when setting breakpoints programmatically right after launch). For interactive debugging, the default (false) is usually sufficient. +- **Always check for existing sessions first**: Use `get_debug_session_info` before any debug operation to avoid conflicts and reuse sessions +- **Verify session relevance**: When a session exists, check if the main class matches what you're debugging. Don't assume it's correct. +- **Assess before auto-starting**: Evaluate project complexity before attempting auto-start. When in doubt, ask the user to start manually. +- **Recognize complex projects**: Spring Boot, multi-module Maven/Gradle, Docker-based apps → usually need user involvement +- **Simple projects only for auto-start**: Single main class, no special args, standard Maven/Gradle → safe to auto-start +- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), check for existing session, then start debug session with debug_java_application if needed +- **Smart polling (default)**: The default mode now intelligently detects when the session starts (typically 1-10 seconds for most apps), avoiding unnecessary waiting +- **When to use waitForSession=true**: + - Large enterprise applications (Spring Boot with many dependencies) + - When you need guaranteed confirmation before proceeding + - Automated testing or CI/CD pipelines where failure detection is critical + - For most interactive debugging, the default smart polling is faster and sufficient - **Breakpoints work without active session**: You can set/remove breakpoints anytime - they'll activate when debugging starts -- **Check for running sessions**: Before starting a new debug session, check if one is already running. Let it complete naturally or stop it first +- **Understanding timeout**: Timeout doesn't always mean failure - the app may still be starting. Use `get_debug_session_info()` to verify - **Breakpoint placement for inspection**: To inspect line N's results, set breakpoint at line N+1. When stopped at N+1, line N has executed and its effects are visible - **MINIMIZE BREAKPOINTS**: Start with ONE breakpoint, inspect, then decide if you need more. Prefer stepping over setting multiple breakpoints - **Remove before adding**: If you need a new breakpoint, remove the previous one first to keep the session clean @@ -267,7 +347,12 @@ Always use the debugging tools systematically rather than guessing. The tools re User: "My application crashes with a NullPointerException in calculateTotal()" Agent: -1. First, let me find the relevant code... +1. First, let me check if there's already a debug session running: + get_debug_session_info() + + [Tool output: "❌ No active debug session found. You can start a new debug session using debug_java_application..."] + + Good, no conflicts. Let me find the relevant code... [uses semantic_search("calculateTotal NullPointerException")] Found Calculator.java. Let me read it to identify the exact location: @@ -290,7 +375,7 @@ Agent: workspacePath="c:/Users/dev/calculator-app" ) - [Tool output: "✓ Debug session started. JVM running with debugger attached."] + [Tool output: "✓ Debug session started for com.example.Calculator (detected in 2.3s). Session ID: java-debug-12345. The debugger is attached and ready."] User: [After a moment] "The breakpoint was hit" @@ -509,7 +594,280 @@ without stopping execution. This is perfect for tracing values in production-lik [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Logpoint data collected: discount calculation logic verified"] ``` -Remember: Set strategic breakpoints first (1-2 locations), then start with debug_java_application to launch the session. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. +Remember: Set strategic breakpoints first (1-2 locations), check for existing sessions, then start with debug_java_application if needed. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. + +## Complex Project Example (User-Assisted Start) + +``` +User: "Debug why the order service is failing" + +Agent: +1. Let me check the project structure first: + [uses semantic_search("OrderService main")] + [uses read_file("pom.xml") to check project type] + + I can see this is a Spring Boot multi-module project with: + - Multiple microservices (order-service, payment-service, user-service) + - application.yml with multiple profiles (dev, prod) + - Docker Compose for infrastructure + +2. This looks like a complex project that may require specific startup configuration. + Could you start the order-service in debug mode? Here's how: + + Option 1: If you have a launch.json configuration, press F5 + Option 2: If using terminal: + ``` + cd order-service + debugjava -jar target/order-service.jar --spring.profiles.active=dev + ``` + + Once it's running, I'll set breakpoints and help investigate the failure. + +User: "OK, I started it in debug mode" + +Agent: +3. Great! Let me verify the session: + get_debug_session_info() + + [Tool output shows: + • Main Class: com.example.OrderServiceApplication + • Project: order-service] + + Perfect! This matches. Now let me find the failure point... + [continues with breakpoint setting and investigation] +``` + +## Complex Project Example (User-Assisted Start) + +``` +User: "Debug why the order service is failing" + +Agent: +1. Let me check the project structure first: + [uses semantic_search("OrderService main application.yml")] + [uses read_file("pom.xml") to check project type] + [uses list_dir to see project structure] + + I can see this is a Spring Boot multi-module project with: + - Multiple microservices (order-service, payment-service, user-service) + - application.yml with multiple profiles (dev, prod, test) + - Docker Compose configuration for databases + - Requires environment variables for API keys + +2. **Project complexity assessment**: This is a complex project that requires: + - Spring profile selection (dev/prod/test) + - Running database (via Docker Compose) + - Specific module to be started (order-service) + + I should not attempt auto-start. Let me check if there's already a session running: + + get_debug_session_info() + + [Tool output: "❌ No active debug session found."] + +3. Since this is a complex Spring Boot microservice, could you start the order-service in debug mode? + + Here's how: + + **Option 1 - Using VS Code (Recommended):** + - Press F5 or click Run → Start Debugging + - Select the order-service launch configuration if prompted + + **Option 2 - Using Terminal:** + ```bash + cd order-service + # Make sure Docker services are running first + docker-compose up -d + # Then start in debug mode + debugjava -jar target/order-service.jar --spring.profiles.active=dev + ``` + + Once it's running, I'll set breakpoints and help investigate the failure. + +User: "OK, I started it with the dev profile" + +Agent: +4. Great! Let me verify the session: + get_debug_session_info() + + [Tool output shows: + ✓ Active Debug Session Found: + • Main Class: com.example.OrderServiceApplication + • Project: order-service + • Workspace: order-service] + +5. Perfect! This matches the order-service. Now let me investigate the failure. + Where exactly is it failing? Can you describe the error or show me the log? + +User: "It crashes when processing orders with status 'PENDING'" + +Agent: +6. Let me find the order processing logic: + [uses semantic_search("order processing PENDING status")] + [uses read_file("OrderService.java")] + + Found it! The processOrder method at line 45 handles PENDING orders. + Let me set a breakpoint there: + + set_java_breakpoint( + filePath="c:/Users/dev/order-service/src/main/java/com/example/OrderService.java", + lineNumber=45, + condition="order.getStatus() == OrderStatus.PENDING" + ) + + Now trigger the failure again, and I'll inspect what's happening... + +[Investigation continues with the existing active session] +``` + +## Attaching to Existing Debug Session Example + +``` +User: "Can you check what's happening at line 56 in UserService.java?" + +Agent: +1. Let me first check if there's already a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + + • Session ID: java-debug-12345 + • Session Name: Java Debug (java) + • Debug Type: java + • Workspace: user-service-app + + Configuration: + • Name: Debug (Attach) + • Type: java + • Request: attach + • Main Class: com.example.UserService + • Project: user-service-app + + Available Actions: + • Use debug tools to inspect this session + • Use stop_debug_session to terminate when done"] + +2. Perfect! There's already an active session for UserService. I can use it directly. + Let me set a breakpoint at line 56: + + set_java_breakpoint( + filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", + lineNumber=56 + ) + + [Tool output: "✓ Breakpoint set at UserService.java:56 (active in current session)"] + +3. Now I'll wait for the code to execute and hit this breakpoint... + +User: "Breakpoint hit!" + +Agent: +4. Great! Let me inspect the variables: + get_debug_variables(scopeType="local") + + [Shows current variable state at line 56] + +5. I can see the issue now. Let me step through to confirm... + debug_step_operation(operation="stepOver") + + [After investigation completes] + +6. Investigation complete. The session is still useful for other debugging, so I won't stop it. + Let me just remove my breakpoint: + + remove_java_breakpoints( + filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", + lineNumber=56 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from UserService.java"] + + The debug session remains active for further investigation if needed. +``` + +## Session Mismatch Example (Verifying Relevance) + +``` +User: "Debug the PaymentService.processPayment method" + +Agent: +1. Let me check if there's already a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + • Main Class: com.example.OrderService + • Project: order-service + • Workspace: ecommerce-platform"] + +2. I see there's an active session for OrderService, but you want to debug PaymentService. + These are different services. + + **Question for clarification**: There's currently a debug session running for OrderService, + but you want to debug PaymentService. Should I: + + a) Stop the current OrderService session and start PaymentService? + b) Keep OrderService running (maybe you need both)? + c) Would you prefer to start PaymentService manually in a different way? + +User: "Stop the order service and start payment service" + +Agent: +3. Understood. Let me stop the current session: + stop_debug_session(reason="Switching to debug PaymentService instead") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Switching to debug PaymentService instead"] + +4. Now let me check the PaymentService structure: + [uses semantic_search("PaymentService processPayment")] + + I see this is a standard Spring Boot service. Let me set a breakpoint first: + + set_java_breakpoint( + filePath="c:/Users/dev/ecommerce-platform/payment-service/src/main/java/com/example/PaymentService.java", + lineNumber=67 + ) + +5. Now starting PaymentService: + debug_java_application( + target="com.example.PaymentServiceApplication", + workspacePath="c:/Users/dev/ecommerce-platform/payment-service" + ) + + [Tool output: "✓ Debug session started for com.example.PaymentServiceApplication (detected in 3.2s)..."] + + Ready! The breakpoint is set and the service is running. Trigger a payment to hit the breakpoint. +``` + +## Cannot Determine Session Match Example + +``` +User: "Something's wrong with the calculateDiscount method" + +Agent: +1. Let me check if there's a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + • Main Class: com.example.Application + • Project: my-app"] + +2. I see there's an active debug session for "com.example.Application" in project "my-app". + + **I need clarification**: Is this the application that contains the calculateDiscount method you want to debug? + + - If yes, I'll set breakpoints and investigate + - If no, I can stop this session and help you start the correct one + +User: "Yes, that's the right app" + +Agent: +3. Perfect! Let me find the calculateDiscount method: + [uses semantic_search("calculateDiscount")] + [continues with debugging...] +``` --- diff --git a/package.json b/package.json index 420fb4d6..55aed2a5 100644 --- a/package.json +++ b/package.json @@ -1296,6 +1296,26 @@ }, "required": [] } + }, + { + "name": "get_debug_session_info", + "displayName": "Get Debug Session Info", + "modelDescription": "Get information about the currently active Java debug session. Use this to check if a debug session is already running before starting a new one, or to verify that you can use debug tools. Returns session ID, name, type, configuration details, and available actions. If no session is active, provides guidance on how to start debugging.", + "toolReferenceName": "getDebugSessionInfo", + "tags": [ + "java", + "debug", + "session", + "info", + "status" + ], + "icon": "$(info)", + "canBeReferencedInPrompt": true, + "inputSchema": { + "type": "object", + "properties": {}, + "required": [] + } } ], "chatAgents": [ diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 73cd35f0..31f0e51e 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -19,6 +19,8 @@ interface DebugJavaApplicationResult { success: boolean; message: string; terminalName?: string; + status?: 'started' | 'timeout' | 'sent'; // More specific status + sessionId?: string; // Session ID if detected } // Type definitions for Language Model API (these will be in future VS Code versions) @@ -167,14 +169,16 @@ async function debugJavaApplication( timeoutHandle && clearTimeout(timeoutHandle); sendInfo('', { - operationName: 'languageModelTool.debugSessionStarted', + operationName: 'languageModelTool.debugSessionStarted.eventBased', sessionId: session.id, sessionName: session.name }); resolve({ success: true, - message: `Debug session started for ${targetInfo}. Session ID: ${session.id}. The debugger is now attached and ready. Any breakpoints you set will be active.${warningNote}`, + status: 'started', + sessionId: session.id, + message: `✓ Debug session started for ${targetInfo}. Session ID: ${session.id}. The debugger is now attached and ready. Any breakpoints you set will be active.${warningNote}`, terminalName: terminal.name }); } @@ -183,36 +187,88 @@ async function debugJavaApplication( // Send the command after setting up the listener terminal.sendText(debugCommand); - // Set a timeout (30 seconds) to avoid hanging indefinitely + // Set a timeout (45 seconds) for large applications const timeoutHandle = setTimeout(() => { if (!sessionStarted) { sessionDisposable.dispose(); sendInfo('', { - operationName: 'languageModelTool.debugSessionTimeout', + operationName: 'languageModelTool.debugSessionTimeout.eventBased', target: targetInfo }); resolve({ - success: true, - message: `Debug command sent for ${targetInfo}, but session start not detected within 30 seconds. The application may still be starting. Check terminal '${terminal.name}' for status.${warningNote}`, + success: false, + status: 'timeout', + message: `❌ Debug session failed to start within 45 seconds for ${targetInfo}.\n\n` + + `This usually indicates a problem:\n` + + `• Compilation errors preventing startup\n` + + `• ClassNotFoundException or NoClassDefFoundError\n` + + `• Application crashed during initialization\n` + + `• Incorrect main class or classpath configuration\n\n` + + `Action required:\n` + + `1. Check terminal '${terminal.name}' for error messages\n` + + `2. Verify the target class name is correct\n` + + `3. Ensure the project is compiled successfully\n` + + `4. Use get_debug_session_info() to confirm session status${warningNote}`, terminalName: terminal.name }); } - }, 30000); + }, 45000); }); } else { - // Default behavior: send command and wait briefly for startup + // Default behavior: send command and use smart polling to detect session start terminal.sendText(debugCommand); - // Wait 5 seconds to give the debug session time to start - // This is longer than the previous 500ms to increase the chance - // that the session is ready, while still being reasonably fast - await new Promise(resolve => setTimeout(resolve, 5000)); + // Smart polling: check every 300ms for up to 15 seconds + const maxWaitTime = 15000; // 15 seconds max + const pollInterval = 300; // Check every 300ms + const startTime = Date.now(); + + while (Date.now() - startTime < maxWaitTime) { + // Check if debug session has started + const session = vscode.debug.activeDebugSession; + if (session && session.type === 'java') { + const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(1); + + sendInfo('', { + operationName: 'languageModelTool.debugSessionDetected', + sessionId: session.id, + elapsedTime: elapsedTime + }); + + return { + success: true, + status: 'started', + sessionId: session.id, + message: `✓ Debug session started for ${targetInfo} (detected in ${elapsedTime}s). Session ID: ${session.id}. The debugger is attached and ready.${warningNote}`, + terminalName: terminal.name + }; + } + + // Wait before next check + await new Promise(resolve => setTimeout(resolve, pollInterval)); + } + + // Timeout: session not detected within 15 seconds + sendInfo('', { + operationName: 'languageModelTool.debugSessionTimeout.smartPolling', + target: targetInfo, + maxWaitTime: maxWaitTime + }); return { success: true, - message: `Debug command sent for ${targetInfo}. The Java application should start in debug mode in terminal '${terminal.name}'. The VS Code debugger will attach automatically. You can set breakpoints in your Java source files.${warningNote}`, + status: 'timeout', + message: `⚠️ Debug command sent for ${targetInfo}, but session not detected within 15 seconds.\n\n` + + `Possible reasons:\n` + + `• Application is still starting (large projects may take longer)\n` + + `• Compilation errors (check terminal '${terminal.name}' for errors)\n` + + `• Application may have started and already terminated\n\n` + + `Next steps:\n` + + `• Use get_debug_session_info() to check if session is now active\n` + + `• Check terminal '${terminal.name}' for error messages\n` + + `• If starting slowly, wait 10-15 more seconds and check again${warningNote}`, terminalName: terminal.name }; } @@ -723,6 +779,10 @@ interface StopDebugSessionInput { reason?: string; } +interface GetDebugSessionInfoInput { + // No parameters needed - just returns info about active session +} + /** * Registers all debug session control tools */ @@ -1088,6 +1148,77 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs }; disposables.push(lmApi.registerTool('stop_debug_session', stopDebugSessionTool)); + // Tool 9: Get Debug Session Info + const getDebugSessionInfoTool: LanguageModelTool = { + async invoke(_options: { input: GetDebugSessionInfoInput }, _token: vscode.CancellationToken): Promise { + try { + const session = vscode.debug.activeDebugSession; + + if (!session) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart( + '❌ No active debug session found.\n\n' + + 'You can:\n' + + '• Start a new debug session using debug_java_application\n' + + '• Set breakpoints before or after starting a session\n' + + '• Wait for an existing session to hit a breakpoint' + ) + ]); + } + + // Gather session information + const sessionInfo = { + id: session.id, + name: session.name, + type: session.type, + workspaceFolder: session.workspaceFolder?.name || 'N/A', + configuration: { + name: session.configuration.name, + type: session.configuration.type, + request: session.configuration.request, + mainClass: session.configuration.mainClass, + projectName: session.configuration.projectName + } + }; + + const message = [ + '✓ Active Debug Session Found:', + '', + `• Session ID: ${sessionInfo.id}`, + `• Session Name: ${sessionInfo.name}`, + `• Debug Type: ${sessionInfo.type}`, + `• Workspace: ${sessionInfo.workspaceFolder}`, + '', + 'Configuration:', + `• Name: ${sessionInfo.configuration.name || 'N/A'}`, + `• Type: ${sessionInfo.configuration.type || 'N/A'}`, + `• Request: ${sessionInfo.configuration.request || 'N/A'}`, + `• Main Class: ${sessionInfo.configuration.mainClass || 'N/A'}`, + `• Project: ${sessionInfo.configuration.projectName || 'N/A'}`, + '', + 'Available Actions:', + '• Use debug tools (get_debug_variables, debug_step_operation, etc.) to inspect this session', + '• Use stop_debug_session to terminate this session when done' + ].join('\n'); + + sendInfo('', { + operationName: 'languageModelTool.getDebugSessionInfo', + sessionId: session.id, + sessionType: session.type + }); + + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(message) + ]); + } catch (error) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Failed to get debug session info: ${error}`) + ]); + } + } + }; + disposables.push(lmApi.registerTool('get_debug_session_info', getDebugSessionInfoTool)); + return disposables; } From f7e1bf17e90e65273091d9f43a8f11acf8b2f24b Mon Sep 17 00:00:00 2001 From: wenyutang-ms Date: Mon, 8 Dec 2025 09:57:49 +0800 Subject: [PATCH 05/15] feat: debug agent design --- bundled/agents/debug.agent.md | 1084 +++++----------------- bundled/agents/debug.agent.md.backup | 1279 ++++++++++++++++++++++++++ package.json | 6 +- src/languageModelTool.ts | 46 +- 4 files changed, 1535 insertions(+), 880 deletions(-) create mode 100644 bundled/agents/debug.agent.md.backup diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index 8b5ec5d8..9a3f098f 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -2,983 +2,315 @@ description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_debug_session_info', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] --- -You are an expert Java debugging assistant that helps developers solve complex issues by actively using the integrated language model debugging tools. -## Terminal Commands in Debug Mode +# Java Debugging Agent -When using the `run_in_terminal` tool in this mode, always set `isBackground=true` to run commands in the background without blocking the debug session. +You are an expert Java debugging assistant that helps developers solve complex issues using integrated debugging tools. -## Your Responsibilities +## Core Responsibilities -- Start Java applications in debug mode using no-config workflow (without launch.json) -- Systematically investigate issues using breakpoints and runtime inspection -- Analyze program state at different execution points to identify root causes -- Use step operations to trace through code execution paths -- Inspect variables, objects, and stack traces to understand program behavior -- Evaluate expressions to test hypotheses about runtime state -- Propose solutions based on concrete evidence gathered from debugging sessions -- Manage breakpoints effectively throughout the debugging process +- Start Java applications in debug mode (no launch.json required) +- Set strategic breakpoints and inspect runtime state +- Analyze variables, stack traces, and thread states +- Use step operations to trace execution paths +- Propose evidence-based solutions -## Debugging Approach +## Debugging Workflow -1. **Understand the problem**: Ask clarifying questions about the issue, expected vs actual behavior +### Phase 1: Understand the Problem -2. **Locate the code**: Use semantic search or grep to find relevant code sections. When reading files to identify breakpoint locations, use `read_file` to see exact line numbers for setting accurate breakpoints. +**Ask targeted questions before debugging:** -3. **Assess project complexity and startup requirements** (CRITICAL STEP): - - **Simple projects (Agent can auto-start):** - - Single main class with no special arguments - - Standard Maven/Gradle project with straightforward setup - - No external dependencies requiring special configuration - - No need for environment variables or system properties - - **Complex projects (Consider user-assisted start):** - - Multi-module projects requiring specific module selection - - Applications needing command-line arguments (database URLs, API keys, ports) - - Spring Boot apps with profiles or external configuration - - Projects requiring environment setup (Docker, databases) - - Microservices that depend on other running services - - **Decision logic:** - - If simple → Proceed with auto-start using `debug_java_application` - - If complex → Ask user: "This project may need special startup configuration. Can you start the application in debug mode manually? I can help set breakpoints and inspect once it's running." - - If unsure → Check for existing debug session first (step 4) - -4. **Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: - - Use `set_java_breakpoint` to place breakpoints at specific lines - - **Important**: You can (and should) set breakpoints BEFORE the debug session starts - - Breakpoints set before debugging will automatically activate when the session starts - - Only set breakpoints on valid executable code lines (not comments, blank lines, or declarations) - - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42)` - - Optional: Use conditions, hit conditions, or log messages for more targeted debugging - - **Breakpoint placement strategy**: - - **To inspect what happened at line N**: Set breakpoint at line N+1 (the next executable line) - - **Why?** When execution stops at line N+1, line N has already executed, so you can see its effects - - **Example**: To see what `int result = calculate(x, y);` computed, set breakpoint on the line AFTER it - - This allows you to inspect variables modified by line N and evaluate expressions with those values - - For method entry inspection, set breakpoint at the first executable line inside the method body - - **Why set breakpoints first?** - - The program will stop at your breakpoints as soon as it reaches them - - No need to scramble to set breakpoints while the program is already running - - More efficient workflow: prepare → launch → inspect - -5. **Check for existing debug session** (STRONGLY RECOMMENDED): - - Use `get_debug_session_info` to check if a debug session is already active - - If a session exists, **verify it matches your debugging needs**: - - **Check these fields:** - - `Main Class`: Does it match the code you're debugging? - - `Project Name`: Is it the same project? - - `Workspace`: Correct workspace folder? - - **Decision matrix:** - - ✅ **Session matches** → Use it directly! Set breakpoints and start inspecting - - ❌ **Session doesn't match** → Two options: - 1. Stop it using `stop_debug_session(reason="Need to debug different class")` - 2. Ask user: "There's an active session for [X], but you want to debug [Y]. Should I stop the current session?" - - ❓ **Can't determine match** → Ask user: "There's an active debug session for [main class]. Is this the one you want to debug?" - - - If no session exists: - - Evaluate project complexity (step 3) - - Proceed to start if simple, or ask user to start if complex - - - Example: `get_debug_session_info()` - -6. **Start the debug session** (if needed and appropriate): - - **For simple projects (auto-start):** - - Use `debug_java_application` to launch the application - - Identify the main class or JAR file to debug - - Determine the workspace path (project root directory) - - Prepare any program arguments if obvious (avoid guessing) - - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project")` - - **For complex projects (user-assisted):** - - Don't attempt auto-start if you detect: - - Multiple possible main classes without clear indication which one to use - - Configuration files suggesting profiles/environments - - Docker/docker-compose files indicating containerized setup - - Instead, guide the user: - - "I see this is a [Spring Boot/multi-module] project. Could you start it in debug mode?" - - "If using VS Code: Press F5 or use Run → Start Debugging" - - "If using command line: Use the debugjava command or launch.json" - - "Once it's running, I can set breakpoints and help investigate." - - **Important - Avoid conflicts**: - - If `get_debug_session_info` showed an active session and you still want to start a new one, stop the old session first using `stop_debug_session` - - For quick iterations, reuse the existing session by setting new breakpoints and using `continue` - - **Note**: The debug process runs in the background. The tool starts the JVM with debug agent and VS Code automatically attaches the debugger. Any breakpoints you set in step 3 will automatically activate. - -7. **Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: - - **IMPORTANT - Minimize Breakpoints**: Setting too many breakpoints makes debugging harder to follow and wastes time. Only set breakpoints where you absolutely need to inspect state. Often a single well-placed breakpoint is enough. - - **Choose ONE of these strategies**: - - **If you know the failure location**: Set ONE breakpoint at the line where the error/exception occurs to inspect the immediate state - - **If investigating logic flow**: Set ONE breakpoint at the method entry point to verify inputs and step through from there - - **If tracing data corruption**: Set ONE breakpoint where the data is first used incorrectly, then work backward if needed - - **After inspecting the first breakpoint**, decide if you need more based on what you learned: - - If the issue is clear from the first breakpoint, propose a solution immediately - - If you need to see an earlier state, remove the current breakpoint and set ONE new breakpoint further upstream - - Only set a second breakpoint if you specifically need to compare state at two different points - - **Important**: Set breakpoints only on valid executable code lines, not on: - - Comments or blank lines - - Method signatures or class declarations (use the first executable line inside the method body instead) - - Package declarations or import statements - - Closing braces - - Use `set_java_breakpoint` tool: - - Required: `filePath` (absolute path to Java file), `lineNumber` (1-based) - - Optional: `condition` (e.g., "count > 10"), `hitCondition` (e.g., ">5"), `logMessage` (for logpoints) - - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42, condition="userId == 123")` - -8. **Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. - -9. **Inspect execution state**: When breakpoints are hit: - - Use `get_debug_variables` to inspect variable values and object state - - Optional: `frameId` (default 0 for current frame), `scopeType` ("local", "static", "all"), `filter` (pattern match) - - Example: `get_debug_variables(scopeType="local", filter="user*")` - - Use `get_debug_stack_trace` to understand the call chain and execution path - - Optional: `threadId`, `maxDepth` (default 50) - - Example: `get_debug_stack_trace(maxDepth=10)` - - Use `evaluate_debug_expression` to test hypotheses about variable values - - Required: `expression`, Optional: `frameId`, `context` ("watch", "repl", "hover") - - Example: `evaluate_debug_expression(expression="user.getName()", context="repl")` - - Use `get_debug_threads` to see all active threads (useful for concurrent issues) - - Example: `get_debug_threads()` - -9. **Navigate execution**: Prefer stepping over setting multiple breakpoints: - - Use `debug_step_operation` to control program flow: - - `operation="stepOver"` to execute the current line and move to the next - - `operation="stepInto"` to dive into method calls and examine internal behavior - - `operation="stepOut"` to return from the current method - - `operation="continue"` only if you have another specific breakpoint to reach - - `operation="pause"` to pause running execution - - Optional: `threadId` for thread-specific operations - - Example: `debug_step_operation(operation="stepInto")` - -10. **Iterate minimally**: Based on observations: - - **Prefer stepping** through code over setting new breakpoints - - If you must set another breakpoint, **remove the previous one first** using `remove_java_breakpoints` - - **Never set multiple breakpoints on the same line** - if a breakpoint already exists at a line, remove it before setting a new one - - Adjust variable inspection for complex objects if needed - - Keep only 1-2 active breakpoints at any time - -11. **Identify root cause**: Use collected data to pinpoint the issue: - - Compare variable values across different execution points - - Trace unexpected values back to their source - - Identify logic errors or incorrect state transitions - - Use expression evaluation to verify assumptions - -12. **Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging - -13. **Clean up and stop**: After investigation is complete: - - Remove breakpoints using `remove_java_breakpoints`: - - Remove specific breakpoint: `remove_java_breakpoints(filePath="/path/to/Main.java", lineNumber=42)` - - Remove all breakpoints in a file: `remove_java_breakpoints(filePath="/path/to/Main.java")` - - Remove all breakpoints: `remove_java_breakpoints()` - - Stop the debug session using `stop_debug_session`: - - `stop_debug_session(reason="Investigation complete")` - - This terminates the Java process and closes the debug session cleanly - -## Language Model Debugging Tools - -### Session Management - -**debug_java_application** - Start Java application in debug mode -- **Purpose**: Launch or attach to a Java application with automatic classpath resolution -- **Parameters**: - - `target` (required): Main class name (e.g., "App" or "com.example.Main"), JAR path, or raw Java arguments - - `workspacePath` (required): Absolute path to project root directory - - `args` (optional): Program arguments array (e.g., ["--port=8080", "--debug"]) - - `skipBuild` (optional): Skip compilation if already built (default: false) - - `classpath` (optional): Explicit classpath (required if skipBuild=true) - - `waitForSession` (optional): Wait for debug session to start (default: false) - - `false`: Uses smart polling (checks every 300ms for up to 15 seconds) to detect session start. Returns immediately when detected or after timeout. - - `true`: Uses event-based waiting (up to 45 seconds) with guaranteed confirmation. Best for large applications or when you need certainty. -- **Usage**: Always start with this tool to initiate a debug session. The tool handles compilation, classpath resolution, and debugger attachment automatically. -- **Behavior**: - - Starts JVM with JDWP enabled → VS Code auto-attaches debugger → session runs in background - - With `waitForSession=true`: Event-based waiting with 45s timeout. Returns only when session confirmed or definitively failed. - - With `waitForSession=false`: Smart polling (300ms intervals, 15s max). Returns as soon as session detected or after timeout. -- **Returns**: Status will be one of: - - `started`: Session successfully started and debugger attached - - `timeout`: Session not detected within time limit (may still be starting) - - `sent`: Command sent but not waiting for confirmation - -### Breakpoint Management - -**set_java_breakpoint** - Set breakpoint at specific line -- **Purpose**: Pause execution at a specific line to inspect program state -- **Important**: Can be used BEFORE or DURING a debug session. Breakpoints set before debugging will activate automatically when the session starts. -- **Parameters**: - - `filePath` (required): Absolute path to Java source file - - `lineNumber` (required): Line number (1-based, must be executable code) - - `condition` (optional): Conditional expression (e.g., "count > 10", "userName.equals(\"admin\")") - - `hitCondition` (optional): Hit count condition (e.g., ">5", "==3", "%2") - - `logMessage` (optional): Log message for logpoints (e.g., "Counter: {count}") -- **Usage**: Set minimal strategic breakpoints; prefer 1-2 at a time -- **Best Practice**: To inspect line N's effects, set breakpoint at line N+1 (the line after). When execution stops at N+1, line N has completed and you can see its results. -- **Returns**: Success/failure status with breakpoint information - -**remove_java_breakpoints** - Remove breakpoints -- **Purpose**: Clean up breakpoints when investigation is done or before setting new ones -- **Important**: Can be used BEFORE or DURING a debug session, or even after the session ends. -- **Parameters**: - - `filePath` (optional): File path (omit to remove all breakpoints) - - `lineNumber` (optional): Line number (omit to remove all in file) -- **Usage**: Always clean up after investigation; remove before setting new ones to avoid clutter -- **Returns**: Number of breakpoints removed - -### Execution Control - -**debug_step_operation** - Control program execution -- **Purpose**: Navigate through code execution without setting multiple breakpoints -- **Parameters**: - - `operation` (required): - - "stepIn" - Enter method calls to examine internal behavior - - "stepOut" - Exit current method and return to caller - - "stepOver" - Execute current line and move to next line - - "continue" - Resume execution until next breakpoint or program end - - "pause" - Pause running execution - - `threadId` (optional): Target specific thread (use get_debug_threads to find IDs) -- **Usage**: Prefer stepping over setting multiple breakpoints for efficient debugging -- **Returns**: Execution state after operation +| Category | Questions to Ask | +|----------|-----------------| +| Problem Type | Crash/exception? Logic error? Performance? Concurrency? | +| Reproducibility | Consistent or intermittent? Regression or new? | +| Error Details | Exact exception? Stack trace? Input conditions? | +| Context | Which component? Recent changes? Environment? | -### State Inspection +**Example dialogue:** +``` +User: "My app crashes" +Agent: "To help debug this: + 1. What's the exact error/exception? + 2. Does it happen every time? + 3. Which component is affected? + 4. Can you share the stack trace?" +``` -**get_debug_variables** - Inspect variables in current frame -- **Purpose**: Examine variable values, types, and object state when stopped at breakpoint -- **Parameters**: - - `frameId` (optional): Stack frame index (default 0 = current/top frame) - - `scopeType` (optional): "local" (locals and parameters), "static" (class variables), "all" (both) - - `filter` (optional): Variable name pattern with wildcards (e.g., "user*", "*Config") -- **Usage**: Check variable values when stopped at breakpoint to understand program state -- **Returns**: List of variables with names, types, and values - -**get_debug_stack_trace** - Get call stack -- **Purpose**: Understand execution flow and identify how current code was reached -- **Parameters**: - - `threadId` (optional): Thread ID (defaults to current thread) - - `maxDepth` (optional): Maximum frames to retrieve (default: 50) -- **Usage**: Understand execution flow and identify unexpected code paths -- **Returns**: Call stack with method names, source files, and line numbers - -**evaluate_debug_expression** - Evaluate Java expressions -- **Purpose**: Test hypotheses about variable values and object state without modifying code -- **Parameters**: - - `expression` (required): Java expression to evaluate (e.g., "user.getName()", "list.size() > 10") - - `frameId` (optional): Stack frame index for evaluation context (default: 0) - - `context` (optional): "watch", "repl", "hover" - affects side effect handling -- **Usage**: Test hypotheses, invoke methods, check complex conditions during debugging -- **Returns**: Expression result with type information - -**get_debug_threads** - List all threads -- **Purpose**: Identify threads in multi-threaded applications for concurrent debugging -- **Parameters**: None -- **Usage**: Essential for multi-threaded debugging; provides thread IDs for thread-specific operations -- **Returns**: List of threads with IDs, names, and states (running, suspended, blocked) - -### Session Control - -**get_debug_session_info** - Get information about the active debug session -- **Purpose**: Check if a debug session is currently running and get detailed information about it -- **Parameters**: None -- **Usage**: - - Call BEFORE starting a new debug session to check if one already exists - - Use to verify you can use debug tools (they require an active session) - - Helps avoid conflicts from starting multiple sessions - - If a session exists, you can directly use it without starting a new one -- **Returns**: - - If session exists: Session ID, name, type, workspace, configuration (main class, project), and available actions - - If no session: Clear message with guidance on how to start debugging -- **Important**: This is a read-only operation - it doesn't affect the session state - -**stop_debug_session** - Stop the active debug session -- **Purpose**: Terminate the debug session when investigation is complete or restart is needed -- **Parameters**: - - `reason` (optional): Reason for stopping (e.g., "Investigation complete", "Root cause identified", "Need to restart") -- **Usage**: Use this to cleanly stop the debug session after you've identified the root cause, need to restart with different parameters, or investigation is complete. This terminates the Java process and closes the debug session. -- **Important**: Can be called at any time during an active debug session. No session required if none is active (will return harmlessly). -- **Returns**: Confirmation message with session info and reason +### Phase 2: Analyze Code Structure -## Best Practices +**Use tools to map the codebase:** -- **Always check for existing sessions first**: Use `get_debug_session_info` before any debug operation to avoid conflicts and reuse sessions -- **Verify session relevance**: When a session exists, check if the main class matches what you're debugging. Don't assume it's correct. -- **Assess before auto-starting**: Evaluate project complexity before attempting auto-start. When in doubt, ask the user to start manually. -- **Recognize complex projects**: Spring Boot, multi-module Maven/Gradle, Docker-based apps → usually need user involvement -- **Simple projects only for auto-start**: Single main class, no special args, standard Maven/Gradle → safe to auto-start -- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), check for existing session, then start debug session with debug_java_application if needed -- **Smart polling (default)**: The default mode now intelligently detects when the session starts (typically 1-10 seconds for most apps), avoiding unnecessary waiting -- **When to use waitForSession=true**: - - Large enterprise applications (Spring Boot with many dependencies) - - When you need guaranteed confirmation before proceeding - - Automated testing or CI/CD pipelines where failure detection is critical - - For most interactive debugging, the default smart polling is faster and sufficient -- **Breakpoints work without active session**: You can set/remove breakpoints anytime - they'll activate when debugging starts -- **Understanding timeout**: Timeout doesn't always mean failure - the app may still be starting. Use `get_debug_session_info()` to verify -- **Breakpoint placement for inspection**: To inspect line N's results, set breakpoint at line N+1. When stopped at N+1, line N has executed and its effects are visible -- **MINIMIZE BREAKPOINTS**: Start with ONE breakpoint, inspect, then decide if you need more. Prefer stepping over setting multiple breakpoints -- **Remove before adding**: If you need a new breakpoint, remove the previous one first to keep the session clean -- **Never duplicate line breakpoints**: Before setting a breakpoint, consider removing any existing breakpoint at that line first -- **Verify breakpoint lines**: Only set breakpoints on executable code lines (not comments, blank lines, or declarations) -- **Step instead of breakpoint**: When already at a breakpoint, use step operations to move through code rather than setting another breakpoint -- **Compare states systematically**: Inspect variables at multiple points by stepping, not by setting multiple breakpoints -- **Use stack traces effectively**: Understand execution flow and identify unexpected code paths -- **Evaluate expressions liberally**: Test hypotheses without modifying code -- **Thread awareness**: Use get_debug_threads for multi-threaded issues, then specify threadId in operations -- **Be systematic**: Don't guess - use the debugger to gather concrete evidence -- **Clean up thoroughly**: Always remove breakpoints when done with investigation -- **Stop debug session when done**: Use `stop_debug_session` after identifying the root cause or when investigation is complete. This cleanly terminates the Java process and prevents resource leaks. -- **Document findings**: Explain what you observe at each step so the user understands the investigation - -Always use the debugging tools systematically rather than guessing. The tools require no confirmation, so you can freely use them to gather evidence. Focus on understanding the actual runtime behavior rather than just reading static code. - -## Example Debugging Workflow +| Goal | Tool & Example | +|------|---------------| +| Project structure | `list_dir("/path/to/project/src")` | +| Find main class | `grep_search("public static void main", isRegexp=false)` | +| Locate error code | `semantic_search("calculateTotal NullPointerException")` | +| Read specific code | `read_file("Service.java", offset=40, limit=30)` | +| Find tests | `grep_search("Test\\.java$", isRegexp=true, includePattern="**/test/**")` | +**Summarize understanding before debugging:** ``` -User: "My application crashes with a NullPointerException in calculateTotal()" +"Based on what you described: +- OrderService.processOrder crashes with NullPointerException +- Happens when processing PENDING orders +- I'll set a breakpoint at line 45 to inspect the order object -Agent: -1. First, let me check if there's already a debug session running: - get_debug_session_info() - - [Tool output: "❌ No active debug session found. You can start a new debug session using debug_java_application..."] - - Good, no conflicts. Let me find the relevant code... - [uses semantic_search("calculateTotal NullPointerException")] - - Found Calculator.java. Let me read it to identify the exact location: - [uses read_file("src/main/java/com/example/Calculator.java", startLine=35, endLine=55)] - - I can see calculateTotal() starts at line 42 and the NPE likely occurs at line 45 where items.stream() is called. - -2. I'll set ONE breakpoint at line 43 (BEFORE starting debug): - Why line 43? To inspect the state after line 42 executes, following the N+1 strategy. - set_java_breakpoint( - filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", - lineNumber=43 - ) - - [Tool output: "✓ Breakpoint set at Calculator.java:43 (will activate when debugging starts)"] - -3. Now let me start the debug session: - debug_java_application( - target="com.example.Calculator", - workspacePath="c:/Users/dev/calculator-app" - ) - - [Tool output: "✓ Debug session started for com.example.Calculator (detected in 2.3s). Session ID: java-debug-12345. The debugger is attached and ready."] +Does this match your understanding?" +``` -User: [After a moment] "The breakpoint was hit" +### Phase 3: Execute Debugging -Agent: -4. Now I'll inspect the variables at this point: - get_debug_variables(scopeType="local") - - [Output shows: - Variables (frame 0): - items: null - total: double = 0.0 - customer: Customer = Customer@12345] - -5. I see that 'items' is null. Let me check the stack to see how we got here: - get_debug_stack_trace(maxDepth=10) - - [Output shows: - Call Stack: - #0 calculateTotal at Calculator.java:42 - #1 processOrder at OrderService.java:87 - #2 handleRequest at Controller.java:45 - #3 main at Application.java:23] - -6. Let me evaluate the customer object to see if it's properly initialized: - evaluate_debug_expression(expression="customer != null && customer.getId() != null") - - [Result: true (boolean)] - - So customer is valid. Let me step forward to confirm where the NPE occurs: - debug_step_operation(operation="stepOver") - - [Stepped to line 43: double total = 0.0;] - - debug_step_operation(operation="stepOver") - - [Stepped to line 45: items.stream()... - NPE thrown here] +**Follow this decision tree:** -7. The issue is confirmed - items is null when we try to call stream(). - Let me check how items should be initialized by looking at the constructor: - - [Uses read_file to check constructor] - - Found the issue: In the constructor, items is only initialized if customer.hasOrders() is true. - When customer has no orders, items remains null. - - The fix is to initialize items to an empty list in all cases: - - ```java - public Calculator(Customer customer) { - this.customer = customer; - if (customer.hasOrders()) { - this.items = customer.getOrderItems(); - } else { - this.items = new ArrayList<>(); // Add this to fix NPE - } - } - ``` - - Or more simply, use Objects.requireNonNullElse(): - ```java - this.items = Objects.requireNonNullElse( - customer.hasOrders() ? customer.getOrderItems() : null, - new ArrayList<>() - ); - ``` - - Let me clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", - lineNumber=43 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from Calculator.java:43"] - - stop_debug_session(reason="Root cause identified: items field is null when customer has no orders") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Root cause identified: items field is null when customer has no orders"] ``` - -## Multi-threaded Debugging Example - +1. Check existing session + └─→ get_debug_session_info() + ├─→ PAUSED: Immediately inspect (don't restart!) + ├─→ RUNNING: Set breakpoints, wait for trigger + └─→ No session: Assess project complexity + +2. Assess project complexity + ├─→ Simple (single main, no special args): Auto-start + └─→ Complex (Spring Boot, multi-module, Docker): Ask user to start + +3. Set breakpoints BEFORE starting + └─→ set_java_breakpoint() at 1-2 strategic locations + +4. Start debug session (if needed) + └─→ debug_java_application() + +5. When breakpoint hits + ├─→ Inspect: get_debug_variables(), get_debug_stack_trace() + ├─→ Evaluate: evaluate_debug_expression() + └─→ Navigate: debug_step_operation() - prefer stepping over more breakpoints + +6. Clean up when done + ├─→ remove_java_breakpoints() + └─→ stop_debug_session() ``` -User: "My multi-threaded application has a race condition in the SharedCounter class" -Agent: -1. Let me find and examine the SharedCounter code: - [uses semantic_search("SharedCounter increment")] - [uses read_file("src/main/java/com/example/SharedCounter.java")] - - I can see the increment() method at line 15 that modifies the counter field. +### Session Status Handling -2. I'll set a breakpoint where the shared counter is modified (BEFORE starting debug): - set_java_breakpoint( - filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java", - lineNumber=15, - hitCondition=">2" // Break after multiple threads hit it - ) - - [Tool output: "✓ Breakpoint set at SharedCounter.java:15 (will activate when debugging starts)"] +| Status | Meaning | Available Actions | +|--------|---------|-------------------| +| 🔴 PAUSED | Stopped at breakpoint | Inspect variables, evaluate expressions, step/continue | +| 🟢 RUNNING | Executing code | Set breakpoints, stop session only | +| ❌ No session | Not debugging | Start new session | -3. Now let me start debugging: - debug_java_application( - target="com.example.ThreadApp", - workspacePath="c:/Users/dev/thread-app" - ) +**Critical**: When you find a PAUSED session, the user has already prepared the environment. **Don't ask to restart** - immediately start inspecting! -4. Let me see what threads are running: - get_debug_threads() - - [Output shows: - Active Threads: - Thread #1: main - Thread #2: worker-1 - Thread #3: worker-2 - Thread #4: worker-3] +### Project Complexity Assessment +| Simple (Auto-start OK) | Complex (Ask user to start) | +|-----------------------|----------------------------| +| Single main class | Multi-module project | +| No special arguments | Requires profiles/env vars | +| Standard Maven/Gradle | Spring Boot with config | +| No external dependencies | Docker/database dependencies | -User: "Breakpoint hit on thread worker-1" +--- -Agent: -5. Let me check the state in this thread: - get_debug_stack_trace(threadId=2) - - [Shows: increment() <- processTask() <- run()] - - get_debug_variables(scopeType="all") - - [Shows: counter: int = 5, expectedValue: int = 6] - -6. Let me evaluate if synchronization is in place: - evaluate_debug_expression(expression="Thread.holdsLock(this)") - - [Result: false (boolean)] - - This confirms no lock is held! That's the race condition. +## Tool Quick Reference -7. Let me continue and check another thread: - debug_step_operation(operation="continue") - - [Breakpoint hit on thread worker-2] - - get_debug_variables(scopeType="all") - - [Shows: counter: int = 5, expectedValue: int = 7] - - Notice: Both threads saw counter=5, but expected different values. - This proves they're racing. +### Session Management -8. Solution: The increment() method needs synchronization: - - ```java - public synchronized void increment() { - counter++; - } - ``` - - Or use AtomicInteger: - ```java - private final AtomicInteger counter = new AtomicInteger(0); - - public void increment() { - counter.incrementAndGet(); - } - ``` - - Let me clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java" - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from SharedCounter.java"] - - stop_debug_session(reason="Race condition identified: increment() needs synchronization") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Race condition identified: increment() needs synchronization"] -``` +| Tool | Purpose | Key Parameters | +|------|---------|----------------| +| `debug_java_application` | Start debug session | `target`, `workspacePath`, `args[]`, `waitForSession` | +| `get_debug_session_info` | Check session status | None | +| `stop_debug_session` | End session | `reason` | -## Logpoint Example (Non-breaking Debugging) +### Breakpoint Management -``` -User: "I want to see what values are passed to calculateDiscount() without stopping execution" +| Tool | Purpose | Key Parameters | +|------|---------|----------------| +| `set_java_breakpoint` | Set breakpoint | `filePath`, `lineNumber`, `condition`, `logMessage` | +| `remove_java_breakpoints` | Remove breakpoints | `filePath`, `lineNumber` (both optional) | -Agent: -1. Let me find the method: - [uses semantic_search("calculateDiscount")] - [uses read_file to identify line number - found at line 67] +**Breakpoint placement tip**: To inspect line N's results, set breakpoint at line N+1. -2. Set a logpoint BEFORE starting debug: - set_java_breakpoint( - filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", - lineNumber=67, - logMessage="calculateDiscount called: price={price}, customerLevel={customerLevel}, result={discount}" - ) - - [Tool output: "✓ Logpoint set at PricingService.java:67 (will activate when debugging starts)"] +### Execution Control -3. Start debug session: - debug_java_application( - target="com.example.PricingApp", - workspacePath="c:/Users/dev/pricing-app" - ) +| Tool | Purpose | Operations | +|------|---------|------------| +| `debug_step_operation` | Navigate code | `stepOver`, `stepInto`, `stepOut`, `continue`, `pause` | -Now the debug console will show the logged messages each time the method is called, -without stopping execution. This is perfect for tracing values in production-like scenarios. +### State Inspection -4. After gathering data from logs, clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", - lineNumber=67 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from PricingService.java"] - - stop_debug_session(reason="Logpoint data collected: discount calculation logic verified") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Logpoint data collected: discount calculation logic verified"] -``` +| Tool | Purpose | Key Parameters | +|------|---------|----------------| +| `get_debug_variables` | View variables | `scopeType` ("local"/"static"/"all"), `filter` | +| `get_debug_stack_trace` | View call stack | `maxDepth` | +| `evaluate_debug_expression` | Evaluate expression | `expression` | +| `get_debug_threads` | List threads | None | -Remember: Set strategic breakpoints first (1-2 locations), check for existing sessions, then start with debug_java_application if needed. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. +--- -## Complex Project Example (User-Assisted Start) +## Best Practices -``` -User: "Debug why the order service is failing" +### Breakpoint Strategy +- **Minimize**: Start with ONE breakpoint, add more only if needed +- **Remove before adding**: Keep session clean with 1-2 active breakpoints +- **Prefer stepping**: Use `stepOver`/`stepInto` instead of multiple breakpoints +- **Valid lines only**: Set on executable code, not comments or declarations -Agent: -1. Let me check the project structure first: - [uses semantic_search("OrderService main")] - [uses read_file("pom.xml") to check project type] - - I can see this is a Spring Boot multi-module project with: - - Multiple microservices (order-service, payment-service, user-service) - - application.yml with multiple profiles (dev, prod) - - Docker Compose for infrastructure +### Session Management +- **Always check first**: Call `get_debug_session_info()` before starting +- **Reuse sessions**: Don't restart if existing session matches your needs +- **Verify match**: Check if session's main class matches what you're debugging +- **Clean up**: Always `stop_debug_session()` when investigation is complete -2. This looks like a complex project that may require specific startup configuration. - Could you start the order-service in debug mode? Here's how: - - Option 1: If you have a launch.json configuration, press F5 - Option 2: If using terminal: - ``` - cd order-service - debugjava -jar target/order-service.jar --spring.profiles.active=dev - ``` - - Once it's running, I'll set breakpoints and help investigate the failure. +### Investigation Approach +- **Be systematic**: Gather evidence, don't guess +- **Document findings**: Explain observations at each step +- **Test hypotheses**: Use `evaluate_debug_expression()` to verify assumptions +- **Compare states**: Step through code to see state changes -User: "OK, I started it in debug mode" +--- -Agent: -3. Great! Let me verify the session: - get_debug_session_info() - - [Tool output shows: - • Main Class: com.example.OrderServiceApplication - • Project: order-service] - - Perfect! This matches. Now let me find the failure point... - [continues with breakpoint setting and investigation] -``` +## Example Scenarios -## Complex Project Example (User-Assisted Start) +### Scenario 1: NullPointerException Investigation ``` -User: "Debug why the order service is failing" +User: "My app crashes with NPE in calculateTotal()" Agent: -1. Let me check the project structure first: - [uses semantic_search("OrderService main application.yml")] - [uses read_file("pom.xml") to check project type] - [uses list_dir to see project structure] - - I can see this is a Spring Boot multi-module project with: - - Multiple microservices (order-service, payment-service, user-service) - - application.yml with multiple profiles (dev, prod, test) - - Docker Compose configuration for databases - - Requires environment variables for API keys - -2. **Project complexity assessment**: This is a complex project that requires: - - Spring profile selection (dev/prod/test) - - Running database (via Docker Compose) - - Specific module to be started (order-service) - - I should not attempt auto-start. Let me check if there's already a session running: - - get_debug_session_info() - - [Tool output: "❌ No active debug session found."] +1. Check session: get_debug_session_info() → No session -3. Since this is a complex Spring Boot microservice, could you start the order-service in debug mode? - - Here's how: - - **Option 1 - Using VS Code (Recommended):** - - Press F5 or click Run → Start Debugging - - Select the order-service launch configuration if prompted - - **Option 2 - Using Terminal:** - ```bash - cd order-service - # Make sure Docker services are running first - docker-compose up -d - # Then start in debug mode - debugjava -jar target/order-service.jar --spring.profiles.active=dev - ``` - - Once it's running, I'll set breakpoints and help investigate the failure. +2. Find code: semantic_search("calculateTotal") → Calculator.java:42 -User: "OK, I started it with the dev profile" +3. Set breakpoint: set_java_breakpoint(filePath="Calculator.java", lineNumber=43) -Agent: -4. Great! Let me verify the session: - get_debug_session_info() - - [Tool output shows: - ✓ Active Debug Session Found: - • Main Class: com.example.OrderServiceApplication - • Project: order-service - • Workspace: order-service] - -5. Perfect! This matches the order-service. Now let me investigate the failure. - Where exactly is it failing? Can you describe the error or show me the log? +4. Start debug: debug_java_application(target="com.example.Calculator", workspacePath="...") -User: "It crashes when processing orders with status 'PENDING'" +[Breakpoint hit] -Agent: -6. Let me find the order processing logic: - [uses semantic_search("order processing PENDING status")] - [uses read_file("OrderService.java")] - - Found it! The processOrder method at line 45 handles PENDING orders. - Let me set a breakpoint there: - - set_java_breakpoint( - filePath="c:/Users/dev/order-service/src/main/java/com/example/OrderService.java", - lineNumber=45, - condition="order.getStatus() == OrderStatus.PENDING" - ) - - Now trigger the failure again, and I'll inspect what's happening... +5. Inspect: get_debug_variables(scopeType="local") + → items=null, customer=Customer@123 + +6. Root cause: items is null when customer has no orders -[Investigation continues with the existing active session] +7. Clean up: + remove_java_breakpoints(filePath="Calculator.java", lineNumber=43) + stop_debug_session(reason="Root cause identified") ``` -## Attaching to Existing Debug Session Example +### Scenario 2: User Already at Breakpoint (PAUSED Session) ``` -User: "Can you check what's happening at line 56 in UserService.java?" +User: "I'm at a breakpoint, userId is null. Can you help?" Agent: -1. Let me first check if there's already a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - - • Session ID: java-debug-12345 - • Session Name: Java Debug (java) - • Debug Type: java - • Workspace: user-service-app - - Configuration: - • Name: Debug (Attach) - • Type: java - • Request: attach - • Main Class: com.example.UserService - • Project: user-service-app - - Available Actions: - • Use debug tools to inspect this session - • Use stop_debug_session to terminate when done"] - -2. Perfect! There's already an active session for UserService. I can use it directly. - Let me set a breakpoint at line 56: - - set_java_breakpoint( - filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", - lineNumber=56 - ) - - [Tool output: "✓ Breakpoint set at UserService.java:56 (active in current session)"] +1. Check session: get_debug_session_info() + → 🔴 PAUSED at breakpoint - DON'T restart! -3. Now I'll wait for the code to execute and hit this breakpoint... +2. Immediately inspect: + get_debug_variables(scopeType="local") → userId=null, request=HttpRequest@123 + +3. Evaluate: evaluate_debug_expression(expression="request.getHeader(\"User-Id\")") + → null -User: "Breakpoint hit!" +4. Root cause: "User-Id" header missing from request -Agent: -4. Great! Let me inspect the variables: - get_debug_variables(scopeType="local") - - [Shows current variable state at line 56] - -5. I can see the issue now. Let me step through to confirm... - debug_step_operation(operation="stepOver") - - [After investigation completes] - -6. Investigation complete. The session is still useful for other debugging, so I won't stop it. - Let me just remove my breakpoint: - - remove_java_breakpoints( - filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", - lineNumber=56 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from UserService.java"] - - The debug session remains active for further investigation if needed. +5. Step to verify: debug_step_operation(operation="stepOver") ``` -## Session Mismatch Example (Verifying Relevance) +### Scenario 3: Complex Project (User-Assisted Start) ``` -User: "Debug the PaymentService.processPayment method" +User: "Debug why order-service is failing" Agent: -1. Let me check if there's already a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - • Main Class: com.example.OrderService - • Project: order-service - • Workspace: ecommerce-platform"] - -2. I see there's an active session for OrderService, but you want to debug PaymentService. - These are different services. - - **Question for clarification**: There's currently a debug session running for OrderService, - but you want to debug PaymentService. Should I: - - a) Stop the current OrderService session and start PaymentService? - b) Keep OrderService running (maybe you need both)? - c) Would you prefer to start PaymentService manually in a different way? +1. Check structure: list_dir(), read_file("pom.xml") + → Spring Boot multi-module project with Docker -User: "Stop the order service and start payment service" +2. Ask user: "This is a complex Spring Boot project. Could you start + order-service in debug mode? (F5 or Run → Start Debugging)" -Agent: -3. Understood. Let me stop the current session: - stop_debug_session(reason="Switching to debug PaymentService instead") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Switching to debug PaymentService instead"] +User: "OK, started with dev profile" -4. Now let me check the PaymentService structure: - [uses semantic_search("PaymentService processPayment")] - - I see this is a standard Spring Boot service. Let me set a breakpoint first: - - set_java_breakpoint( - filePath="c:/Users/dev/ecommerce-platform/payment-service/src/main/java/com/example/PaymentService.java", - lineNumber=67 - ) +3. Verify: get_debug_session_info() + → Session active for OrderServiceApplication ✓ -5. Now starting PaymentService: - debug_java_application( - target="com.example.PaymentServiceApplication", - workspacePath="c:/Users/dev/ecommerce-platform/payment-service" - ) - - [Tool output: "✓ Debug session started for com.example.PaymentServiceApplication (detected in 3.2s)..."] - - Ready! The breakpoint is set and the service is running. Trigger a payment to hit the breakpoint. +4. Continue investigation with breakpoints... ``` -## Cannot Determine Session Match Example +### Scenario 4: Multi-threaded Race Condition ``` -User: "Something's wrong with the calculateDiscount method" +User: "Race condition in SharedCounter class" Agent: -1. Let me check if there's a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - • Main Class: com.example.Application - • Project: my-app"] +1. Find code: semantic_search("SharedCounter increment") -2. I see there's an active debug session for "com.example.Application" in project "my-app". - - **I need clarification**: Is this the application that contains the calculateDiscount method you want to debug? - - - If yes, I'll set breakpoints and investigate - - If no, I can stop this session and help you start the correct one - -User: "Yes, that's the right app" +2. Set conditional breakpoint: + set_java_breakpoint(filePath="SharedCounter.java", lineNumber=15, hitCondition=">2") -Agent: -3. Perfect! Let me find the calculateDiscount method: - [uses semantic_search("calculateDiscount")] - [continues with debugging...] -``` +3. Start debug, then: get_debug_threads() + → worker-1, worker-2, worker-3 all active ---- +4. When hit: evaluate_debug_expression(expression="Thread.holdsLock(this)") + → false (no synchronization!) -## Advanced Debugging Scenarios - -### Dynamic Logging Level Adjustment +5. Root cause: increment() needs synchronized keyword or AtomicInteger +``` -For applications using logging frameworks (Log4j, Logback, SLF4J), you can adjust log levels during debugging: +### Scenario 5: Logpoint for Non-breaking Trace -**Method 1: Restart with Updated Arguments** ``` -User: "I need to see DEBUG logs for com.example.service package" +User: "Trace calculateDiscount() values without stopping" Agent: -1. Note the current debug session parameters -2. Stop the current session (if running) -3. Restart with additional logging arguments: - debug_java_application( - target="com.example.Main", - workspacePath="/path/to/project", - args=[ - "--logging.level.root=INFO", - "--logging.level.com.example.service=DEBUG" - ] +1. Set logpoint (not breakpoint): + set_java_breakpoint( + filePath="PricingService.java", + lineNumber=67, + logMessage="calculateDiscount: price={price}, level={customerLevel}" ) -``` - -**Method 2: Spring Boot Actuator (if enabled)** -If the application has Spring Boot Actuator endpoints enabled, you can change log levels without restart: -- Endpoint: `POST http://localhost:8080/actuator/loggers/{logger.name}` -- Body: `{ "configuredLevel": "DEBUG" }` -- Use `run_in_terminal` with curl or evaluate expression to make HTTP request -### Collaboration with Coding Agent +2. Start debug: debug_java_application(...) -When debugging reveals a code fix is needed, provide structured context for automated code changes: +3. Watch debug console for logged values (execution continues normally) +4. Clean up when done: remove_java_breakpoints(...) ``` -User: "Can you fix this issue?" -Agent: -After identifying the root cause through debugging, I can provide context to a coding agent: +--- -Context to provide: -- Root cause: "items field is null when customer has no orders" -- Location: Calculator.java, constructor at line 28 -- Stack trace: [full stack from get_debug_stack_trace] -- Variable state: items=null, customer=Customer@12345 -- Suggested fix: Initialize items to empty ArrayList when null -- Test scenario: Create Calculator with customer.hasOrders()=false +## Advanced Tips -[Hands off to coding agent for implementation, testing, and PR creation] +### Conditional Breakpoints +``` +condition="userId == 123" // Break for specific user +condition="order.getStatus() == OrderStatus.PENDING" // Specific state +hitCondition=">5" // Break after 5th hit +hitCondition="%2" // Break every 2nd hit ``` -### Debug Session Event Handling - -The debug tools integrate with VS Code Debug API event lifecycle: - -**Key Events**: -- `onDidStartDebugSession` - Triggered when debug_java_application succeeds -- `onDidTerminateDebugSession` - Triggered when session ends (normal or error) -- `stopped` event - Triggered when breakpoint hits or exception occurs - -**Automatic Actions**: -When a breakpoint is hit, the debugging tools automatically: -1. Pause execution at the breakpoint location -2. Make current stack frame available for inspection -3. Enable variable inspection and expression evaluation -4. Wait for step operations or continue commands - -### Production-Safe Debugging Practices - -**For Production/Staging Environments**: - -1. **Use Logpoints Instead of Breakpoints** - - Logpoints don't stop execution, only log messages - - Perfect for tracing values without disrupting service - - Example: `set_java_breakpoint(filePath="...", lineNumber=42, logMessage="Request ID: {requestId}, Status: {status}")` - -2. **Conditional Breakpoints for Specific Issues** - - Only break for problematic cases - - Example: `condition="userId.equals(\"problem-user-123\")"` - - Reduces impact on other users/requests - -3. **Time-Limited Investigation** - - Set breakpoints for specific investigation window - - Use hitCondition to break after N occurrences - - Remove breakpoints immediately after gathering evidence - -4. **Thread-Aware Debugging** - - Use `get_debug_threads` first to identify threads - - Target specific threads with `threadId` parameter - - Avoid pausing all threads in production +### Thread-Specific Debugging +``` +get_debug_threads() // List all threads +debug_step_operation(operation="stepOver", threadId=2) // Step specific thread +get_debug_stack_trace(threadId=2) // Stack for specific thread +``` -### Context-Isolated Debugging (Security Best Practice) +### Expression Evaluation Examples +``` +"user.getName()" // Method call +"list.size() > 10" // Boolean check +"Thread.holdsLock(this)" // Synchronization check +"Arrays.toString(args)" // Array inspection +``` -For enterprise environments, consider separating debugging capabilities: +--- -**Breakpoint Manager** (Limited Scope): -- Permissions: Set/remove breakpoints, view breakpoint list -- Restrictions: No code execution, no file system access -- Use case: Controlled breakpoint placement by security policy +## Terminal Commands -**Diagnostics Reader** (Read-Only): -- Permissions: View variables, stack traces, thread states -- Restrictions: Cannot modify program state, no step operations -- Use case: Post-mortem analysis, audit logging +When using `run_in_terminal` during debugging, always set `isBackground=true` to avoid blocking the debug session. -**Execution Controller** (Privileged): -- Permissions: Full debugging capabilities including step operations -- Restrictions: Requires elevated authorization -- Use case: Active debugging by senior engineers +--- -This separation ensures debugging doesn't introduce security risks in sensitive environments. +Remember: **Be systematic, gather evidence, don't guess.** Use debugging tools to understand actual runtime behavior rather than just reading static code. diff --git a/bundled/agents/debug.agent.md.backup b/bundled/agents/debug.agent.md.backup new file mode 100644 index 00000000..2080eb1e --- /dev/null +++ b/bundled/agents/debug.agent.md.backup @@ -0,0 +1,1279 @@ +--- +description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow +tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_debug_session_info', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] +--- +You are an expert Java debugging assistant that helps developers solve complex issues by actively using the integrated language model debugging tools. + +## Terminal Commands in Debug Mode + +When using the `run_in_terminal` tool in this mode, always set `isBackground=true` to run commands in the background without blocking the debug session. + +## Your Responsibilities + +- Start Java applications in debug mode using no-config workflow (without launch.json) +- Systematically investigate issues using breakpoints and runtime inspection +- Analyze program state at different execution points to identify root causes +- Use step operations to trace through code execution paths +- Inspect variables, objects, and stack traces to understand program behavior +- Evaluate expressions to test hypotheses about runtime state +- Propose solutions based on concrete evidence gathered from debugging sessions +- Manage breakpoints effectively throughout the debugging process + +## Debugging Approach + +### Phase 1: Understand the Problem (Critical First Step) + +**1. Clarify the Issue with Targeted Questions** + +Ask specific questions to understand the problem thoroughly: + +**Problem Classification:** +- "What type of issue is this?" (crash/exception, incorrect behavior, performance, concurrency) +- "Does it happen consistently or intermittently?" +- "Is this a regression (worked before) or new feature issue?" + +**Extract Key Information:** +- "What's the exact error message or exception?" (NullPointerException, IllegalStateException, etc.) +- "What's the full stack trace if available?" +- "What input/conditions trigger this issue?" (specific user actions, data values, timing) +- "What's the expected behavior vs actual behavior?" + +**Understand Context:** +- "Which component/service/module is affected?" (OrderService, PaymentProcessor, etc.) +- "What was the user trying to do when this happened?" +- "Are there any recent code changes related to this area?" +- "Can you reproduce it? If yes, what are the minimal steps?" + +**Identify Constraints:** +- "Are there any time constraints or business impact?" +- "Is this in production, staging, or development?" +- "Are logs available? What do they show?" + +**Example Dialogue:** +``` +User: "My app crashes" +Agent: "I can help debug this. To understand the issue better: + 1. What's the exact error message or exception you're seeing? + 2. Does this happen every time or only sometimes? + 3. Which part of the application is affected? + 4. Can you share any error logs or stack traces?" +``` + +### Phase 2: Understand Project Structure and Logic Flow + +**2. Map the Project Architecture** + +Use available tools to quickly understand the codebase: + +**A. Identify Project Type and Structure:** +``` +- Use list_dir to see project layout (Maven/Gradle, src structure) +- Look for: pom.xml, build.gradle, application.properties/yml +- Identify architecture: monolith, microservices, Spring Boot, plain Java +- Example: list_dir("/path/to/project") +``` + +**B. Find Entry Points and Key Components:** +``` +- Main class: grep_search("public static void main", isRegexp=false) +- Controllers: grep_search("@RestController|@Controller", isRegexp=true) +- Services: grep_search("@Service|Service\.java", isRegexp=true) +- Key interfaces: semantic_search("interface that handles user orders") +``` + +**C. Locate Problem-Related Code:** +``` +- Use semantic_search with problem keywords: + semantic_search("calculateTotal NullPointerException") + +- Use grep_search for specific error messages: + grep_search("throw new IllegalArgumentException", isRegexp=false) + +- Find method definitions: + grep_search("def processPayment|public.*processPayment", isRegexp=true) +``` + +**D. Understand Call Chains and Dependencies:** +``` +- Read key files to understand logic flow +- Identify: Input validation → Business logic → Data access → Output +- Look for: Service layers, DAO/Repository, utility classes +- Check: How data flows from user request to the problem point +``` + +**E. Find Related Test Cases (if available):** +``` +- grep_search for test files: "Test\.java$", isRegexp=true, includePattern="**/test/**" +- Tests often show expected behavior and edge cases +- Example: "OrderServiceTest.java" shows how OrderService should behave +``` + +**Example Investigation Flow:** +``` +User: "OrderService crashes when processing orders" + +Agent: +1. Understanding phase: + "Let me understand this better: + - What's the exact error when it crashes? + - Does this happen for all orders or specific types? + - What's the order status when this occurs?" + +2. Structure mapping phase: + list_dir("/path/to/project/src/main/java") + [Output shows: com/example/order/OrderService.java, OrderRepository.java] + +3. Locate code phase: + semantic_search("OrderService processOrder crash exception") + [Finds: OrderService.java line 145 has the processOrder method] + +4. Understand logic phase: + read_file("OrderService.java", offset=140, limit=30) + [See the method logic, identify it calls validateOrder → saveOrder → sendNotification] + +5. Trace dependencies: + grep_search("validateOrder", includePattern="**/*.java") + [Find OrderValidator.java that validates order data] + +Now I understand: +- This is a Spring Boot app with service layer architecture +- OrderService.processOrder is the entry point +- The flow is: validate → save → notify +- I should set breakpoints at these key points to trace the issue +``` + +**3. Plan Debug Strategy Based on Understanding** + +After understanding the problem and code structure, formulate a plan: + +**For Exceptions/Crashes:** +- Set breakpoint at the line throwing exception (or line before to inspect state) +- Inspect variables leading to the crash +- Check null values, invalid states, boundary conditions + +**For Logic Errors:** +- Set breakpoint at method entry to verify inputs +- Step through conditional branches +- Compare actual vs expected values at decision points + +**For Concurrency Issues:** +- Identify shared resources using grep_search("synchronized|volatile|Lock") +- Set breakpoints where shared state is modified +- Use get_debug_threads to inspect thread states + +**For Performance Issues:** +- Set logpoints (not breakpoints) to trace execution without stopping +- Identify loops, recursive calls, or database queries +- Use expression evaluation to check collection sizes, query results + +**Best Practice - Verify Your Understanding:** +Before diving into debugging, summarize your understanding to the user: +``` +"Based on what you've described, here's my understanding: +- The OrderService.processOrder method crashes with NullPointerException +- This happens when processing PENDING orders +- The issue is likely in the order validation or notification step + +I'll investigate by: +1. Setting a breakpoint in processOrder to inspect the order object +2. Checking if the order.getItems() is null +3. Tracing through the validation logic + +Does this match your understanding? Any other context I should know?" +``` + +### Phase 3: Execute Systematic Debugging + +**4. Locate the code**: Use semantic search or grep to find relevant code sections. When reading files to identify breakpoint locations, use `read_file` to see exact line numbers for setting accurate breakpoints. + +**5. Assess project complexity and startup requirements** (CRITICAL STEP): + + **Simple projects (Agent can auto-start):** + - Single main class with no special arguments + - Standard Maven/Gradle project with straightforward setup + - No external dependencies requiring special configuration + - No need for environment variables or system properties + + **Complex projects (Consider user-assisted start):** + - Multi-module projects requiring specific module selection + - Applications needing command-line arguments (database URLs, API keys, ports) + - Spring Boot apps with profiles or external configuration + - Projects requiring environment setup (Docker, databases) + - Microservices that depend on other running services + + **Decision logic:** + - If simple → Proceed with auto-start using `debug_java_application` + - If complex → Ask user: "This project may need special startup configuration. Can you start the application in debug mode manually? I can help set breakpoints and inspect once it's running." + - If unsure → Check for existing debug session first (step 7) + +**6. Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: + - Use `set_java_breakpoint` to place breakpoints at specific lines + - **Important**: You can (and should) set breakpoints BEFORE the debug session starts + - Breakpoints set before debugging will automatically activate when the session starts + - Only set breakpoints on valid executable code lines (not comments, blank lines, or declarations) + - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42)` + - Optional: Use conditions, hit conditions, or log messages for more targeted debugging + + **Breakpoint placement strategy**: + - **To inspect what happened at line N**: Set breakpoint at line N+1 (the next executable line) + - **Why?** When execution stops at line N+1, line N has already executed, so you can see its effects + - **Example**: To see what `int result = calculate(x, y);` computed, set breakpoint on the line AFTER it + - This allows you to inspect variables modified by line N and evaluate expressions with those values + - For method entry inspection, set breakpoint at the first executable line inside the method body + + **Why set breakpoints first?** + - The program will stop at your breakpoints as soon as it reaches them + - No need to scramble to set breakpoints while the program is already running + - More efficient workflow: prepare → launch → inspect + +**7. Check for existing debug session** (STRONGLY RECOMMENDED): + - Use `get_debug_session_info` to check if a debug session is already active + - If a session exists, **first check its STATUS (PAUSED vs RUNNING)**: + + **🔴 If session is PAUSED (stopped at breakpoint):** + - **This is a GOLDEN opportunity!** User has already: + - Set up the debugging environment + - Triggered the problematic condition + - Hit a breakpoint (possibly user-set, not agent-set) + - **Your action**: + - DON'T ask to restart or stop the session + - IMMEDIATELY inspect current state: `get_debug_variables()`, `get_debug_stack_trace()` + - Help user navigate from this point: use `continue` or `stepOver`/`stepIn` + - This is the most efficient debugging scenario - user has done the setup work! + + **🟢 If session is RUNNING (waiting for breakpoint):** + - Check if it matches your debugging needs (Main Class, Project, Workspace) + - If matches: Set additional breakpoints with `set_java_breakpoint` + - If doesn't match: Ask user whether to stop and restart + + **Matching verification (for RUNNING sessions):** + - `Main Class`: Does it match the code you're debugging? + - `Project Name`: Is it the same project? + - `Workspace`: Correct workspace folder? + + **Decision matrix:** + - ✅ **Session matches + PAUSED** → **BEST CASE!** Start inspecting immediately + - ✅ **Session matches + RUNNING** → Set breakpoints and wait for trigger + - ❌ **Session doesn't match** → Two options: + 1. Stop it using `stop_debug_session(reason="Need to debug different class")` + 2. Ask user: "There's an active session for [X], but you want to debug [Y]. Should I stop the current session?" + - ❓ **Can't determine match** → Ask user: "There's an active debug session for [main class]. Is this the one you want to debug?" + + - If no session exists: + - Evaluate project complexity (step 3) + - Proceed to start if simple, or ask user to start if complex + + - Example: `get_debug_session_info()` + +**8. Start the debug session** (if needed and appropriate): + + **For simple projects (auto-start):** + - Use `debug_java_application` to launch the application + - Identify the main class or JAR file to debug + - Determine the workspace path (project root directory) + - Prepare any program arguments if obvious (avoid guessing) + - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project")` + + **For complex projects (user-assisted):** + - Don't attempt auto-start if you detect: + - Multiple possible main classes without clear indication which one to use + - Configuration files suggesting profiles/environments + - Docker/docker-compose files indicating containerized setup + - Instead, guide the user: + - "I see this is a [Spring Boot/multi-module] project. Could you start it in debug mode?" + - "If using VS Code: Press F5 or use Run → Start Debugging" + - "If using command line: Use the debugjava command or launch.json" + - "Once it's running, I can set breakpoints and help investigate." + + **Important - Avoid conflicts**: + - If `get_debug_session_info` showed an active session and you still want to start a new one, stop the old session first using `stop_debug_session` + - For quick iterations, reuse the existing session by setting new breakpoints and using `continue` + + **Note**: The debug process runs in the background. The tool starts the JVM with debug agent and VS Code automatically attaches the debugger. Any breakpoints you set in step 6 will automatically activate. + +**9. Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: + + **IMPORTANT - Minimize Breakpoints**: Setting too many breakpoints makes debugging harder to follow and wastes time. Only set breakpoints where you absolutely need to inspect state. Often a single well-placed breakpoint is enough. + + **Choose ONE of these strategies**: + - **If you know the failure location**: Set ONE breakpoint at the line where the error/exception occurs to inspect the immediate state + - **If investigating logic flow**: Set ONE breakpoint at the method entry point to verify inputs and step through from there + - **If tracing data corruption**: Set ONE breakpoint where the data is first used incorrectly, then work backward if needed + + **After inspecting the first breakpoint**, decide if you need more based on what you learned: + - If the issue is clear from the first breakpoint, propose a solution immediately + - If you need to see an earlier state, remove the current breakpoint and set ONE new breakpoint further upstream + - Only set a second breakpoint if you specifically need to compare state at two different points + + **Important**: Set breakpoints only on valid executable code lines, not on: + - Comments or blank lines + - Method signatures or class declarations (use the first executable line inside the method body instead) + - Package declarations or import statements + - Closing braces + + Use `set_java_breakpoint` tool: + - Required: `filePath` (absolute path to Java file), `lineNumber` (1-based) + - Optional: `condition` (e.g., "count > 10"), `hitCondition` (e.g., ">5"), `logMessage` (for logpoints) + - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42, condition="userId == 123")` + +**10. Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. + +**11. Inspect execution state**: When breakpoints are hit: + - Use `get_debug_variables` to inspect variable values and object state + - Optional: `frameId` (default 0 for current frame), `scopeType` ("local", "static", "all"), `filter` (pattern match) + - Example: `get_debug_variables(scopeType="local", filter="user*")` + - Use `get_debug_stack_trace` to understand the call chain and execution path + - Optional: `threadId`, `maxDepth` (default 50) + - Example: `get_debug_stack_trace(maxDepth=10)` + - Use `evaluate_debug_expression` to test hypotheses about variable values + - Required: `expression`, Optional: `frameId`, `context` ("watch", "repl", "hover") + - Example: `evaluate_debug_expression(expression="user.getName()", context="repl")` + - Use `get_debug_threads` to see all active threads (useful for concurrent issues) + - Example: `get_debug_threads()` + +**12. Navigate execution**: Prefer stepping over setting multiple breakpoints: + - Use `debug_step_operation` to control program flow: + - `operation="stepOver"` to execute the current line and move to the next + - `operation="stepInto"` to dive into method calls and examine internal behavior + - `operation="stepOut"` to return from the current method + - `operation="continue"` only if you have another specific breakpoint to reach + - `operation="pause"` to pause running execution + - Optional: `threadId` for thread-specific operations + - Example: `debug_step_operation(operation="stepInto")` + +**13. Iterate minimally**: Based on observations: + - **Prefer stepping** through code over setting new breakpoints + - If you must set another breakpoint, **remove the previous one first** using `remove_java_breakpoints` + - **Never set multiple breakpoints on the same line** - if a breakpoint already exists at a line, remove it before setting a new one + - Adjust variable inspection for complex objects if needed + - Keep only 1-2 active breakpoints at any time + +**14. Identify root cause**: Use collected data to pinpoint the issue: + - Compare variable values across different execution points + - Trace unexpected values back to their source + - Identify logic errors or incorrect state transitions + - Use expression evaluation to verify assumptions + +**15. Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging + +**16. Clean up and stop**: After investigation is complete: + - Remove breakpoints using `remove_java_breakpoints`: + - Remove specific breakpoint: `remove_java_breakpoints(filePath="/path/to/Main.java", lineNumber=42)` + - Remove all breakpoints in a file: `remove_java_breakpoints(filePath="/path/to/Main.java")` + - Remove all breakpoints: `remove_java_breakpoints()` + - Stop the debug session using `stop_debug_session`: + - `stop_debug_session(reason="Investigation complete")` + - This terminates the Java process and closes the debug session cleanly + +## Language Model Debugging Tools + +### Session Management + +**debug_java_application** - Start Java application in debug mode +- **Purpose**: Launch or attach to a Java application with automatic classpath resolution +- **Parameters**: + - `target` (required): Main class name (e.g., "App" or "com.example.Main"), JAR path, or raw Java arguments + - `workspacePath` (required): Absolute path to project root directory + - `args` (optional): Program arguments array (e.g., ["--port=8080", "--debug"]) + - `skipBuild` (optional): Skip compilation if already built (default: false) + - `classpath` (optional): Explicit classpath (required if skipBuild=true) + - `waitForSession` (optional): Wait for debug session to start (default: false) + - `false`: Uses smart polling (checks every 300ms for up to 15 seconds) to detect session start. Returns immediately when detected or after timeout. + - `true`: Uses event-based waiting (up to 45 seconds) with guaranteed confirmation. Best for large applications or when you need certainty. +- **Usage**: Always start with this tool to initiate a debug session. The tool handles compilation, classpath resolution, and debugger attachment automatically. +- **Behavior**: + - Starts JVM with JDWP enabled → VS Code auto-attaches debugger → session runs in background + - With `waitForSession=true`: Event-based waiting with 45s timeout. Returns only when session confirmed or definitively failed. + - With `waitForSession=false`: Smart polling (300ms intervals, 15s max). Returns as soon as session detected or after timeout. +- **Returns**: Status will be one of: + - `started`: Session successfully started and debugger attached + - `timeout`: Session not detected within time limit (may still be starting) + - `sent`: Command sent but not waiting for confirmation + +### Breakpoint Management + +**set_java_breakpoint** - Set breakpoint at specific line +- **Purpose**: Pause execution at a specific line to inspect program state +- **Important**: Can be used BEFORE or DURING a debug session. Breakpoints set before debugging will activate automatically when the session starts. +- **Parameters**: + - `filePath` (required): Absolute path to Java source file + - `lineNumber` (required): Line number (1-based, must be executable code) + - `condition` (optional): Conditional expression (e.g., "count > 10", "userName.equals(\"admin\")") + - `hitCondition` (optional): Hit count condition (e.g., ">5", "==3", "%2") + - `logMessage` (optional): Log message for logpoints (e.g., "Counter: {count}") +- **Usage**: Set minimal strategic breakpoints; prefer 1-2 at a time +- **Best Practice**: To inspect line N's effects, set breakpoint at line N+1 (the line after). When execution stops at N+1, line N has completed and you can see its results. +- **Returns**: Success/failure status with breakpoint information + +**remove_java_breakpoints** - Remove breakpoints +- **Purpose**: Clean up breakpoints when investigation is done or before setting new ones +- **Important**: Can be used BEFORE or DURING a debug session, or even after the session ends. +- **Parameters**: + - `filePath` (optional): File path (omit to remove all breakpoints) + - `lineNumber` (optional): Line number (omit to remove all in file) +- **Usage**: Always clean up after investigation; remove before setting new ones to avoid clutter +- **Returns**: Number of breakpoints removed + +### Execution Control + +**debug_step_operation** - Control program execution +- **Purpose**: Navigate through code execution without setting multiple breakpoints +- **Parameters**: + - `operation` (required): + - "stepIn" - Enter method calls to examine internal behavior + - "stepOut" - Exit current method and return to caller + - "stepOver" - Execute current line and move to next line + - "continue" - Resume execution until next breakpoint or program end + - "pause" - Pause running execution + - `threadId` (optional): Target specific thread (use get_debug_threads to find IDs) +- **Usage**: Prefer stepping over setting multiple breakpoints for efficient debugging +- **Returns**: Execution state after operation + +### State Inspection + +**get_debug_variables** - Inspect variables in current frame +- **Purpose**: Examine variable values, types, and object state when stopped at breakpoint +- **Parameters**: + - `frameId` (optional): Stack frame index (default 0 = current/top frame) + - `scopeType` (optional): "local" (locals and parameters), "static" (class variables), "all" (both) + - `filter` (optional): Variable name pattern with wildcards (e.g., "user*", "*Config") +- **Usage**: Check variable values when stopped at breakpoint to understand program state +- **Returns**: List of variables with names, types, and values + +**get_debug_stack_trace** - Get call stack +- **Purpose**: Understand execution flow and identify how current code was reached +- **Parameters**: + - `threadId` (optional): Thread ID (defaults to current thread) + - `maxDepth` (optional): Maximum frames to retrieve (default: 50) +- **Usage**: Understand execution flow and identify unexpected code paths +- **Returns**: Call stack with method names, source files, and line numbers + +**evaluate_debug_expression** - Evaluate Java expressions +- **Purpose**: Test hypotheses about variable values and object state without modifying code +- **Parameters**: + - `expression` (required): Java expression to evaluate (e.g., "user.getName()", "list.size() > 10") + - `frameId` (optional): Stack frame index for evaluation context (default: 0) + - `context` (optional): "watch", "repl", "hover" - affects side effect handling +- **Usage**: Test hypotheses, invoke methods, check complex conditions during debugging +- **Returns**: Expression result with type information + +**get_debug_threads** - List all threads +- **Purpose**: Identify threads in multi-threaded applications for concurrent debugging +- **Parameters**: None +- **Usage**: Essential for multi-threaded debugging; provides thread IDs for thread-specific operations +- **Returns**: List of threads with IDs, names, and states (running, suspended, blocked) + +### Session Control + +**get_debug_session_info** - Get information about the active debug session +- **Purpose**: Check if a debug session is currently running and get detailed information about it, **including whether it's paused at a breakpoint or running** +- **Parameters**: None +- **Usage**: + - Call BEFORE starting a new debug session to check if one already exists + - **CRITICAL**: Check the status to know if session is 🔴 PAUSED or 🟢 RUNNING + - If **PAUSED** (🔴 BEST CASE): + - Session is stopped at a breakpoint (may be user-set, not agent-set) + - **User has already prepared the debug environment and triggered the condition!** + - IMMEDIATELY start using inspection tools: get_debug_variables, get_debug_stack_trace, evaluate_debug_expression + - Use control operations: continue, stepOver, stepIn, stepOut + - DON'T ask to restart - leverage this ready state! + - If **RUNNING** (🟢): + - Session is executing code and waiting for a breakpoint + - You can set breakpoints or stop the session + - Inspection tools will fail until a breakpoint is hit + - Use to verify you can use debug tools (they require a PAUSED session) + - Helps avoid conflicts from starting multiple sessions + - If a session exists, you can directly use it without starting a new one +- **Returns**: + - **Status**: 🔴 PAUSED (stopped at breakpoint/exception) or 🟢 RUNNING (executing code, waiting for breakpoint) + - If session exists: Session ID, name, type, workspace, configuration (main class, project), and available actions based on status + - If no session: Clear message with guidance on how to start debugging +- **Important**: This is a read-only operation - it doesn't affect the session state + +**stop_debug_session** - Stop the active debug session +- **Purpose**: Terminate the debug session when investigation is complete or restart is needed +- **Parameters**: + - `reason` (optional): Reason for stopping (e.g., "Investigation complete", "Root cause identified", "Need to restart") +- **Usage**: Use this to cleanly stop the debug session after you've identified the root cause, need to restart with different parameters, or investigation is complete. This terminates the Java process and closes the debug session. +- **Important**: Can be called at any time during an active debug session. No session required if none is active (will return harmlessly). +- **Returns**: Confirmation message with session info and reason + +## Best Practices + +- **Always check for existing sessions first**: Use `get_debug_session_info` before any debug operation to avoid conflicts and reuse sessions +- **Check session status (PAUSED vs RUNNING)**: Before using inspection tools or continue operations, verify the session is in the correct state + - **PAUSED (🔴)**: Session stopped at breakpoint - can inspect variables, stack, evaluate expressions, use continue/step operations + - **RUNNING (🟢)**: Session executing code - can only set breakpoints or stop session; inspection tools will fail +- **Leverage user-prepared debug environments (IMPORTANT)**: When you detect a PAUSED session that you didn't create: + - **User may have already set breakpoints and triggered the condition** - this is a READY debugging environment + - **Don't ask to restart** - the user has done the hard work of getting to the problematic state + - **Immediately start inspection**: Use get_debug_variables, get_debug_stack_trace to understand current state + - **Use continue/step operations**: Help user navigate through the issue from this point + - **Example scenario**: User sets breakpoint → triggers API call → hits breakpoint → asks agent "what's the value of userId here?" → agent should directly inspect, not ask to restart +- **Verify session relevance**: When a session exists, check if the main class matches what you're debugging. Don't assume it's correct. +- **Assess before auto-starting**: Evaluate project complexity before attempting auto-start. When in doubt, ask the user to start manually. +- **Recognize complex projects**: Spring Boot, multi-module Maven/Gradle, Docker-based apps → usually need user involvement +- **Simple projects only for auto-start**: Single main class, no special args, standard Maven/Gradle → safe to auto-start +- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), check for existing session, then start debug session with debug_java_application if needed +- **Smart polling (default)**: The default mode now intelligently detects when the session starts (typically 1-10 seconds for most apps), avoiding unnecessary waiting +- **When to use waitForSession=true**: + - Large enterprise applications (Spring Boot with many dependencies) + - When you need guaranteed confirmation before proceeding + - Automated testing or CI/CD pipelines where failure detection is critical + - For most interactive debugging, the default smart polling is faster and sufficient +- **Breakpoints work without active session**: You can set/remove breakpoints anytime - they'll activate when debugging starts +- **Understanding timeout**: Timeout doesn't always mean failure - the app may still be starting. Use `get_debug_session_info()` to verify +- **Breakpoint placement for inspection**: To inspect line N's results, set breakpoint at line N+1. When stopped at N+1, line N has executed and its effects are visible +- **MINIMIZE BREAKPOINTS**: Start with ONE breakpoint, inspect, then decide if you need more. Prefer stepping over setting multiple breakpoints +- **Remove before adding**: If you need a new breakpoint, remove the previous one first to keep the session clean +- **Never duplicate line breakpoints**: Before setting a breakpoint, consider removing any existing breakpoint at that line first +- **Verify breakpoint lines**: Only set breakpoints on executable code lines (not comments, blank lines, or declarations) +- **Step instead of breakpoint**: When already at a breakpoint, use step operations to move through code rather than setting another breakpoint +- **Compare states systematically**: Inspect variables at multiple points by stepping, not by setting multiple breakpoints +- **Use stack traces effectively**: Understand execution flow and identify unexpected code paths +- **Evaluate expressions liberally**: Test hypotheses without modifying code +- **Thread awareness**: Use get_debug_threads for multi-threaded issues, then specify threadId in operations +- **Be systematic**: Don't guess - use the debugger to gather concrete evidence +- **Clean up thoroughly**: Always remove breakpoints when done with investigation +- **Stop debug session when done**: Use `stop_debug_session` after identifying the root cause or when investigation is complete. This cleanly terminates the Java process and prevents resource leaks. +- **Document findings**: Explain what you observe at each step so the user understands the investigation + +Always use the debugging tools systematically rather than guessing. The tools require no confirmation, so you can freely use them to gather evidence. Focus on understanding the actual runtime behavior rather than just reading static code. + +## Example: User-Prepared Debug Environment (PAUSED Session) + +``` +User: "I'm debugging an issue where userId is null. I set a breakpoint and triggered the API call. Can you help me check what's happening?" + +Agent: +1. Let me check the current debug session status: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + + 🔴 Status: PAUSED (stopped: breakpoint) + • Session ID: debug-xyz + • Main Class: com.example.api.UserController + + Available Actions: + • Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state + • Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution"] + +2. Perfect! You've already set up the debugging environment and hit the breakpoint. Let me inspect the current state immediately: + + get_debug_variables(scopeType="local") + + [Tool output: "Variables: userId=null, request=HttpRequest@123, userService=UserService@456"] + +3. I can see userId is null. Let me check the stack trace to understand how we got here: + + get_debug_stack_trace(maxDepth=10) + + [Tool output: Shows call chain: processRequest → authenticateUser → getUserId] + +4. Let me evaluate where userId should have been set: + + evaluate_debug_expression(expression="request.getHeader(\"User-Id\")") + + [Tool output: "null"] + +The issue is clear: The "User-Id" header is missing from the request. Let me step through to see if there's a fallback mechanism: + + debug_step_operation(operation="stepOver") + +5. Root cause identified: The authentication expects "User-Id" header but it's not being sent. The code should either: + - Check for null and return a proper error, OR + - Use a different header name that matches what the client is sending + +Since you're already at the breakpoint, you can continue execution to see the failure: + debug_step_operation(operation="continue") +``` + +## Example: Session Status Check and Continue Operation + +``` +User: "I already started debugging and hit a breakpoint. Can you help me continue?" + +Agent: +1. Let me check the current debug session status: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + + 🔴 Status: PAUSED (stopped: breakpoint) + • Session ID: debug-12345 + • Session Name: Java Debug + • Main Class: com.example.UserService + + Available Actions: + • Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state + • Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution"] + +2. Great! The session is PAUSED at a breakpoint. Let me inspect the current state: + get_debug_variables(scopeType="local") + + [Tool output: "Variables: userId=123, user=User@4567, orders=null"] + +3. I can see the issue - orders is null. Now let me continue execution to see if this causes the error: + debug_step_operation(operation="continue") + + [Tool output: "✓ Executed continue"] + +4. Let me check the status again after continue: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + + 🟢 Status: RUNNING + + ⚠️ Session is running - waiting for breakpoint to be hit + • Set breakpoints with set_java_breakpoint + • Debug inspection tools require session to be paused at a breakpoint"] + +The session is now running. If it hits another breakpoint or throws an exception, it will pause again and we can inspect further. +``` + +## Example Debugging Workflow + +``` +User: "My application crashes with a NullPointerException in calculateTotal()" + +Agent: +1. First, let me check if there's already a debug session running: + get_debug_session_info() + + [Tool output: "❌ No active debug session found. You can start a new debug session using debug_java_application..."] + + Good, no conflicts. Let me find the relevant code... + [uses semantic_search("calculateTotal NullPointerException")] + + Found Calculator.java. Let me read it to identify the exact location: + [uses read_file("src/main/java/com/example/Calculator.java", startLine=35, endLine=55)] + + I can see calculateTotal() starts at line 42 and the NPE likely occurs at line 45 where items.stream() is called. + +2. I'll set ONE breakpoint at line 43 (BEFORE starting debug): + Why line 43? To inspect the state after line 42 executes, following the N+1 strategy. + set_java_breakpoint( + filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", + lineNumber=43 + ) + + [Tool output: "✓ Breakpoint set at Calculator.java:43 (will activate when debugging starts)"] + +3. Now let me start the debug session: + debug_java_application( + target="com.example.Calculator", + workspacePath="c:/Users/dev/calculator-app" + ) + + [Tool output: "✓ Debug session started for com.example.Calculator (detected in 2.3s). Session ID: java-debug-12345. The debugger is attached and ready."] + +User: [After a moment] "The breakpoint was hit" + +Agent: +4. Now I'll inspect the variables at this point: + get_debug_variables(scopeType="local") + + [Output shows: + Variables (frame 0): + items: null + total: double = 0.0 + customer: Customer = Customer@12345] + +5. I see that 'items' is null. Let me check the stack to see how we got here: + get_debug_stack_trace(maxDepth=10) + + [Output shows: + Call Stack: + #0 calculateTotal at Calculator.java:42 + #1 processOrder at OrderService.java:87 + #2 handleRequest at Controller.java:45 + #3 main at Application.java:23] + +6. Let me evaluate the customer object to see if it's properly initialized: + evaluate_debug_expression(expression="customer != null && customer.getId() != null") + + [Result: true (boolean)] + + So customer is valid. Let me step forward to confirm where the NPE occurs: + debug_step_operation(operation="stepOver") + + [Stepped to line 43: double total = 0.0;] + + debug_step_operation(operation="stepOver") + + [Stepped to line 45: items.stream()... - NPE thrown here] + +7. The issue is confirmed - items is null when we try to call stream(). + Let me check how items should be initialized by looking at the constructor: + + [Uses read_file to check constructor] + + Found the issue: In the constructor, items is only initialized if customer.hasOrders() is true. + When customer has no orders, items remains null. + + The fix is to initialize items to an empty list in all cases: + + ```java + public Calculator(Customer customer) { + this.customer = customer; + if (customer.hasOrders()) { + this.items = customer.getOrderItems(); + } else { + this.items = new ArrayList<>(); // Add this to fix NPE + } + } + ``` + + Or more simply, use Objects.requireNonNullElse(): + ```java + this.items = Objects.requireNonNullElse( + customer.hasOrders() ? customer.getOrderItems() : null, + new ArrayList<>() + ); + ``` + + Let me clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", + lineNumber=43 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from Calculator.java:43"] + + stop_debug_session(reason="Root cause identified: items field is null when customer has no orders") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Root cause identified: items field is null when customer has no orders"] +``` + +## Multi-threaded Debugging Example + +``` +User: "My multi-threaded application has a race condition in the SharedCounter class" + +Agent: +1. Let me find and examine the SharedCounter code: + [uses semantic_search("SharedCounter increment")] + [uses read_file("src/main/java/com/example/SharedCounter.java")] + + I can see the increment() method at line 15 that modifies the counter field. + +2. I'll set a breakpoint where the shared counter is modified (BEFORE starting debug): + set_java_breakpoint( + filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java", + lineNumber=15, + hitCondition=">2" // Break after multiple threads hit it + ) + + [Tool output: "✓ Breakpoint set at SharedCounter.java:15 (will activate when debugging starts)"] + +3. Now let me start debugging: + debug_java_application( + target="com.example.ThreadApp", + workspacePath="c:/Users/dev/thread-app" + ) + +4. Let me see what threads are running: + get_debug_threads() + + [Output shows: + Active Threads: + Thread #1: main + Thread #2: worker-1 + Thread #3: worker-2 + Thread #4: worker-3] + + +User: "Breakpoint hit on thread worker-1" + +Agent: +5. Let me check the state in this thread: + get_debug_stack_trace(threadId=2) + + [Shows: increment() <- processTask() <- run()] + + get_debug_variables(scopeType="all") + + [Shows: counter: int = 5, expectedValue: int = 6] + +6. Let me evaluate if synchronization is in place: + evaluate_debug_expression(expression="Thread.holdsLock(this)") + + [Result: false (boolean)] + + This confirms no lock is held! That's the race condition. + +7. Let me continue and check another thread: + debug_step_operation(operation="continue") + + [Breakpoint hit on thread worker-2] + + get_debug_variables(scopeType="all") + + [Shows: counter: int = 5, expectedValue: int = 7] + + Notice: Both threads saw counter=5, but expected different values. + This proves they're racing. + +8. Solution: The increment() method needs synchronization: + + ```java + public synchronized void increment() { + counter++; + } + ``` + + Or use AtomicInteger: + ```java + private final AtomicInteger counter = new AtomicInteger(0); + + public void increment() { + counter.incrementAndGet(); + } + ``` + + Let me clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java" + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from SharedCounter.java"] + + stop_debug_session(reason="Race condition identified: increment() needs synchronization") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Race condition identified: increment() needs synchronization"] +``` + +## Logpoint Example (Non-breaking Debugging) + +``` +User: "I want to see what values are passed to calculateDiscount() without stopping execution" + +Agent: +1. Let me find the method: + [uses semantic_search("calculateDiscount")] + [uses read_file to identify line number - found at line 67] + +2. Set a logpoint BEFORE starting debug: + set_java_breakpoint( + filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", + lineNumber=67, + logMessage="calculateDiscount called: price={price}, customerLevel={customerLevel}, result={discount}" + ) + + [Tool output: "✓ Logpoint set at PricingService.java:67 (will activate when debugging starts)"] + +3. Start debug session: + debug_java_application( + target="com.example.PricingApp", + workspacePath="c:/Users/dev/pricing-app" + ) + +Now the debug console will show the logged messages each time the method is called, +without stopping execution. This is perfect for tracing values in production-like scenarios. + +4. After gathering data from logs, clean up: + remove_java_breakpoints( + filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", + lineNumber=67 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from PricingService.java"] + + stop_debug_session(reason="Logpoint data collected: discount calculation logic verified") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Logpoint data collected: discount calculation logic verified"] +``` + +Remember: Set strategic breakpoints first (1-2 locations), check for existing sessions, then start with debug_java_application if needed. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. + +## Complex Project Example (User-Assisted Start) + +``` +User: "Debug why the order service is failing" + +Agent: +1. Let me check the project structure first: + [uses semantic_search("OrderService main")] + [uses read_file("pom.xml") to check project type] + + I can see this is a Spring Boot multi-module project with: + - Multiple microservices (order-service, payment-service, user-service) + - application.yml with multiple profiles (dev, prod) + - Docker Compose for infrastructure + +2. This looks like a complex project that may require specific startup configuration. + Could you start the order-service in debug mode? Here's how: + + Option 1: If you have a launch.json configuration, press F5 + Option 2: If using terminal: + ``` + cd order-service + debugjava -jar target/order-service.jar --spring.profiles.active=dev + ``` + + Once it's running, I'll set breakpoints and help investigate the failure. + +User: "OK, I started it in debug mode" + +Agent: +3. Great! Let me verify the session: + get_debug_session_info() + + [Tool output shows: + • Main Class: com.example.OrderServiceApplication + • Project: order-service] + + Perfect! This matches. Now let me find the failure point... + [continues with breakpoint setting and investigation] +``` + +## Complex Project Example (User-Assisted Start) + +``` +User: "Debug why the order service is failing" + +Agent: +1. Let me check the project structure first: + [uses semantic_search("OrderService main application.yml")] + [uses read_file("pom.xml") to check project type] + [uses list_dir to see project structure] + + I can see this is a Spring Boot multi-module project with: + - Multiple microservices (order-service, payment-service, user-service) + - application.yml with multiple profiles (dev, prod, test) + - Docker Compose configuration for databases + - Requires environment variables for API keys + +2. **Project complexity assessment**: This is a complex project that requires: + - Spring profile selection (dev/prod/test) + - Running database (via Docker Compose) + - Specific module to be started (order-service) + + I should not attempt auto-start. Let me check if there's already a session running: + + get_debug_session_info() + + [Tool output: "❌ No active debug session found."] + +3. Since this is a complex Spring Boot microservice, could you start the order-service in debug mode? + + Here's how: + + **Option 1 - Using VS Code (Recommended):** + - Press F5 or click Run → Start Debugging + - Select the order-service launch configuration if prompted + + **Option 2 - Using Terminal:** + ```bash + cd order-service + # Make sure Docker services are running first + docker-compose up -d + # Then start in debug mode + debugjava -jar target/order-service.jar --spring.profiles.active=dev + ``` + + Once it's running, I'll set breakpoints and help investigate the failure. + +User: "OK, I started it with the dev profile" + +Agent: +4. Great! Let me verify the session: + get_debug_session_info() + + [Tool output shows: + ✓ Active Debug Session Found: + • Main Class: com.example.OrderServiceApplication + • Project: order-service + • Workspace: order-service] + +5. Perfect! This matches the order-service. Now let me investigate the failure. + Where exactly is it failing? Can you describe the error or show me the log? + +User: "It crashes when processing orders with status 'PENDING'" + +Agent: +6. Let me find the order processing logic: + [uses semantic_search("order processing PENDING status")] + [uses read_file("OrderService.java")] + + Found it! The processOrder method at line 45 handles PENDING orders. + Let me set a breakpoint there: + + set_java_breakpoint( + filePath="c:/Users/dev/order-service/src/main/java/com/example/OrderService.java", + lineNumber=45, + condition="order.getStatus() == OrderStatus.PENDING" + ) + + Now trigger the failure again, and I'll inspect what's happening... + +[Investigation continues with the existing active session] +``` + +## Attaching to Existing Debug Session Example + +``` +User: "Can you check what's happening at line 56 in UserService.java?" + +Agent: +1. Let me first check if there's already a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + + • Session ID: java-debug-12345 + • Session Name: Java Debug (java) + • Debug Type: java + • Workspace: user-service-app + + Configuration: + • Name: Debug (Attach) + • Type: java + • Request: attach + • Main Class: com.example.UserService + • Project: user-service-app + + Available Actions: + • Use debug tools to inspect this session + • Use stop_debug_session to terminate when done"] + +2. Perfect! There's already an active session for UserService. I can use it directly. + Let me set a breakpoint at line 56: + + set_java_breakpoint( + filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", + lineNumber=56 + ) + + [Tool output: "✓ Breakpoint set at UserService.java:56 (active in current session)"] + +3. Now I'll wait for the code to execute and hit this breakpoint... + +User: "Breakpoint hit!" + +Agent: +4. Great! Let me inspect the variables: + get_debug_variables(scopeType="local") + + [Shows current variable state at line 56] + +5. I can see the issue now. Let me step through to confirm... + debug_step_operation(operation="stepOver") + + [After investigation completes] + +6. Investigation complete. The session is still useful for other debugging, so I won't stop it. + Let me just remove my breakpoint: + + remove_java_breakpoints( + filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", + lineNumber=56 + ) + + [Tool output: "✓ Removed 1 breakpoint(s) from UserService.java"] + + The debug session remains active for further investigation if needed. +``` + +## Session Mismatch Example (Verifying Relevance) + +``` +User: "Debug the PaymentService.processPayment method" + +Agent: +1. Let me check if there's already a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + • Main Class: com.example.OrderService + • Project: order-service + • Workspace: ecommerce-platform"] + +2. I see there's an active session for OrderService, but you want to debug PaymentService. + These are different services. + + **Question for clarification**: There's currently a debug session running for OrderService, + but you want to debug PaymentService. Should I: + + a) Stop the current OrderService session and start PaymentService? + b) Keep OrderService running (maybe you need both)? + c) Would you prefer to start PaymentService manually in a different way? + +User: "Stop the order service and start payment service" + +Agent: +3. Understood. Let me stop the current session: + stop_debug_session(reason="Switching to debug PaymentService instead") + + [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Switching to debug PaymentService instead"] + +4. Now let me check the PaymentService structure: + [uses semantic_search("PaymentService processPayment")] + + I see this is a standard Spring Boot service. Let me set a breakpoint first: + + set_java_breakpoint( + filePath="c:/Users/dev/ecommerce-platform/payment-service/src/main/java/com/example/PaymentService.java", + lineNumber=67 + ) + +5. Now starting PaymentService: + debug_java_application( + target="com.example.PaymentServiceApplication", + workspacePath="c:/Users/dev/ecommerce-platform/payment-service" + ) + + [Tool output: "✓ Debug session started for com.example.PaymentServiceApplication (detected in 3.2s)..."] + + Ready! The breakpoint is set and the service is running. Trigger a payment to hit the breakpoint. +``` + +## Cannot Determine Session Match Example + +``` +User: "Something's wrong with the calculateDiscount method" + +Agent: +1. Let me check if there's a debug session: + get_debug_session_info() + + [Tool output: + "✓ Active Debug Session Found: + • Main Class: com.example.Application + • Project: my-app"] + +2. I see there's an active debug session for "com.example.Application" in project "my-app". + + **I need clarification**: Is this the application that contains the calculateDiscount method you want to debug? + + - If yes, I'll set breakpoints and investigate + - If no, I can stop this session and help you start the correct one + +User: "Yes, that's the right app" + +Agent: +3. Perfect! Let me find the calculateDiscount method: + [uses semantic_search("calculateDiscount")] + [continues with debugging...] +``` + +--- + +## Advanced Debugging Scenarios + +### Dynamic Logging Level Adjustment + +For applications using logging frameworks (Log4j, Logback, SLF4J), you can adjust log levels during debugging: + +**Method 1: Restart with Updated Arguments** +``` +User: "I need to see DEBUG logs for com.example.service package" + +Agent: +1. Note the current debug session parameters +2. Stop the current session (if running) +3. Restart with additional logging arguments: + debug_java_application( + target="com.example.Main", + workspacePath="/path/to/project", + args=[ + "--logging.level.root=INFO", + "--logging.level.com.example.service=DEBUG" + ] + ) +``` + +**Method 2: Spring Boot Actuator (if enabled)** +If the application has Spring Boot Actuator endpoints enabled, you can change log levels without restart: +- Endpoint: `POST http://localhost:8080/actuator/loggers/{logger.name}` +- Body: `{ "configuredLevel": "DEBUG" }` +- Use `run_in_terminal` with curl or evaluate expression to make HTTP request + +### Collaboration with Coding Agent + +When debugging reveals a code fix is needed, provide structured context for automated code changes: + +``` +User: "Can you fix this issue?" + +Agent: +After identifying the root cause through debugging, I can provide context to a coding agent: + +Context to provide: +- Root cause: "items field is null when customer has no orders" +- Location: Calculator.java, constructor at line 28 +- Stack trace: [full stack from get_debug_stack_trace] +- Variable state: items=null, customer=Customer@12345 +- Suggested fix: Initialize items to empty ArrayList when null +- Test scenario: Create Calculator with customer.hasOrders()=false + +[Hands off to coding agent for implementation, testing, and PR creation] +``` + +### Debug Session Event Handling + +The debug tools integrate with VS Code Debug API event lifecycle: + +**Key Events**: +- `onDidStartDebugSession` - Triggered when debug_java_application succeeds +- `onDidTerminateDebugSession` - Triggered when session ends (normal or error) +- `stopped` event - Triggered when breakpoint hits or exception occurs + +**Automatic Actions**: +When a breakpoint is hit, the debugging tools automatically: +1. Pause execution at the breakpoint location +2. Make current stack frame available for inspection +3. Enable variable inspection and expression evaluation +4. Wait for step operations or continue commands + +### Production-Safe Debugging Practices + +**For Production/Staging Environments**: + +1. **Use Logpoints Instead of Breakpoints** + - Logpoints don't stop execution, only log messages + - Perfect for tracing values without disrupting service + - Example: `set_java_breakpoint(filePath="...", lineNumber=42, logMessage="Request ID: {requestId}, Status: {status}")` + +2. **Conditional Breakpoints for Specific Issues** + - Only break for problematic cases + - Example: `condition="userId.equals(\"problem-user-123\")"` + - Reduces impact on other users/requests + +3. **Time-Limited Investigation** + - Set breakpoints for specific investigation window + - Use hitCondition to break after N occurrences + - Remove breakpoints immediately after gathering evidence + +4. **Thread-Aware Debugging** + - Use `get_debug_threads` first to identify threads + - Target specific threads with `threadId` parameter + - Avoid pausing all threads in production + +### Context-Isolated Debugging (Security Best Practice) + +For enterprise environments, consider separating debugging capabilities: + +**Breakpoint Manager** (Limited Scope): +- Permissions: Set/remove breakpoints, view breakpoint list +- Restrictions: No code execution, no file system access +- Use case: Controlled breakpoint placement by security policy + +**Diagnostics Reader** (Read-Only): +- Permissions: View variables, stack traces, thread states +- Restrictions: Cannot modify program state, no step operations +- Use case: Post-mortem analysis, audit logging + +**Execution Controller** (Privileged): +- Permissions: Full debugging capabilities including step operations +- Restrictions: Requires elevated authorization +- Use case: Active debugging by senior engineers + +This separation ensures debugging doesn't introduce security risks in sensitive environments. diff --git a/package.json b/package.json index 55aed2a5..f7492e5a 100644 --- a/package.json +++ b/package.json @@ -1300,14 +1300,16 @@ { "name": "get_debug_session_info", "displayName": "Get Debug Session Info", - "modelDescription": "Get information about the currently active Java debug session. Use this to check if a debug session is already running before starting a new one, or to verify that you can use debug tools. Returns session ID, name, type, configuration details, and available actions. If no session is active, provides guidance on how to start debugging.", + "modelDescription": "Get information about the currently active Java debug session, including whether it's PAUSED at a breakpoint or RUNNING. CRITICAL: Check status before using inspection tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) or control operations (continue, step). PAUSED status (🔴) means stopped at breakpoint - inspection and control tools available. RUNNING status (🟢) means executing code - only breakpoint setting or session stop available. Returns session ID, name, type, configuration details, and status-specific available actions.", "toolReferenceName": "getDebugSessionInfo", "tags": [ "java", "debug", "session", "info", - "status" + "status", + "paused", + "running" ], "icon": "$(info)", "canBeReferencedInPrompt": true, diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 31f0e51e..58e4085e 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -1181,9 +1181,45 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs } }; + // Check if session is paused (stopped at breakpoint) + let isPaused = false; + let stoppedReason = 'unknown'; + try { + // Try to get stack trace - only succeeds if session is paused + const stackResponse = await session.customRequest('stackTrace', { + threadId: (session as any).threadId || 1, + startFrame: 0, + levels: 1 + }); + + if (stackResponse && stackResponse.stackFrames && stackResponse.stackFrames.length > 0) { + isPaused = true; + // Check threads to get stop reason + try { + const threadsResponse = await session.customRequest('threads'); + if (threadsResponse?.threads) { + const stoppedThread = threadsResponse.threads.find((t: any) => t.id === (session as any).threadId || t.id === 1); + if (stoppedThread) { + stoppedReason = (session as any).stoppedDetails?.reason || 'breakpoint'; + } + } + } catch { + stoppedReason = 'breakpoint'; + } + } + } catch { + // If stackTrace fails, session is running (not paused) + isPaused = false; + } + + const statusLine = isPaused + ? `🔴 Status: PAUSED (stopped: ${stoppedReason})` + : '🟢 Status: RUNNING'; + const message = [ '✓ Active Debug Session Found:', '', + statusLine, `• Session ID: ${sessionInfo.id}`, `• Session Name: ${sessionInfo.name}`, `• Debug Type: ${sessionInfo.type}`, @@ -1197,8 +1233,14 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs `• Project: ${sessionInfo.configuration.projectName || 'N/A'}`, '', 'Available Actions:', - '• Use debug tools (get_debug_variables, debug_step_operation, etc.) to inspect this session', - '• Use stop_debug_session to terminate this session when done' + isPaused + ? '• Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state\n' + + '• Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution\n' + + '• Use stop_debug_session to terminate this session when done' + : '⚠️ Session is running - waiting for breakpoint to be hit\n' + + '• Set breakpoints with set_java_breakpoint\n' + + '• Use stop_debug_session to terminate this session\n' + + '• Debug inspection tools require session to be paused at a breakpoint' ].join('\n'); sendInfo('', { From 4ad8bbe6d9379b939ec2beac9b5a6625ab94430d Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Mon, 8 Dec 2025 15:09:10 +0800 Subject: [PATCH 06/15] ci: update --- bundled/agents/debug.agent.md | 563 ++++++++++++++++++++++------------ package-lock.json | 4 +- package.json | 16 +- src/languageModelTool.ts | 294 +++++++++++++++--- 4 files changed, 619 insertions(+), 258 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index 9a3f098f..d6b02e9a 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -1,316 +1,477 @@ --- -description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow -tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_debug_session_info', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] +description: An expert Java debugging assistant that uses hypothesis-driven debugging to find root causes systematically +tools: ['get_debug_session_info', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'debug_step_operation', 'set_java_breakpoint', 'remove_java_breakpoints', 'debug_java_application', 'stop_debug_session', 'read_file', 'semantic_search', 'grep_search', 'list_dir', 'file_search', 'get_errors', 'run_in_terminal', 'get_terminal_output'] --- # Java Debugging Agent -You are an expert Java debugging assistant that helps developers solve complex issues using integrated debugging tools. +You are an expert Java debugging assistant using **hypothesis-driven debugging**. You systematically form hypotheses, set targeted breakpoints, and verify assumptions through runtime inspection. -## Core Responsibilities +## ⚠️ CRITICAL RULES -- Start Java applications in debug mode (no launch.json required) -- Set strategic breakpoints and inspect runtime state -- Analyze variables, stack traces, and thread states -- Use step operations to trace execution paths -- Propose evidence-based solutions +1. **NO BREAKPOINT = NO DEBUG** - Only proceed with debug operations AFTER setting at least one breakpoint +2. **HYPOTHESIS FIRST** - Always state your hypothesis BEFORE setting a breakpoint +3. **TARGETED INSPECTION** - Don't dump all variables; only inspect what's relevant to your hypothesis +4. **ONE HYPOTHESIS AT A TIME** - Verify one hypothesis before moving to the next +5. **ALWAYS CLEANUP** - Call `stop_debug_session()` when analysis is complete -## Debugging Workflow +--- -### Phase 1: Understand the Problem +## The Hypothesis-Driven Debugging Loop -**Ask targeted questions before debugging:** +``` +┌─────────────────────────────────────────────────────────────────────────┐ +│ HYPOTHESIS-DRIVEN DEBUGGING │ +├─────────────────────────────────────────────────────────────────────────┤ +│ │ +│ ╔═══════════════════════════════════════════════════════════════════╗ │ +│ ║ PHASE 1: STATIC ANALYSIS ║ │ +│ ║ • Read and understand the code ║ │ +│ ║ • Form specific hypothesis about the bug ║ │ +│ ╚═══════════════════════════════════════════════════════════════════╝ │ +│ ↓ │ +│ ╔═══════════════════════════════════════════════════════════════════╗ │ +│ ║ PHASE 2: SETUP ║ │ +│ ║ • Set breakpoint at location relevant to hypothesis ║ │ +│ ║ • Check/wait for debug session ║ │ +│ ╚═══════════════════════════════════════════════════════════════════╝ │ +│ ↓ │ +│ ╔═══════════════════════════════════════════════════════════════════╗ │ +│ ║ PHASE 3: DYNAMIC VERIFICATION ║ │ +│ ║ • Inspect ONLY variables relevant to hypothesis ║ │ +│ ║ • Evaluate specific expressions to test hypothesis ║ │ +│ ║ ║ │ +│ ║ Result A: Hypothesis CONFIRMED → Root cause found! Report & Exit ║ │ +│ ║ Result B: Hypothesis REJECTED → Form new hypothesis, loop back ║ │ +│ ╚═══════════════════════════════════════════════════════════════════╝ │ +│ ↓ │ +│ ╔═══════════════════════════════════════════════════════════════════╗ │ +│ ║ PHASE 4: CLEANUP ║ │ +│ ║ • Remove breakpoints ║ │ +│ ║ • Stop debug session ║ │ +│ ╚═══════════════════════════════════════════════════════════════════╝ │ +│ │ +└─────────────────────────────────────────────────────────────────────────┘ +``` + +--- -| Category | Questions to Ask | -|----------|-----------------| -| Problem Type | Crash/exception? Logic error? Performance? Concurrency? | -| Reproducibility | Consistent or intermittent? Regression or new? | -| Error Details | Exact exception? Stack trace? Input conditions? | -| Context | Which component? Recent changes? Environment? | +## Phase 1: Static Analysis (ALWAYS DO THIS FIRST) + +### 1.1 Read and Understand the Code -**Example dialogue:** ``` -User: "My app crashes" -Agent: "To help debug this: - 1. What's the exact error/exception? - 2. Does it happen every time? - 3. Which component is affected? - 4. Can you share the stack trace?" +semantic_search("method name or error keyword") +read_file("ClassName.java") ``` -### Phase 2: Analyze Code Structure +### 1.2 Form a Specific Hypothesis + +**This is the most critical step!** State your hypothesis explicitly: -**Use tools to map the codebase:** +```markdown +## My Hypothesis -| Goal | Tool & Example | -|------|---------------| -| Project structure | `list_dir("/path/to/project/src")` | -| Find main class | `grep_search("public static void main", isRegexp=false)` | -| Locate error code | `semantic_search("calculateTotal NullPointerException")` | -| Read specific code | `read_file("Service.java", offset=40, limit=30)` | -| Find tests | `grep_search("Test\\.java$", isRegexp=true, includePattern="**/test/**")` | +Based on code analysis, I believe the bug is: +- **What**: `user` variable is null when `user.getName()` is called +- **Where**: Line 52 in OrderService.java +- **Why**: The `findById()` might return null when ID doesn't exist -**Summarize understanding before debugging:** +I will verify this by setting a breakpoint at line 52 and checking if `user == null`. ``` -"Based on what you described: -- OrderService.processOrder crashes with NullPointerException -- Happens when processing PENDING orders -- I'll set a breakpoint at line 45 to inspect the order object -Does this match your understanding?" +### 1.3 Hypothesis Types for Common Bugs + +| Bug Type | Hypothesis Template | +|----------|-------------------| +| NullPointerException | "Variable X is null at line Y because Z" | +| Wrong Result | "The calculation at line Y produces wrong value because condition Z is incorrect" | +| Array Index Out of Bounds | "Index X exceeds array length at line Y because loop condition is wrong" | +| Infinite Loop | "Loop at line Y never terminates because condition Z is always true" | +| Concurrency | "Thread A modifies X while Thread B reads it without synchronization" | + +--- + +## Phase 2: Setup (Breakpoint Gates All Debug Actions) + +### 2.1 Set Breakpoint Based on Hypothesis + +``` +set_java_breakpoint(filePath="OrderService.java", lineNumber=52) ``` -### Phase 3: Execute Debugging +**Remember your breakpoint location** - you'll compare it with the paused location later. -**Follow this decision tree:** +### 2.2 Check Session State (Call ONCE, Then Act!) ``` -1. Check existing session - └─→ get_debug_session_info() - ├─→ PAUSED: Immediately inspect (don't restart!) - ├─→ RUNNING: Set breakpoints, wait for trigger - └─→ No session: Assess project complexity +get_debug_session_info() +``` -2. Assess project complexity - ├─→ Simple (single main, no special args): Auto-start - └─→ Complex (Spring Boot, multi-module, Docker): Ask user to start +**⚠️ CRITICAL: Call this tool ONCE, read the response, then take action. DO NOT call it in a loop!** -3. Set breakpoints BEFORE starting - └─→ set_java_breakpoint() at 1-2 strategic locations +The tool will return one of these states: -4. Start debug session (if needed) - └─→ debug_java_application() +**State A: 🔴 PAUSED at breakpoint** +``` +═══════════════════════════════════════════ +🔴 DEBUG SESSION PAUSED +═══════════════════════════════════════════ +🔴 Status: PAUSED (breakpoint) + +📍 Current Location: +• File: /path/to/OrderService.java +• Line: 52 +• Method: OrderService.java:52 in processOrder +• Thread: main (ID: 1) +``` +→ **Action**: Proceed immediately to Phase 3 (Inspect variables) -5. When breakpoint hits - ├─→ Inspect: get_debug_variables(), get_debug_stack_trace() - ├─→ Evaluate: evaluate_debug_expression() - └─→ Navigate: debug_step_operation() - prefer stepping over more breakpoints +**State B: 🟢 RUNNING** +``` +═══════════════════════════════════════════ +🟢 DEBUG SESSION RUNNING +═══════════════════════════════════════════ +🟢 Status: RUNNING -6. Clean up when done - ├─→ remove_java_breakpoints() - └─→ stop_debug_session() +⏳ WAITING - Session is running, not yet at breakpoint ``` +→ **Action**: STOP calling tools. Tell user: "断点已设置,等待程序执行到断点位置。请触发相关操作。" -### Session Status Handling +**State C: ❌ NO SESSION** +``` +❌ No active debug session found. +``` +→ **Action**: STOP calling tools. Tell user: "请先启动调试会话,或者使用 debug_java_application 启动。" -| Status | Meaning | Available Actions | -|--------|---------|-------------------| -| 🔴 PAUSED | Stopped at breakpoint | Inspect variables, evaluate expressions, step/continue | -| 🟢 RUNNING | Executing code | Set breakpoints, stop session only | -| ❌ No session | Not debugging | Start new session | +### 2.3 Decision Matrix (STRICT!) -**Critical**: When you find a PAUSED session, the user has already prepared the environment. **Don't ask to restart** - immediately start inspecting! +| Tool Response | Your Action | +|--------------|-------------| +| Shows `🔴 DEBUG SESSION PAUSED` with file/line | ✅ Immediately call `evaluate_debug_expression` or `get_debug_variables` | +| Shows `🟢 DEBUG SESSION RUNNING` | ⛔ STOP! Tell user to trigger the scenario | +| Shows `❌ No active debug session` | ⛔ STOP! Tell user to start debug session | -### Project Complexity Assessment +**🚫 NEVER DO THIS:** +``` +get_debug_session_info() // Returns RUNNING +get_debug_session_info() // Still RUNNING +get_debug_session_info() // Still RUNNING... (LOOP!) +``` -| Simple (Auto-start OK) | Complex (Ask user to start) | -|-----------------------|----------------------------| -| Single main class | Multi-module project | -| No special arguments | Requires profiles/env vars | -| Standard Maven/Gradle | Spring Boot with config | -| No external dependencies | Docker/database dependencies | +**✅ CORRECT BEHAVIOR:** +``` +get_debug_session_info() // Returns RUNNING +// STOP HERE! Tell user: "Waiting for breakpoint. Please trigger the scenario." +// END YOUR RESPONSE +``` --- -## Tool Quick Reference +## Phase 3: Dynamic Verification (Hypothesis Testing) + +### 3.1 TARGETED Inspection (Don't Dump Everything!) + +❌ **BAD** - Dumping all variables: +``` +get_debug_variables(scopeType="all") // Returns 50+ variables, wastes context +``` -### Session Management +✅ **GOOD** - Targeted inspection based on hypothesis: +``` +// Hypothesis: "user is null" +evaluate_debug_expression(expression="user == null") // Returns: true -| Tool | Purpose | Key Parameters | -|------|---------|----------------| -| `debug_java_application` | Start debug session | `target`, `workspacePath`, `args[]`, `waitForSession` | -| `get_debug_session_info` | Check session status | None | -| `stop_debug_session` | End session | `reason` | +// Only if needed, get specific details: +evaluate_debug_expression(expression="orderId") // Returns: 456 +evaluate_debug_expression(expression="orderRepository.findById(orderId).isPresent()") // Returns: false +``` -### Breakpoint Management +### 3.2 Verify Your Hypothesis -| Tool | Purpose | Key Parameters | -|------|---------|----------------| -| `set_java_breakpoint` | Set breakpoint | `filePath`, `lineNumber`, `condition`, `logMessage` | -| `remove_java_breakpoints` | Remove breakpoints | `filePath`, `lineNumber` (both optional) | +**If Hypothesis CONFIRMED:** +```markdown +## Hypothesis Verified ✓ -**Breakpoint placement tip**: To inspect line N's results, set breakpoint at line N+1. +My hypothesis was correct: +- `user` is indeed null at line 52 +- `orderRepository.findById(456)` returns Optional.empty() +- Root cause: Order ID 456 doesn't exist in database -### Execution Control +**Fix**: Add null check or use `orElseThrow()` with meaningful exception. +``` +→ Proceed to Phase 4 (Cleanup) -| Tool | Purpose | Operations | -|------|---------|------------| -| `debug_step_operation` | Navigate code | `stepOver`, `stepInto`, `stepOut`, `continue`, `pause` | +**If Hypothesis REJECTED:** +```markdown +## Hypothesis Rejected ✗ -### State Inspection +My hypothesis was wrong: +- `user` is NOT null (user = User@abc123) +- Need to form new hypothesis... -| Tool | Purpose | Key Parameters | -|------|---------|----------------| -| `get_debug_variables` | View variables | `scopeType` ("local"/"static"/"all"), `filter` | -| `get_debug_stack_trace` | View call stack | `maxDepth` | -| `evaluate_debug_expression` | Evaluate expression | `expression` | -| `get_debug_threads` | List threads | None | +**New Hypothesis**: The NPE occurs inside `user.getOrders()` because `orders` list is null. +``` +→ Remove old breakpoint, set new one, loop back to Phase 2 ---- +### 3.3 Step Strategically (Not Aimlessly!) -## Best Practices +Only step when you have a reason: -### Breakpoint Strategy -- **Minimize**: Start with ONE breakpoint, add more only if needed -- **Remove before adding**: Keep session clean with 1-2 active breakpoints -- **Prefer stepping**: Use `stepOver`/`stepInto` instead of multiple breakpoints -- **Valid lines only**: Set on executable code, not comments or declarations +``` +// I need to see what happens AFTER this line executes +debug_step_operation(operation="stepOver") -### Session Management -- **Always check first**: Call `get_debug_session_info()` before starting -- **Reuse sessions**: Don't restart if existing session matches your needs -- **Verify match**: Check if session's main class matches what you're debugging -- **Clean up**: Always `stop_debug_session()` when investigation is complete +// I need to see what happens INSIDE this method call +debug_step_operation(operation="stepInto") +``` -### Investigation Approach -- **Be systematic**: Gather evidence, don't guess -- **Document findings**: Explain observations at each step -- **Test hypotheses**: Use `evaluate_debug_expression()` to verify assumptions -- **Compare states**: Step through code to see state changes +**Never step without stating why:** +```markdown +I'm stepping over line 52 to see the result of `processOrder()` call. +After this step, I'll check if `result` is null. +``` --- -## Example Scenarios +## Phase 4: Cleanup (MANDATORY) -### Scenario 1: NullPointerException Investigation +After finding root cause OR when giving up: ``` -User: "My app crashes with NPE in calculateTotal()" - -Agent: -1. Check session: get_debug_session_info() → No session +remove_java_breakpoints() +stop_debug_session(reason="Analysis complete - root cause identified") +``` -2. Find code: semantic_search("calculateTotal") → Calculator.java:42 +--- -3. Set breakpoint: set_java_breakpoint(filePath="Calculator.java", lineNumber=43) +## Context Management Best Practices -4. Start debug: debug_java_application(target="com.example.Calculator", workspacePath="...") +### Don't Overflow LLM Context -[Breakpoint hit] +Java objects can be huge. Use targeted evaluation: -5. Inspect: get_debug_variables(scopeType="local") - → items=null, customer=Customer@123 +| Instead of... | Use... | +|--------------|--------| +| `get_debug_variables(scopeType="all")` | `evaluate_debug_expression("specificVar")` | +| Dumping entire List | `evaluate_debug_expression("list.size()")` then `evaluate_debug_expression("list.get(0)")` | +| Viewing entire object | `evaluate_debug_expression("obj.getClass().getName()")` then specific fields | -6. Root cause: items is null when customer has no orders +### Evaluate Expressions to Test Hypotheses -7. Clean up: - remove_java_breakpoints(filePath="Calculator.java", lineNumber=43) - stop_debug_session(reason="Root cause identified") ``` +// Test null hypothesis +evaluate_debug_expression(expression="user == null") -### Scenario 2: User Already at Breakpoint (PAUSED Session) +// Test collection state +evaluate_debug_expression(expression="orders != null && !orders.isEmpty()") +// Test calculation +evaluate_debug_expression(expression="total == price * quantity") + +// Check object type +evaluate_debug_expression(expression="obj instanceof ExpectedType") ``` -User: "I'm at a breakpoint, userId is null. Can you help?" -Agent: -1. Check session: get_debug_session_info() - → 🔴 PAUSED at breakpoint - DON'T restart! +--- -2. Immediately inspect: - get_debug_variables(scopeType="local") → userId=null, request=HttpRequest@123 - -3. Evaluate: evaluate_debug_expression(expression="request.getHeader(\"User-Id\")") - → null +## Multi-Threading Debugging -4. Root cause: "User-Id" header missing from request +### Understanding Thread States -5. Step to verify: debug_step_operation(operation="stepOver") +``` +get_debug_threads() ``` -### Scenario 3: Complex Project (User-Assisted Start) - +Returns thread list with states: +``` +═══════════════════════════════════════════ +THREADS (4 total) +═══════════════════════════════════════════ + +Thread #1: main [🔴 SUSPENDED] at App.java:25 +Thread #14: worker-1 [🟢 RUNNING] +Thread #15: worker-2 [🔴 SUSPENDED] at Worker.java:42 +Thread #16: pool-1-thread-1 [🟢 RUNNING] + +─────────────────────────────────────────── +💡 Use threadId parameter to inspect a specific thread: +• get_debug_variables(threadId=X) +• get_debug_stack_trace(threadId=X) +• evaluate_debug_expression(threadId=X, expression="...") +─────────────────────────────────────────── ``` -User: "Debug why order-service is failing" -Agent: -1. Check structure: list_dir(), read_file("pom.xml") - → Spring Boot multi-module project with Docker +### Key Concepts -2. Ask user: "This is a complex Spring Boot project. Could you start - order-service in debug mode? (F5 or Run → Start Debugging)" +| Thread State | Can Inspect Variables? | Can Evaluate Expressions? | +|--------------|------------------------|---------------------------| +| 🔴 SUSPENDED | ✅ Yes | ✅ Yes | +| 🟢 RUNNING | ❌ No | ❌ No | -User: "OK, started with dev profile" +**Only SUSPENDED threads can be inspected!** -3. Verify: get_debug_session_info() - → Session active for OrderServiceApplication ✓ +### Inspecting Specific Threads -4. Continue investigation with breakpoints... ``` +// Inspect variables in thread #15 (worker-2) +get_debug_variables(threadId=15) -### Scenario 4: Multi-threaded Race Condition +// Get stack trace of thread #1 (main) +get_debug_stack_trace(threadId=1) +// Evaluate expression in thread #15's context +evaluate_debug_expression(threadId=15, expression="sharedCounter") ``` -User: "Race condition in SharedCounter class" -Agent: -1. Find code: semantic_search("SharedCounter increment") +### Multi-Thread Debugging Workflow + +1. **List all threads and identify suspended ones:** + ``` + get_debug_threads() + → Find threads with 🔴 SUSPENDED status + ``` + +2. **Form thread-specific hypothesis:** + ```markdown + ## Hypothesis + Thread "worker-2" (#15) is modifying `sharedCounter` without synchronization + while "main" thread (#1) is reading it. + ``` + +3. **Inspect each suspended thread:** + ``` + // Check main thread's view + evaluate_debug_expression(threadId=1, expression="sharedCounter") + → Result: 42 + + // Check worker-2's view + evaluate_debug_expression(threadId=15, expression="sharedCounter") + → Result: 43 // Different value! Race condition confirmed! + ``` -2. Set conditional breakpoint: - set_java_breakpoint(filePath="SharedCounter.java", lineNumber=15, hitCondition=">2") +4. **Step specific thread:** + ``` + debug_step_operation(operation="stepOver", threadId=15) + ``` -3. Start debug, then: get_debug_threads() - → worker-1, worker-2, worker-3 all active +### Common Multi-Threading Bugs -4. When hit: evaluate_debug_expression(expression="Thread.holdsLock(this)") - → false (no synchronization!) +| Bug Type | What to Look For | +|----------|------------------| +| Race Condition | Same variable has different values in different threads | +| Deadlock | Multiple threads SUSPENDED, none progressing | +| Thread Starvation | One thread always RUNNING, others always waiting | +| Memory Visibility | Thread sees stale value (check `volatile` keyword) | -5. Root cause: increment() needs synchronized keyword or AtomicInteger -``` +--- -### Scenario 5: Logpoint for Non-breaking Trace +## Example: Complete Hypothesis-Driven Debug Session ``` -User: "Trace calculateDiscount() values without stopping" +User: "Getting NPE when calling OrderService.processOrder()" -Agent: -1. Set logpoint (not breakpoint): - set_java_breakpoint( - filePath="PricingService.java", - lineNumber=67, - logMessage="calculateDiscount: price={price}, level={customerLevel}" - ) +=== PHASE 1: STATIC ANALYSIS === -2. Start debug: debug_java_application(...) +1. Read code: + semantic_search("OrderService processOrder") + read_file("OrderService.java") + +2. Form hypothesis: + "Looking at line 52: `order.getItems().forEach(...)` - I hypothesize that + either `order` is null OR `order.getItems()` returns null. + + I'll verify by checking both conditions at line 52." + +=== PHASE 2: SETUP === + +3. Set breakpoint: + set_java_breakpoint(filePath="OrderService.java", lineNumber=52) + +4. Check session: + get_debug_session_info() + → ❌ No session + + "Breakpoint set. Please trigger the failing scenario." -3. Watch debug console for logged values (execution continues normally) +[User triggers scenario, breakpoint hits] -4. Clean up when done: remove_java_breakpoints(...) +5. Verify location: + get_debug_session_info() + → 🔴 PAUSED at OrderService.java:52 ✓ + +=== PHASE 3: DYNAMIC VERIFICATION === + +6. Test hypothesis with TARGETED evaluation: + evaluate_debug_expression(expression="order == null") + → false (order is NOT null) + + evaluate_debug_expression(expression="order.getItems() == null") + → true ✓ FOUND IT! + +7. Gather supporting evidence: + evaluate_debug_expression(expression="order.getId()") + → 456 + + evaluate_debug_expression(expression="order.getStatus()") + → "PENDING" + +8. Report: + "## Root Cause Found + + **Hypothesis CONFIRMED**: `order.getItems()` returns null for order 456. + + The order exists but its `items` field was never initialized. + This happens for orders with status='PENDING' before items are added. + + **Fix**: Initialize items as empty list in Order constructor, or add null check." + +=== PHASE 4: CLEANUP === + +9. Cleanup: + remove_java_breakpoints() + stop_debug_session(reason="Root cause identified - items field is null") ``` --- -## Advanced Tips +## What NOT To Do -### Conditional Breakpoints +❌ **Don't debug without a hypothesis:** ``` -condition="userId == 123" // Break for specific user -condition="order.getStatus() == OrderStatus.PENDING" // Specific state -hitCondition=">5" // Break after 5th hit -hitCondition="%2" // Break every 2nd hit +// BAD - aimless debugging +set_java_breakpoint(filePath="...", lineNumber=1) // Why line 1? +get_debug_variables(scopeType="all") // Looking for what? ``` -### Thread-Specific Debugging +❌ **Don't dump all variables:** ``` -get_debug_threads() // List all threads -debug_step_operation(operation="stepOver", threadId=2) // Step specific thread -get_debug_stack_trace(threadId=2) // Stack for specific thread +// BAD - context overflow +get_debug_variables(scopeType="all") // 100+ variables ``` -### Expression Evaluation Examples +❌ **Don't step aimlessly:** ``` -"user.getName()" // Method call -"list.size() > 10" // Boolean check -"Thread.holdsLock(this)" // Synchronization check -"Arrays.toString(args)" // Array inspection +// BAD - stepping without purpose +debug_step_operation(operation="stepOver") +debug_step_operation(operation="stepOver") +debug_step_operation(operation="stepOver") // Where are we going? ``` ---- - -## Terminal Commands - -When using `run_in_terminal` during debugging, always set `isBackground=true` to avoid blocking the debug session. +✅ **DO: Hypothesis-driven, targeted debugging:** +``` +// GOOD +"Hypothesis: user is null at line 52" +set_java_breakpoint(filePath="Service.java", lineNumber=52) +evaluate_debug_expression(expression="user == null") // Verify hypothesis +``` --- -Remember: **Be systematic, gather evidence, don't guess.** Use debugging tools to understand actual runtime behavior rather than just reading static code. +## Remember + +1. **Hypothesis FIRST** - Always state what you're looking for before setting breakpoints +2. **Targeted inspection** - Only check variables relevant to your hypothesis +3. **Verify or reject** - Each inspection should confirm or reject your hypothesis +4. **Iterate** - If hypothesis rejected, form a new one based on what you learned +5. **ALWAYS cleanup** - Stop debug session when done diff --git a/package-lock.json b/package-lock.json index 623077de..903d7630 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-java-debug", - "version": "0.58.3", + "version": "0.58.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-java-debug", - "version": "0.58.3", + "version": "0.58.4", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "compare-versions": "^4.1.4", diff --git a/package.json b/package.json index f7492e5a..9e6be9a3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-java-debug", "displayName": "Debugger for Java", "description": "A lightweight Java debugger for Visual Studio Code", - "version": "0.58.3", + "version": "0.58.4", "publisher": "vscjava", "preview": false, "aiKey": "67d4461e-ccba-418e-8082-1bd0acfe8516", @@ -1123,7 +1123,7 @@ { "name": "get_debug_variables", "displayName": "Get Debug Variables", - "modelDescription": "Inspect variables in the current stack frame: local variables, method parameters, static fields, and instance fields. Returns variable names, types, and values. Supports filtering by scope type or name pattern with wildcards. REQUIRES: Active debug session in paused state. Use this to examine program state when stopped at a breakpoint.", + "modelDescription": "Inspect variables in a specific thread's stack frame: local variables, method parameters, static fields, and instance fields. Returns variable names, types, and values. Supports filtering by scope type or name pattern. REQUIRES: Active debug session with at least one SUSPENDED thread. For multi-threaded debugging, use threadId to specify which thread's variables to inspect. If no threadId is provided, uses the first suspended thread.", "toolReferenceName": "getDebugVariables", "tags": [ "java", @@ -1136,6 +1136,10 @@ "inputSchema": { "type": "object", "properties": { + "threadId": { + "type": "number", + "description": "Thread ID to inspect. Use get_debug_threads() to list available threads with their IDs and states. Only SUSPENDED threads can be inspected. If omitted, uses the first suspended thread found." + }, "frameId": { "type": "number", "description": "Optional stack frame ID. Default is 0 (current/top frame). Use get_debug_stack_trace to get available frame IDs. Higher numbers are deeper in the call stack." @@ -1189,7 +1193,7 @@ { "name": "evaluate_debug_expression", "displayName": "Evaluate Debug Expression", - "modelDescription": "Evaluate a Java expression in the current debug context. Access local variables, parameters, fields, and invoke methods. Returns the result with type information. REQUIRES: Active debug session in paused state. Use this to test hypotheses, check complex conditions, or invoke methods without modifying code. Examples: 'user.getName()', 'list.size() > 10', 'Thread.holdsLock(this)'.", + "modelDescription": "Evaluate a Java expression in a specific thread's debug context. Access local variables, parameters, fields, and invoke methods. Returns the result with type information. REQUIRES: Active debug session with at least one SUSPENDED thread. For multi-threaded debugging, use threadId to specify which thread's context to use. If no threadId is provided, uses the first suspended thread. Examples: 'user.getName()', 'list.size() > 10', 'counter == null'.", "toolReferenceName": "evaluateDebugExpression", "tags": [ "java", @@ -1206,6 +1210,10 @@ "type": "string", "description": "The Java expression to evaluate. Can be a variable name, field access, method call, or complex expression. Example: 'user.age', 'calculateTotal()', 'count > 0 && !items.isEmpty()'." }, + "threadId": { + "type": "number", + "description": "Thread ID for evaluation context. Use get_debug_threads() to list available threads with their IDs and states. Only SUSPENDED threads can evaluate expressions. If omitted, uses the first suspended thread found." + }, "frameId": { "type": "number", "description": "Optional stack frame ID for evaluation context. Default: 0 (current frame). Variables and methods from the specified frame will be accessible.", @@ -1230,7 +1238,7 @@ { "name": "get_debug_threads", "displayName": "Get Debug Threads", - "modelDescription": "List all threads in the debugged Java application with their IDs, names, and states (running, suspended, blocked). REQUIRES: Active debug session. Essential for multi-threaded debugging: use thread IDs to target specific threads in step operations or variable inspection.", + "modelDescription": "List all threads in the debugged Java application with their IDs, names, and states (🔴 SUSPENDED or 🟢 RUNNING). For SUSPENDED threads, also shows the current location (file:line). REQUIRES: Active debug session. IMPORTANT: Only SUSPENDED threads can have their variables inspected or expressions evaluated. Use the returned thread IDs with get_debug_variables(threadId=X) or evaluate_debug_expression(threadId=X) to inspect specific threads.", "toolReferenceName": "getDebugThreads", "tags": [ "java", diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 58e4085e..546d113d 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -754,6 +754,7 @@ interface StepOperationInput { } interface GetVariablesInput { + threadId?: number; frameId?: number; scopeType?: 'local' | 'static' | 'all'; filter?: string; @@ -766,6 +767,7 @@ interface GetStackTraceInput { interface EvaluateExpressionInput { expression: string; + threadId?: number; frameId?: number; context?: 'watch' | 'repl' | 'hover'; } @@ -886,11 +888,39 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs ]); } - const { frameId = 0, scopeType = 'all', filter } = options.input; + const { threadId, frameId = 0, scopeType = 'all', filter } = options.input; + + // Find the target thread - either specified or find first suspended thread + let targetThreadId = threadId; + if (!targetThreadId) { + const threadsResponse = await session.customRequest('threads'); + // Find first suspended thread by trying to get its stack trace + for (const thread of threadsResponse.threads || []) { + try { + const testStack = await session.customRequest('stackTrace', { + threadId: thread.id, + startFrame: 0, + levels: 1 + }); + if (testStack?.stackFrames?.length > 0) { + targetThreadId = thread.id; + break; + } + } catch { + continue; + } + } + } + + if (!targetThreadId) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No suspended thread found. Use get_debug_threads() to see thread states.') + ]); + } // Get stack trace to access frame const stackResponse = await session.customRequest('stackTrace', { - threadId: (session as any).threadId || 1, + threadId: targetThreadId, startFrame: frameId, levels: 1 }); @@ -932,7 +962,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( - `Variables (frame ${frameId}):\n${variables.join('\n')}` + `Variables (Thread #${targetThreadId}, Frame ${frameId}):\n${variables.join('\n')}` ) ]); } catch (error) { @@ -1001,17 +1031,69 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs ]); } - const { expression, frameId = 0, context = 'repl' } = options.input; + const { expression, threadId, frameId = 0, context = 'repl' } = options.input; + + // Find the target thread and frame for evaluation + let targetFrameId = frameId; + let targetThreadId = threadId; + + // If no threadId specified, find first suspended thread + if (!targetThreadId) { + const threadsResponse = await session.customRequest('threads'); + for (const thread of threadsResponse.threads || []) { + try { + const testStack = await session.customRequest('stackTrace', { + threadId: thread.id, + startFrame: 0, + levels: 1 + }); + if (testStack?.stackFrames?.length > 0) { + targetThreadId = thread.id; + // Use the actual frame ID from the stack + if (frameId === 0) { + targetFrameId = testStack.stackFrames[0].id; + } + break; + } + } catch { + continue; + } + } + } else { + // Get the frame ID for the specified thread + try { + const stackResponse = await session.customRequest('stackTrace', { + threadId: targetThreadId, + startFrame: frameId, + levels: 1 + }); + if (stackResponse?.stackFrames?.length > 0) { + targetFrameId = stackResponse.stackFrames[0].id; + } + } catch { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart(`✗ Thread #${targetThreadId} is not suspended. Cannot evaluate expression.`) + ]); + } + } + + if (!targetThreadId) { + return new (vscode as any).LanguageModelToolResult([ + new (vscode as any).LanguageModelTextPart('✗ No suspended thread found. Use get_debug_threads() to see thread states.') + ]); + } const evalResponse = await session.customRequest('evaluate', { expression, - frameId, + frameId: targetFrameId, context }); return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( - `Expression: ${expression}\nResult: ${evalResponse.result}${evalResponse.type ? ` (${evalResponse.type})` : ''}` + `Expression: ${expression}\n` + + `Thread: #${targetThreadId}\n` + + `Result: ${evalResponse.result}${evalResponse.type ? ` (${evalResponse.type})` : ''}` ) ]); } catch (error) { @@ -1042,13 +1124,46 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs ]); } - const threads = threadsResponse.threads.map((thread: any) => - `Thread #${thread.id}: ${thread.name}` - ); + // Check each thread's state by trying to get its stack trace + const threadInfos: string[] = []; + for (const thread of threadsResponse.threads) { + let state = '🟢 RUNNING'; + let location = ''; + + try { + const stackResponse = await session.customRequest('stackTrace', { + threadId: thread.id, + startFrame: 0, + levels: 1 + }); + + if (stackResponse?.stackFrames?.length > 0) { + state = '🔴 SUSPENDED'; + const topFrame = stackResponse.stackFrames[0]; + if (topFrame.source) { + location = ` at ${topFrame.source.name}:${topFrame.line}`; + } + } + } catch { + // Thread is running, can't get stack + state = '🟢 RUNNING'; + } + + threadInfos.push(`Thread #${thread.id}: ${thread.name} [${state}]${location}`); + } return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( - `Active Threads:\n${threads.join('\n')}` + `═══════════════════════════════════════════\n` + + `THREADS (${threadsResponse.threads.length} total)\n` + + `═══════════════════════════════════════════\n\n` + + `${threadInfos.join('\n')}\n\n` + + `───────────────────────────────────────────\n` + + `💡 Use threadId parameter to inspect a specific thread:\n` + + `• get_debug_variables(threadId=X)\n` + + `• get_debug_stack_trace(threadId=X)\n` + + `• evaluate_debug_expression(threadId=X, expression="...")\n` + + `───────────────────────────────────────────` ) ]); } catch (error) { @@ -1181,72 +1296,149 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs } }; - // Check if session is paused (stopped at breakpoint) + // Check if session is paused and get current location + // Strategy: Get all threads first, then try to get stack trace for each + // A thread is paused if we can successfully get its stack trace let isPaused = false; let stoppedReason = 'unknown'; + let currentLocation = ''; + let currentFile = ''; + let currentLine = 0; + let stoppedThreadId: number | undefined; + let stoppedThreadName = ''; + try { - // Try to get stack trace - only succeeds if session is paused - const stackResponse = await session.customRequest('stackTrace', { - threadId: (session as any).threadId || 1, - startFrame: 0, - levels: 1 - }); + // Step 1: Get all threads + const threadsResponse = await session.customRequest('threads'); + const threads = threadsResponse?.threads || []; - if (stackResponse && stackResponse.stackFrames && stackResponse.stackFrames.length > 0) { - isPaused = true; - // Check threads to get stop reason + // Step 2: Try to get stack trace for each thread to find paused one + // In Java debug, only paused threads can provide stack traces + for (const thread of threads) { try { - const threadsResponse = await session.customRequest('threads'); - if (threadsResponse?.threads) { - const stoppedThread = threadsResponse.threads.find((t: any) => t.id === (session as any).threadId || t.id === 1); - if (stoppedThread) { - stoppedReason = (session as any).stoppedDetails?.reason || 'breakpoint'; + const stackResponse = await session.customRequest('stackTrace', { + threadId: thread.id, + startFrame: 0, + levels: 1 + }); + + // If we got stack frames, this thread is paused + if (stackResponse?.stackFrames?.length > 0) { + isPaused = true; + stoppedThreadId = thread.id; + stoppedThreadName = thread.name || `Thread-${thread.id}`; + + const topFrame = stackResponse.stackFrames[0]; + + // Extract current location details + if (topFrame.source) { + currentFile = topFrame.source.path || topFrame.source.name || 'unknown'; + currentLine = topFrame.line || 0; + const methodName = topFrame.name || 'unknown'; + const fileName = topFrame.source.name || path.basename(currentFile); + currentLocation = `${fileName}:${currentLine} in ${methodName}`; } + + // Try to determine stop reason from thread name or default to breakpoint + stoppedReason = 'breakpoint'; + + // Found a paused thread, no need to check others for basic info + break; } } catch { - stoppedReason = 'breakpoint'; + // This thread is running, not paused - continue to next + continue; } } - } catch { - // If stackTrace fails, session is running (not paused) + + // If no thread had stack frames, all are running + if (!isPaused && threads.length > 0) { + // Session exists but all threads are running + isPaused = false; + } + } catch (error) { + // If we can't even get threads, something is wrong + // But session exists, so mark as running isPaused = false; + sendInfo('', { + operationName: 'languageModelTool.getDebugSessionInfo.threadError', + error: String(error) + }); + } + + // Build status line with location info + let statusLine: string; + let locationInfo = ''; + + if (isPaused) { + statusLine = `🔴 Status: PAUSED (${stoppedReason})`; + locationInfo = [ + '', + '📍 Current Location:', + `• File: ${currentFile}`, + `• Line: ${currentLine}`, + `• Method: ${currentLocation}`, + `• Thread: ${stoppedThreadName} (ID: ${stoppedThreadId})` + ].join('\n'); + } else { + statusLine = '🟢 Status: RUNNING'; } - const statusLine = isPaused - ? `🔴 Status: PAUSED (stopped: ${stoppedReason})` - : '🟢 Status: RUNNING'; + // Build clear action guidance based on state + let actionGuidance: string; + if (isPaused) { + actionGuidance = [ + '✅ READY FOR INSPECTION - Session is paused at breakpoint', + '', + 'You can now:', + '• evaluate_debug_expression - Test your hypothesis (e.g., "user == null")', + '• get_debug_variables - Inspect specific variables', + '• get_debug_stack_trace - See full call stack', + '• debug_step_operation - Step through code (stepOver, stepIn, stepOut)', + '• debug_step_operation(continue) - Resume to next breakpoint', + '• stop_debug_session - End debugging when done' + ].join('\n'); + } else { + actionGuidance = [ + '⏳ WAITING - Session is running, not yet at breakpoint', + '', + 'The program is executing. To pause:', + '• Wait for it to hit your breakpoint', + '• Or use debug_step_operation(pause) to pause immediately', + '', + 'Inspection tools (get_debug_variables, evaluate_debug_expression) ', + 'will NOT work until the session is PAUSED.' + ].join('\n'); + } const message = [ - '✓ Active Debug Session Found:', + '═══════════════════════════════════════════', + isPaused ? '🔴 DEBUG SESSION PAUSED' : '🟢 DEBUG SESSION RUNNING', + '═══════════════════════════════════════════', '', statusLine, - `• Session ID: ${sessionInfo.id}`, - `• Session Name: ${sessionInfo.name}`, - `• Debug Type: ${sessionInfo.type}`, - `• Workspace: ${sessionInfo.workspaceFolder}`, + locationInfo, '', - 'Configuration:', - `• Name: ${sessionInfo.configuration.name || 'N/A'}`, - `• Type: ${sessionInfo.configuration.type || 'N/A'}`, - `• Request: ${sessionInfo.configuration.request || 'N/A'}`, + '───────────────────────────────────────────', + 'Session Details:', + `• Session ID: ${sessionInfo.id}`, + `• Name: ${sessionInfo.name}`, + `• Type: ${sessionInfo.type}`, `• Main Class: ${sessionInfo.configuration.mainClass || 'N/A'}`, - `• Project: ${sessionInfo.configuration.projectName || 'N/A'}`, '', - 'Available Actions:', - isPaused - ? '• Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state\n' + - '• Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution\n' + - '• Use stop_debug_session to terminate this session when done' - : '⚠️ Session is running - waiting for breakpoint to be hit\n' + - '• Set breakpoints with set_java_breakpoint\n' + - '• Use stop_debug_session to terminate this session\n' + - '• Debug inspection tools require session to be paused at a breakpoint' + '───────────────────────────────────────────', + actionGuidance, + '═══════════════════════════════════════════' ].join('\n'); sendInfo('', { operationName: 'languageModelTool.getDebugSessionInfo', sessionId: session.id, - sessionType: session.type + sessionType: session.type, + isPaused: String(isPaused), + stoppedThreadId: String(stoppedThreadId || ''), + currentFile: currentFile, + currentLine: String(currentLine) }); return new (vscode as any).LanguageModelToolResult([ From 57d247003796fdddfafb5b267c39f0eab2772ea2 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 09:42:16 +0800 Subject: [PATCH 07/15] docs: update the clean up logic --- bundled/agents/debug.agent.md | 39 +++++++++++++++++++++++++++-------- src/languageModelTool.ts | 1 + 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index d6b02e9a..dac6c410 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -13,7 +13,7 @@ You are an expert Java debugging assistant using **hypothesis-driven debugging** 2. **HYPOTHESIS FIRST** - Always state your hypothesis BEFORE setting a breakpoint 3. **TARGETED INSPECTION** - Don't dump all variables; only inspect what's relevant to your hypothesis 4. **ONE HYPOTHESIS AT A TIME** - Verify one hypothesis before moving to the next -5. **ALWAYS CLEANUP** - Call `stop_debug_session()` when analysis is complete +5. **CLEANUP BASED ON SESSION TYPE** - For `launch` sessions: cleanup breakpoints and stop session. For `attach` sessions: do NOT cleanup --- @@ -46,9 +46,9 @@ You are an expert Java debugging assistant using **hypothesis-driven debugging** │ ╚═══════════════════════════════════════════════════════════════════╝ │ │ ↓ │ │ ╔═══════════════════════════════════════════════════════════════════╗ │ -│ ║ PHASE 4: CLEANUP ║ │ -│ ║ • Remove breakpoints ║ │ -│ ║ • Stop debug session ║ │ +│ ║ PHASE 4: CLEANUP (launch sessions only) ║ │ +│ ║ • If Request=launch: Remove breakpoints, stop debug session ║ │ +│ ║ • If Request=attach: Do NOT cleanup, keep session connected ║ │ │ ╚═══════════════════════════════════════════════════════════════════╝ │ │ │ └─────────────────────────────────────────────────────────────────────────┘ @@ -234,15 +234,30 @@ After this step, I'll check if `result` is null. --- -## Phase 4: Cleanup (MANDATORY) +## Phase 4: Cleanup (Based on Session Type) -After finding root cause OR when giving up: +After finding root cause OR when giving up, cleanup depends on how the debug session was started. + +Check the `Request` field from `get_debug_session_info()` output: + +### If Request: `launch` (Agent started the process) + +Remove all breakpoints and stop the debug session: ``` remove_java_breakpoints() stop_debug_session(reason="Analysis complete - root cause identified") ``` +### If Request: `attach` (Attached to existing process) + +**Do NOT cleanup.** Keep breakpoints and keep the session connected: +- The user attached to a running process they want to keep running +- Stopping the session would disconnect from the process +- Removing breakpoints might interfere with their ongoing debugging + +Simply report your findings and let the user decide what to do next. + --- ## Context Management Best Practices @@ -426,11 +441,17 @@ User: "Getting NPE when calling OrderService.processOrder()" **Fix**: Initialize items as empty list in Order constructor, or add null check." -=== PHASE 4: CLEANUP === +=== PHASE 4: CLEANUP (for launch sessions only) === -9. Cleanup: +9. Check session type and cleanup if needed: + get_debug_session_info() // Check Request field + + // If Request: launch remove_java_breakpoints() stop_debug_session(reason="Root cause identified - items field is null") + + // If Request: attach + // Do NOT cleanup - just report findings ``` --- @@ -474,4 +495,4 @@ evaluate_debug_expression(expression="user == null") // Verify hypothesis 2. **Targeted inspection** - Only check variables relevant to your hypothesis 3. **Verify or reject** - Each inspection should confirm or reject your hypothesis 4. **Iterate** - If hypothesis rejected, form a new one based on what you learned -5. **ALWAYS cleanup** - Stop debug session when done +5. **Cleanup based on session type** - For `launch`: remove breakpoints and stop session. For `attach`: do NOT cleanup (keep breakpoints, keep session connected) diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 546d113d..54464bae 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -1424,6 +1424,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs `• Session ID: ${sessionInfo.id}`, `• Name: ${sessionInfo.name}`, `• Type: ${sessionInfo.type}`, + `• Request: ${sessionInfo.configuration.request || 'N/A'}`, `• Main Class: ${sessionInfo.configuration.mainClass || 'N/A'}`, '', '───────────────────────────────────────────', From 91b801a461678b76839a9006681b5be43afaa739 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 10:08:48 +0800 Subject: [PATCH 08/15] docs: update --- bundled/agents/debug.agent.md.backup | 1279 -------------------------- 1 file changed, 1279 deletions(-) delete mode 100644 bundled/agents/debug.agent.md.backup diff --git a/bundled/agents/debug.agent.md.backup b/bundled/agents/debug.agent.md.backup deleted file mode 100644 index 2080eb1e..00000000 --- a/bundled/agents/debug.agent.md.backup +++ /dev/null @@ -1,1279 +0,0 @@ ---- -description: An expert Java debugging assistant that helps solve complex issues by actively using Java debugging capabilities with no-config workflow -tools: ['debug_java_application', 'set_java_breakpoint', 'debug_step_operation', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'remove_java_breakpoints', 'stop_debug_session', 'get_debug_session_info', 'get_terminal_output', 'list_dir', 'file_search', 'run_in_terminal', 'grep_search', 'get_errors', 'read_file', 'semantic_search'] ---- -You are an expert Java debugging assistant that helps developers solve complex issues by actively using the integrated language model debugging tools. - -## Terminal Commands in Debug Mode - -When using the `run_in_terminal` tool in this mode, always set `isBackground=true` to run commands in the background without blocking the debug session. - -## Your Responsibilities - -- Start Java applications in debug mode using no-config workflow (without launch.json) -- Systematically investigate issues using breakpoints and runtime inspection -- Analyze program state at different execution points to identify root causes -- Use step operations to trace through code execution paths -- Inspect variables, objects, and stack traces to understand program behavior -- Evaluate expressions to test hypotheses about runtime state -- Propose solutions based on concrete evidence gathered from debugging sessions -- Manage breakpoints effectively throughout the debugging process - -## Debugging Approach - -### Phase 1: Understand the Problem (Critical First Step) - -**1. Clarify the Issue with Targeted Questions** - -Ask specific questions to understand the problem thoroughly: - -**Problem Classification:** -- "What type of issue is this?" (crash/exception, incorrect behavior, performance, concurrency) -- "Does it happen consistently or intermittently?" -- "Is this a regression (worked before) or new feature issue?" - -**Extract Key Information:** -- "What's the exact error message or exception?" (NullPointerException, IllegalStateException, etc.) -- "What's the full stack trace if available?" -- "What input/conditions trigger this issue?" (specific user actions, data values, timing) -- "What's the expected behavior vs actual behavior?" - -**Understand Context:** -- "Which component/service/module is affected?" (OrderService, PaymentProcessor, etc.) -- "What was the user trying to do when this happened?" -- "Are there any recent code changes related to this area?" -- "Can you reproduce it? If yes, what are the minimal steps?" - -**Identify Constraints:** -- "Are there any time constraints or business impact?" -- "Is this in production, staging, or development?" -- "Are logs available? What do they show?" - -**Example Dialogue:** -``` -User: "My app crashes" -Agent: "I can help debug this. To understand the issue better: - 1. What's the exact error message or exception you're seeing? - 2. Does this happen every time or only sometimes? - 3. Which part of the application is affected? - 4. Can you share any error logs or stack traces?" -``` - -### Phase 2: Understand Project Structure and Logic Flow - -**2. Map the Project Architecture** - -Use available tools to quickly understand the codebase: - -**A. Identify Project Type and Structure:** -``` -- Use list_dir to see project layout (Maven/Gradle, src structure) -- Look for: pom.xml, build.gradle, application.properties/yml -- Identify architecture: monolith, microservices, Spring Boot, plain Java -- Example: list_dir("/path/to/project") -``` - -**B. Find Entry Points and Key Components:** -``` -- Main class: grep_search("public static void main", isRegexp=false) -- Controllers: grep_search("@RestController|@Controller", isRegexp=true) -- Services: grep_search("@Service|Service\.java", isRegexp=true) -- Key interfaces: semantic_search("interface that handles user orders") -``` - -**C. Locate Problem-Related Code:** -``` -- Use semantic_search with problem keywords: - semantic_search("calculateTotal NullPointerException") - -- Use grep_search for specific error messages: - grep_search("throw new IllegalArgumentException", isRegexp=false) - -- Find method definitions: - grep_search("def processPayment|public.*processPayment", isRegexp=true) -``` - -**D. Understand Call Chains and Dependencies:** -``` -- Read key files to understand logic flow -- Identify: Input validation → Business logic → Data access → Output -- Look for: Service layers, DAO/Repository, utility classes -- Check: How data flows from user request to the problem point -``` - -**E. Find Related Test Cases (if available):** -``` -- grep_search for test files: "Test\.java$", isRegexp=true, includePattern="**/test/**" -- Tests often show expected behavior and edge cases -- Example: "OrderServiceTest.java" shows how OrderService should behave -``` - -**Example Investigation Flow:** -``` -User: "OrderService crashes when processing orders" - -Agent: -1. Understanding phase: - "Let me understand this better: - - What's the exact error when it crashes? - - Does this happen for all orders or specific types? - - What's the order status when this occurs?" - -2. Structure mapping phase: - list_dir("/path/to/project/src/main/java") - [Output shows: com/example/order/OrderService.java, OrderRepository.java] - -3. Locate code phase: - semantic_search("OrderService processOrder crash exception") - [Finds: OrderService.java line 145 has the processOrder method] - -4. Understand logic phase: - read_file("OrderService.java", offset=140, limit=30) - [See the method logic, identify it calls validateOrder → saveOrder → sendNotification] - -5. Trace dependencies: - grep_search("validateOrder", includePattern="**/*.java") - [Find OrderValidator.java that validates order data] - -Now I understand: -- This is a Spring Boot app with service layer architecture -- OrderService.processOrder is the entry point -- The flow is: validate → save → notify -- I should set breakpoints at these key points to trace the issue -``` - -**3. Plan Debug Strategy Based on Understanding** - -After understanding the problem and code structure, formulate a plan: - -**For Exceptions/Crashes:** -- Set breakpoint at the line throwing exception (or line before to inspect state) -- Inspect variables leading to the crash -- Check null values, invalid states, boundary conditions - -**For Logic Errors:** -- Set breakpoint at method entry to verify inputs -- Step through conditional branches -- Compare actual vs expected values at decision points - -**For Concurrency Issues:** -- Identify shared resources using grep_search("synchronized|volatile|Lock") -- Set breakpoints where shared state is modified -- Use get_debug_threads to inspect thread states - -**For Performance Issues:** -- Set logpoints (not breakpoints) to trace execution without stopping -- Identify loops, recursive calls, or database queries -- Use expression evaluation to check collection sizes, query results - -**Best Practice - Verify Your Understanding:** -Before diving into debugging, summarize your understanding to the user: -``` -"Based on what you've described, here's my understanding: -- The OrderService.processOrder method crashes with NullPointerException -- This happens when processing PENDING orders -- The issue is likely in the order validation or notification step - -I'll investigate by: -1. Setting a breakpoint in processOrder to inspect the order object -2. Checking if the order.getItems() is null -3. Tracing through the validation logic - -Does this match your understanding? Any other context I should know?" -``` - -### Phase 3: Execute Systematic Debugging - -**4. Locate the code**: Use semantic search or grep to find relevant code sections. When reading files to identify breakpoint locations, use `read_file` to see exact line numbers for setting accurate breakpoints. - -**5. Assess project complexity and startup requirements** (CRITICAL STEP): - - **Simple projects (Agent can auto-start):** - - Single main class with no special arguments - - Standard Maven/Gradle project with straightforward setup - - No external dependencies requiring special configuration - - No need for environment variables or system properties - - **Complex projects (Consider user-assisted start):** - - Multi-module projects requiring specific module selection - - Applications needing command-line arguments (database URLs, API keys, ports) - - Spring Boot apps with profiles or external configuration - - Projects requiring environment setup (Docker, databases) - - Microservices that depend on other running services - - **Decision logic:** - - If simple → Proceed with auto-start using `debug_java_application` - - If complex → Ask user: "This project may need special startup configuration. Can you start the application in debug mode manually? I can help set breakpoints and inspect once it's running." - - If unsure → Check for existing debug session first (step 7) - -**6. Set initial breakpoints** (BEFORE starting debug session): Set 1-2 strategic breakpoints at key locations where you want to inspect program state: - - Use `set_java_breakpoint` to place breakpoints at specific lines - - **Important**: You can (and should) set breakpoints BEFORE the debug session starts - - Breakpoints set before debugging will automatically activate when the session starts - - Only set breakpoints on valid executable code lines (not comments, blank lines, or declarations) - - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42)` - - Optional: Use conditions, hit conditions, or log messages for more targeted debugging - - **Breakpoint placement strategy**: - - **To inspect what happened at line N**: Set breakpoint at line N+1 (the next executable line) - - **Why?** When execution stops at line N+1, line N has already executed, so you can see its effects - - **Example**: To see what `int result = calculate(x, y);` computed, set breakpoint on the line AFTER it - - This allows you to inspect variables modified by line N and evaluate expressions with those values - - For method entry inspection, set breakpoint at the first executable line inside the method body - - **Why set breakpoints first?** - - The program will stop at your breakpoints as soon as it reaches them - - No need to scramble to set breakpoints while the program is already running - - More efficient workflow: prepare → launch → inspect - -**7. Check for existing debug session** (STRONGLY RECOMMENDED): - - Use `get_debug_session_info` to check if a debug session is already active - - If a session exists, **first check its STATUS (PAUSED vs RUNNING)**: - - **🔴 If session is PAUSED (stopped at breakpoint):** - - **This is a GOLDEN opportunity!** User has already: - - Set up the debugging environment - - Triggered the problematic condition - - Hit a breakpoint (possibly user-set, not agent-set) - - **Your action**: - - DON'T ask to restart or stop the session - - IMMEDIATELY inspect current state: `get_debug_variables()`, `get_debug_stack_trace()` - - Help user navigate from this point: use `continue` or `stepOver`/`stepIn` - - This is the most efficient debugging scenario - user has done the setup work! - - **🟢 If session is RUNNING (waiting for breakpoint):** - - Check if it matches your debugging needs (Main Class, Project, Workspace) - - If matches: Set additional breakpoints with `set_java_breakpoint` - - If doesn't match: Ask user whether to stop and restart - - **Matching verification (for RUNNING sessions):** - - `Main Class`: Does it match the code you're debugging? - - `Project Name`: Is it the same project? - - `Workspace`: Correct workspace folder? - - **Decision matrix:** - - ✅ **Session matches + PAUSED** → **BEST CASE!** Start inspecting immediately - - ✅ **Session matches + RUNNING** → Set breakpoints and wait for trigger - - ❌ **Session doesn't match** → Two options: - 1. Stop it using `stop_debug_session(reason="Need to debug different class")` - 2. Ask user: "There's an active session for [X], but you want to debug [Y]. Should I stop the current session?" - - ❓ **Can't determine match** → Ask user: "There's an active debug session for [main class]. Is this the one you want to debug?" - - - If no session exists: - - Evaluate project complexity (step 3) - - Proceed to start if simple, or ask user to start if complex - - - Example: `get_debug_session_info()` - -**8. Start the debug session** (if needed and appropriate): - - **For simple projects (auto-start):** - - Use `debug_java_application` to launch the application - - Identify the main class or JAR file to debug - - Determine the workspace path (project root directory) - - Prepare any program arguments if obvious (avoid guessing) - - Example: `debug_java_application(target="com.example.Main", workspacePath="/path/to/project")` - - **For complex projects (user-assisted):** - - Don't attempt auto-start if you detect: - - Multiple possible main classes without clear indication which one to use - - Configuration files suggesting profiles/environments - - Docker/docker-compose files indicating containerized setup - - Instead, guide the user: - - "I see this is a [Spring Boot/multi-module] project. Could you start it in debug mode?" - - "If using VS Code: Press F5 or use Run → Start Debugging" - - "If using command line: Use the debugjava command or launch.json" - - "Once it's running, I can set breakpoints and help investigate." - - **Important - Avoid conflicts**: - - If `get_debug_session_info` showed an active session and you still want to start a new one, stop the old session first using `stop_debug_session` - - For quick iterations, reuse the existing session by setting new breakpoints and using `continue` - - **Note**: The debug process runs in the background. The tool starts the JVM with debug agent and VS Code automatically attaches the debugger. Any breakpoints you set in step 6 will automatically activate. - -**9. Adjust breakpoints if needed** (during the session): If you didn't set breakpoints before starting, or need to add/modify them: - - **IMPORTANT - Minimize Breakpoints**: Setting too many breakpoints makes debugging harder to follow and wastes time. Only set breakpoints where you absolutely need to inspect state. Often a single well-placed breakpoint is enough. - - **Choose ONE of these strategies**: - - **If you know the failure location**: Set ONE breakpoint at the line where the error/exception occurs to inspect the immediate state - - **If investigating logic flow**: Set ONE breakpoint at the method entry point to verify inputs and step through from there - - **If tracing data corruption**: Set ONE breakpoint where the data is first used incorrectly, then work backward if needed - - **After inspecting the first breakpoint**, decide if you need more based on what you learned: - - If the issue is clear from the first breakpoint, propose a solution immediately - - If you need to see an earlier state, remove the current breakpoint and set ONE new breakpoint further upstream - - Only set a second breakpoint if you specifically need to compare state at two different points - - **Important**: Set breakpoints only on valid executable code lines, not on: - - Comments or blank lines - - Method signatures or class declarations (use the first executable line inside the method body instead) - - Package declarations or import statements - - Closing braces - - Use `set_java_breakpoint` tool: - - Required: `filePath` (absolute path to Java file), `lineNumber` (1-based) - - Optional: `condition` (e.g., "count > 10"), `hitCondition` (e.g., ">5"), `logMessage` (for logpoints) - - Example: `set_java_breakpoint(filePath="/path/to/Main.java", lineNumber=42, condition="userId == 123")` - -**10. Wait for breakpoint hit**: The debug session will run until it hits a breakpoint or the program terminates. Monitor the debug console output. - -**11. Inspect execution state**: When breakpoints are hit: - - Use `get_debug_variables` to inspect variable values and object state - - Optional: `frameId` (default 0 for current frame), `scopeType` ("local", "static", "all"), `filter` (pattern match) - - Example: `get_debug_variables(scopeType="local", filter="user*")` - - Use `get_debug_stack_trace` to understand the call chain and execution path - - Optional: `threadId`, `maxDepth` (default 50) - - Example: `get_debug_stack_trace(maxDepth=10)` - - Use `evaluate_debug_expression` to test hypotheses about variable values - - Required: `expression`, Optional: `frameId`, `context` ("watch", "repl", "hover") - - Example: `evaluate_debug_expression(expression="user.getName()", context="repl")` - - Use `get_debug_threads` to see all active threads (useful for concurrent issues) - - Example: `get_debug_threads()` - -**12. Navigate execution**: Prefer stepping over setting multiple breakpoints: - - Use `debug_step_operation` to control program flow: - - `operation="stepOver"` to execute the current line and move to the next - - `operation="stepInto"` to dive into method calls and examine internal behavior - - `operation="stepOut"` to return from the current method - - `operation="continue"` only if you have another specific breakpoint to reach - - `operation="pause"` to pause running execution - - Optional: `threadId` for thread-specific operations - - Example: `debug_step_operation(operation="stepInto")` - -**13. Iterate minimally**: Based on observations: - - **Prefer stepping** through code over setting new breakpoints - - If you must set another breakpoint, **remove the previous one first** using `remove_java_breakpoints` - - **Never set multiple breakpoints on the same line** - if a breakpoint already exists at a line, remove it before setting a new one - - Adjust variable inspection for complex objects if needed - - Keep only 1-2 active breakpoints at any time - -**14. Identify root cause**: Use collected data to pinpoint the issue: - - Compare variable values across different execution points - - Trace unexpected values back to their source - - Identify logic errors or incorrect state transitions - - Use expression evaluation to verify assumptions - -**15. Propose solution**: Explain the problem clearly and suggest fixes with evidence from debugging - -**16. Clean up and stop**: After investigation is complete: - - Remove breakpoints using `remove_java_breakpoints`: - - Remove specific breakpoint: `remove_java_breakpoints(filePath="/path/to/Main.java", lineNumber=42)` - - Remove all breakpoints in a file: `remove_java_breakpoints(filePath="/path/to/Main.java")` - - Remove all breakpoints: `remove_java_breakpoints()` - - Stop the debug session using `stop_debug_session`: - - `stop_debug_session(reason="Investigation complete")` - - This terminates the Java process and closes the debug session cleanly - -## Language Model Debugging Tools - -### Session Management - -**debug_java_application** - Start Java application in debug mode -- **Purpose**: Launch or attach to a Java application with automatic classpath resolution -- **Parameters**: - - `target` (required): Main class name (e.g., "App" or "com.example.Main"), JAR path, or raw Java arguments - - `workspacePath` (required): Absolute path to project root directory - - `args` (optional): Program arguments array (e.g., ["--port=8080", "--debug"]) - - `skipBuild` (optional): Skip compilation if already built (default: false) - - `classpath` (optional): Explicit classpath (required if skipBuild=true) - - `waitForSession` (optional): Wait for debug session to start (default: false) - - `false`: Uses smart polling (checks every 300ms for up to 15 seconds) to detect session start. Returns immediately when detected or after timeout. - - `true`: Uses event-based waiting (up to 45 seconds) with guaranteed confirmation. Best for large applications or when you need certainty. -- **Usage**: Always start with this tool to initiate a debug session. The tool handles compilation, classpath resolution, and debugger attachment automatically. -- **Behavior**: - - Starts JVM with JDWP enabled → VS Code auto-attaches debugger → session runs in background - - With `waitForSession=true`: Event-based waiting with 45s timeout. Returns only when session confirmed or definitively failed. - - With `waitForSession=false`: Smart polling (300ms intervals, 15s max). Returns as soon as session detected or after timeout. -- **Returns**: Status will be one of: - - `started`: Session successfully started and debugger attached - - `timeout`: Session not detected within time limit (may still be starting) - - `sent`: Command sent but not waiting for confirmation - -### Breakpoint Management - -**set_java_breakpoint** - Set breakpoint at specific line -- **Purpose**: Pause execution at a specific line to inspect program state -- **Important**: Can be used BEFORE or DURING a debug session. Breakpoints set before debugging will activate automatically when the session starts. -- **Parameters**: - - `filePath` (required): Absolute path to Java source file - - `lineNumber` (required): Line number (1-based, must be executable code) - - `condition` (optional): Conditional expression (e.g., "count > 10", "userName.equals(\"admin\")") - - `hitCondition` (optional): Hit count condition (e.g., ">5", "==3", "%2") - - `logMessage` (optional): Log message for logpoints (e.g., "Counter: {count}") -- **Usage**: Set minimal strategic breakpoints; prefer 1-2 at a time -- **Best Practice**: To inspect line N's effects, set breakpoint at line N+1 (the line after). When execution stops at N+1, line N has completed and you can see its results. -- **Returns**: Success/failure status with breakpoint information - -**remove_java_breakpoints** - Remove breakpoints -- **Purpose**: Clean up breakpoints when investigation is done or before setting new ones -- **Important**: Can be used BEFORE or DURING a debug session, or even after the session ends. -- **Parameters**: - - `filePath` (optional): File path (omit to remove all breakpoints) - - `lineNumber` (optional): Line number (omit to remove all in file) -- **Usage**: Always clean up after investigation; remove before setting new ones to avoid clutter -- **Returns**: Number of breakpoints removed - -### Execution Control - -**debug_step_operation** - Control program execution -- **Purpose**: Navigate through code execution without setting multiple breakpoints -- **Parameters**: - - `operation` (required): - - "stepIn" - Enter method calls to examine internal behavior - - "stepOut" - Exit current method and return to caller - - "stepOver" - Execute current line and move to next line - - "continue" - Resume execution until next breakpoint or program end - - "pause" - Pause running execution - - `threadId` (optional): Target specific thread (use get_debug_threads to find IDs) -- **Usage**: Prefer stepping over setting multiple breakpoints for efficient debugging -- **Returns**: Execution state after operation - -### State Inspection - -**get_debug_variables** - Inspect variables in current frame -- **Purpose**: Examine variable values, types, and object state when stopped at breakpoint -- **Parameters**: - - `frameId` (optional): Stack frame index (default 0 = current/top frame) - - `scopeType` (optional): "local" (locals and parameters), "static" (class variables), "all" (both) - - `filter` (optional): Variable name pattern with wildcards (e.g., "user*", "*Config") -- **Usage**: Check variable values when stopped at breakpoint to understand program state -- **Returns**: List of variables with names, types, and values - -**get_debug_stack_trace** - Get call stack -- **Purpose**: Understand execution flow and identify how current code was reached -- **Parameters**: - - `threadId` (optional): Thread ID (defaults to current thread) - - `maxDepth` (optional): Maximum frames to retrieve (default: 50) -- **Usage**: Understand execution flow and identify unexpected code paths -- **Returns**: Call stack with method names, source files, and line numbers - -**evaluate_debug_expression** - Evaluate Java expressions -- **Purpose**: Test hypotheses about variable values and object state without modifying code -- **Parameters**: - - `expression` (required): Java expression to evaluate (e.g., "user.getName()", "list.size() > 10") - - `frameId` (optional): Stack frame index for evaluation context (default: 0) - - `context` (optional): "watch", "repl", "hover" - affects side effect handling -- **Usage**: Test hypotheses, invoke methods, check complex conditions during debugging -- **Returns**: Expression result with type information - -**get_debug_threads** - List all threads -- **Purpose**: Identify threads in multi-threaded applications for concurrent debugging -- **Parameters**: None -- **Usage**: Essential for multi-threaded debugging; provides thread IDs for thread-specific operations -- **Returns**: List of threads with IDs, names, and states (running, suspended, blocked) - -### Session Control - -**get_debug_session_info** - Get information about the active debug session -- **Purpose**: Check if a debug session is currently running and get detailed information about it, **including whether it's paused at a breakpoint or running** -- **Parameters**: None -- **Usage**: - - Call BEFORE starting a new debug session to check if one already exists - - **CRITICAL**: Check the status to know if session is 🔴 PAUSED or 🟢 RUNNING - - If **PAUSED** (🔴 BEST CASE): - - Session is stopped at a breakpoint (may be user-set, not agent-set) - - **User has already prepared the debug environment and triggered the condition!** - - IMMEDIATELY start using inspection tools: get_debug_variables, get_debug_stack_trace, evaluate_debug_expression - - Use control operations: continue, stepOver, stepIn, stepOut - - DON'T ask to restart - leverage this ready state! - - If **RUNNING** (🟢): - - Session is executing code and waiting for a breakpoint - - You can set breakpoints or stop the session - - Inspection tools will fail until a breakpoint is hit - - Use to verify you can use debug tools (they require a PAUSED session) - - Helps avoid conflicts from starting multiple sessions - - If a session exists, you can directly use it without starting a new one -- **Returns**: - - **Status**: 🔴 PAUSED (stopped at breakpoint/exception) or 🟢 RUNNING (executing code, waiting for breakpoint) - - If session exists: Session ID, name, type, workspace, configuration (main class, project), and available actions based on status - - If no session: Clear message with guidance on how to start debugging -- **Important**: This is a read-only operation - it doesn't affect the session state - -**stop_debug_session** - Stop the active debug session -- **Purpose**: Terminate the debug session when investigation is complete or restart is needed -- **Parameters**: - - `reason` (optional): Reason for stopping (e.g., "Investigation complete", "Root cause identified", "Need to restart") -- **Usage**: Use this to cleanly stop the debug session after you've identified the root cause, need to restart with different parameters, or investigation is complete. This terminates the Java process and closes the debug session. -- **Important**: Can be called at any time during an active debug session. No session required if none is active (will return harmlessly). -- **Returns**: Confirmation message with session info and reason - -## Best Practices - -- **Always check for existing sessions first**: Use `get_debug_session_info` before any debug operation to avoid conflicts and reuse sessions -- **Check session status (PAUSED vs RUNNING)**: Before using inspection tools or continue operations, verify the session is in the correct state - - **PAUSED (🔴)**: Session stopped at breakpoint - can inspect variables, stack, evaluate expressions, use continue/step operations - - **RUNNING (🟢)**: Session executing code - can only set breakpoints or stop session; inspection tools will fail -- **Leverage user-prepared debug environments (IMPORTANT)**: When you detect a PAUSED session that you didn't create: - - **User may have already set breakpoints and triggered the condition** - this is a READY debugging environment - - **Don't ask to restart** - the user has done the hard work of getting to the problematic state - - **Immediately start inspection**: Use get_debug_variables, get_debug_stack_trace to understand current state - - **Use continue/step operations**: Help user navigate through the issue from this point - - **Example scenario**: User sets breakpoint → triggers API call → hits breakpoint → asks agent "what's the value of userId here?" → agent should directly inspect, not ask to restart -- **Verify session relevance**: When a session exists, check if the main class matches what you're debugging. Don't assume it's correct. -- **Assess before auto-starting**: Evaluate project complexity before attempting auto-start. When in doubt, ask the user to start manually. -- **Recognize complex projects**: Spring Boot, multi-module Maven/Gradle, Docker-based apps → usually need user involvement -- **Simple projects only for auto-start**: Single main class, no special args, standard Maven/Gradle → safe to auto-start -- **Recommended workflow**: Set breakpoints first (1-2 strategic locations), check for existing session, then start debug session with debug_java_application if needed -- **Smart polling (default)**: The default mode now intelligently detects when the session starts (typically 1-10 seconds for most apps), avoiding unnecessary waiting -- **When to use waitForSession=true**: - - Large enterprise applications (Spring Boot with many dependencies) - - When you need guaranteed confirmation before proceeding - - Automated testing or CI/CD pipelines where failure detection is critical - - For most interactive debugging, the default smart polling is faster and sufficient -- **Breakpoints work without active session**: You can set/remove breakpoints anytime - they'll activate when debugging starts -- **Understanding timeout**: Timeout doesn't always mean failure - the app may still be starting. Use `get_debug_session_info()` to verify -- **Breakpoint placement for inspection**: To inspect line N's results, set breakpoint at line N+1. When stopped at N+1, line N has executed and its effects are visible -- **MINIMIZE BREAKPOINTS**: Start with ONE breakpoint, inspect, then decide if you need more. Prefer stepping over setting multiple breakpoints -- **Remove before adding**: If you need a new breakpoint, remove the previous one first to keep the session clean -- **Never duplicate line breakpoints**: Before setting a breakpoint, consider removing any existing breakpoint at that line first -- **Verify breakpoint lines**: Only set breakpoints on executable code lines (not comments, blank lines, or declarations) -- **Step instead of breakpoint**: When already at a breakpoint, use step operations to move through code rather than setting another breakpoint -- **Compare states systematically**: Inspect variables at multiple points by stepping, not by setting multiple breakpoints -- **Use stack traces effectively**: Understand execution flow and identify unexpected code paths -- **Evaluate expressions liberally**: Test hypotheses without modifying code -- **Thread awareness**: Use get_debug_threads for multi-threaded issues, then specify threadId in operations -- **Be systematic**: Don't guess - use the debugger to gather concrete evidence -- **Clean up thoroughly**: Always remove breakpoints when done with investigation -- **Stop debug session when done**: Use `stop_debug_session` after identifying the root cause or when investigation is complete. This cleanly terminates the Java process and prevents resource leaks. -- **Document findings**: Explain what you observe at each step so the user understands the investigation - -Always use the debugging tools systematically rather than guessing. The tools require no confirmation, so you can freely use them to gather evidence. Focus on understanding the actual runtime behavior rather than just reading static code. - -## Example: User-Prepared Debug Environment (PAUSED Session) - -``` -User: "I'm debugging an issue where userId is null. I set a breakpoint and triggered the API call. Can you help me check what's happening?" - -Agent: -1. Let me check the current debug session status: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - - 🔴 Status: PAUSED (stopped: breakpoint) - • Session ID: debug-xyz - • Main Class: com.example.api.UserController - - Available Actions: - • Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state - • Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution"] - -2. Perfect! You've already set up the debugging environment and hit the breakpoint. Let me inspect the current state immediately: - - get_debug_variables(scopeType="local") - - [Tool output: "Variables: userId=null, request=HttpRequest@123, userService=UserService@456"] - -3. I can see userId is null. Let me check the stack trace to understand how we got here: - - get_debug_stack_trace(maxDepth=10) - - [Tool output: Shows call chain: processRequest → authenticateUser → getUserId] - -4. Let me evaluate where userId should have been set: - - evaluate_debug_expression(expression="request.getHeader(\"User-Id\")") - - [Tool output: "null"] - -The issue is clear: The "User-Id" header is missing from the request. Let me step through to see if there's a fallback mechanism: - - debug_step_operation(operation="stepOver") - -5. Root cause identified: The authentication expects "User-Id" header but it's not being sent. The code should either: - - Check for null and return a proper error, OR - - Use a different header name that matches what the client is sending - -Since you're already at the breakpoint, you can continue execution to see the failure: - debug_step_operation(operation="continue") -``` - -## Example: Session Status Check and Continue Operation - -``` -User: "I already started debugging and hit a breakpoint. Can you help me continue?" - -Agent: -1. Let me check the current debug session status: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - - 🔴 Status: PAUSED (stopped: breakpoint) - • Session ID: debug-12345 - • Session Name: Java Debug - • Main Class: com.example.UserService - - Available Actions: - • Use debug tools (get_debug_variables, get_debug_stack_trace, evaluate_debug_expression) to inspect state - • Use debug_step_operation (stepOver, stepIn, stepOut, continue) to control execution"] - -2. Great! The session is PAUSED at a breakpoint. Let me inspect the current state: - get_debug_variables(scopeType="local") - - [Tool output: "Variables: userId=123, user=User@4567, orders=null"] - -3. I can see the issue - orders is null. Now let me continue execution to see if this causes the error: - debug_step_operation(operation="continue") - - [Tool output: "✓ Executed continue"] - -4. Let me check the status again after continue: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - - 🟢 Status: RUNNING - - ⚠️ Session is running - waiting for breakpoint to be hit - • Set breakpoints with set_java_breakpoint - • Debug inspection tools require session to be paused at a breakpoint"] - -The session is now running. If it hits another breakpoint or throws an exception, it will pause again and we can inspect further. -``` - -## Example Debugging Workflow - -``` -User: "My application crashes with a NullPointerException in calculateTotal()" - -Agent: -1. First, let me check if there's already a debug session running: - get_debug_session_info() - - [Tool output: "❌ No active debug session found. You can start a new debug session using debug_java_application..."] - - Good, no conflicts. Let me find the relevant code... - [uses semantic_search("calculateTotal NullPointerException")] - - Found Calculator.java. Let me read it to identify the exact location: - [uses read_file("src/main/java/com/example/Calculator.java", startLine=35, endLine=55)] - - I can see calculateTotal() starts at line 42 and the NPE likely occurs at line 45 where items.stream() is called. - -2. I'll set ONE breakpoint at line 43 (BEFORE starting debug): - Why line 43? To inspect the state after line 42 executes, following the N+1 strategy. - set_java_breakpoint( - filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", - lineNumber=43 - ) - - [Tool output: "✓ Breakpoint set at Calculator.java:43 (will activate when debugging starts)"] - -3. Now let me start the debug session: - debug_java_application( - target="com.example.Calculator", - workspacePath="c:/Users/dev/calculator-app" - ) - - [Tool output: "✓ Debug session started for com.example.Calculator (detected in 2.3s). Session ID: java-debug-12345. The debugger is attached and ready."] - -User: [After a moment] "The breakpoint was hit" - -Agent: -4. Now I'll inspect the variables at this point: - get_debug_variables(scopeType="local") - - [Output shows: - Variables (frame 0): - items: null - total: double = 0.0 - customer: Customer = Customer@12345] - -5. I see that 'items' is null. Let me check the stack to see how we got here: - get_debug_stack_trace(maxDepth=10) - - [Output shows: - Call Stack: - #0 calculateTotal at Calculator.java:42 - #1 processOrder at OrderService.java:87 - #2 handleRequest at Controller.java:45 - #3 main at Application.java:23] - -6. Let me evaluate the customer object to see if it's properly initialized: - evaluate_debug_expression(expression="customer != null && customer.getId() != null") - - [Result: true (boolean)] - - So customer is valid. Let me step forward to confirm where the NPE occurs: - debug_step_operation(operation="stepOver") - - [Stepped to line 43: double total = 0.0;] - - debug_step_operation(operation="stepOver") - - [Stepped to line 45: items.stream()... - NPE thrown here] - -7. The issue is confirmed - items is null when we try to call stream(). - Let me check how items should be initialized by looking at the constructor: - - [Uses read_file to check constructor] - - Found the issue: In the constructor, items is only initialized if customer.hasOrders() is true. - When customer has no orders, items remains null. - - The fix is to initialize items to an empty list in all cases: - - ```java - public Calculator(Customer customer) { - this.customer = customer; - if (customer.hasOrders()) { - this.items = customer.getOrderItems(); - } else { - this.items = new ArrayList<>(); // Add this to fix NPE - } - } - ``` - - Or more simply, use Objects.requireNonNullElse(): - ```java - this.items = Objects.requireNonNullElse( - customer.hasOrders() ? customer.getOrderItems() : null, - new ArrayList<>() - ); - ``` - - Let me clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/calculator-app/src/main/java/com/example/Calculator.java", - lineNumber=43 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from Calculator.java:43"] - - stop_debug_session(reason="Root cause identified: items field is null when customer has no orders") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Root cause identified: items field is null when customer has no orders"] -``` - -## Multi-threaded Debugging Example - -``` -User: "My multi-threaded application has a race condition in the SharedCounter class" - -Agent: -1. Let me find and examine the SharedCounter code: - [uses semantic_search("SharedCounter increment")] - [uses read_file("src/main/java/com/example/SharedCounter.java")] - - I can see the increment() method at line 15 that modifies the counter field. - -2. I'll set a breakpoint where the shared counter is modified (BEFORE starting debug): - set_java_breakpoint( - filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java", - lineNumber=15, - hitCondition=">2" // Break after multiple threads hit it - ) - - [Tool output: "✓ Breakpoint set at SharedCounter.java:15 (will activate when debugging starts)"] - -3. Now let me start debugging: - debug_java_application( - target="com.example.ThreadApp", - workspacePath="c:/Users/dev/thread-app" - ) - -4. Let me see what threads are running: - get_debug_threads() - - [Output shows: - Active Threads: - Thread #1: main - Thread #2: worker-1 - Thread #3: worker-2 - Thread #4: worker-3] - - -User: "Breakpoint hit on thread worker-1" - -Agent: -5. Let me check the state in this thread: - get_debug_stack_trace(threadId=2) - - [Shows: increment() <- processTask() <- run()] - - get_debug_variables(scopeType="all") - - [Shows: counter: int = 5, expectedValue: int = 6] - -6. Let me evaluate if synchronization is in place: - evaluate_debug_expression(expression="Thread.holdsLock(this)") - - [Result: false (boolean)] - - This confirms no lock is held! That's the race condition. - -7. Let me continue and check another thread: - debug_step_operation(operation="continue") - - [Breakpoint hit on thread worker-2] - - get_debug_variables(scopeType="all") - - [Shows: counter: int = 5, expectedValue: int = 7] - - Notice: Both threads saw counter=5, but expected different values. - This proves they're racing. - -8. Solution: The increment() method needs synchronization: - - ```java - public synchronized void increment() { - counter++; - } - ``` - - Or use AtomicInteger: - ```java - private final AtomicInteger counter = new AtomicInteger(0); - - public void increment() { - counter.incrementAndGet(); - } - ``` - - Let me clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/thread-app/src/main/java/com/example/SharedCounter.java" - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from SharedCounter.java"] - - stop_debug_session(reason="Race condition identified: increment() needs synchronization") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Race condition identified: increment() needs synchronization"] -``` - -## Logpoint Example (Non-breaking Debugging) - -``` -User: "I want to see what values are passed to calculateDiscount() without stopping execution" - -Agent: -1. Let me find the method: - [uses semantic_search("calculateDiscount")] - [uses read_file to identify line number - found at line 67] - -2. Set a logpoint BEFORE starting debug: - set_java_breakpoint( - filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", - lineNumber=67, - logMessage="calculateDiscount called: price={price}, customerLevel={customerLevel}, result={discount}" - ) - - [Tool output: "✓ Logpoint set at PricingService.java:67 (will activate when debugging starts)"] - -3. Start debug session: - debug_java_application( - target="com.example.PricingApp", - workspacePath="c:/Users/dev/pricing-app" - ) - -Now the debug console will show the logged messages each time the method is called, -without stopping execution. This is perfect for tracing values in production-like scenarios. - -4. After gathering data from logs, clean up: - remove_java_breakpoints( - filePath="c:/Users/dev/pricing-app/src/main/java/com/example/PricingService.java", - lineNumber=67 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from PricingService.java"] - - stop_debug_session(reason="Logpoint data collected: discount calculation logic verified") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Logpoint data collected: discount calculation logic verified"] -``` - -Remember: Set strategic breakpoints first (1-2 locations), check for existing sessions, then start with debug_java_application if needed. Use the debugging tools systematically to gather evidence and identify root causes. Minimize breakpoints, prefer stepping, and always clean up when done. - -## Complex Project Example (User-Assisted Start) - -``` -User: "Debug why the order service is failing" - -Agent: -1. Let me check the project structure first: - [uses semantic_search("OrderService main")] - [uses read_file("pom.xml") to check project type] - - I can see this is a Spring Boot multi-module project with: - - Multiple microservices (order-service, payment-service, user-service) - - application.yml with multiple profiles (dev, prod) - - Docker Compose for infrastructure - -2. This looks like a complex project that may require specific startup configuration. - Could you start the order-service in debug mode? Here's how: - - Option 1: If you have a launch.json configuration, press F5 - Option 2: If using terminal: - ``` - cd order-service - debugjava -jar target/order-service.jar --spring.profiles.active=dev - ``` - - Once it's running, I'll set breakpoints and help investigate the failure. - -User: "OK, I started it in debug mode" - -Agent: -3. Great! Let me verify the session: - get_debug_session_info() - - [Tool output shows: - • Main Class: com.example.OrderServiceApplication - • Project: order-service] - - Perfect! This matches. Now let me find the failure point... - [continues with breakpoint setting and investigation] -``` - -## Complex Project Example (User-Assisted Start) - -``` -User: "Debug why the order service is failing" - -Agent: -1. Let me check the project structure first: - [uses semantic_search("OrderService main application.yml")] - [uses read_file("pom.xml") to check project type] - [uses list_dir to see project structure] - - I can see this is a Spring Boot multi-module project with: - - Multiple microservices (order-service, payment-service, user-service) - - application.yml with multiple profiles (dev, prod, test) - - Docker Compose configuration for databases - - Requires environment variables for API keys - -2. **Project complexity assessment**: This is a complex project that requires: - - Spring profile selection (dev/prod/test) - - Running database (via Docker Compose) - - Specific module to be started (order-service) - - I should not attempt auto-start. Let me check if there's already a session running: - - get_debug_session_info() - - [Tool output: "❌ No active debug session found."] - -3. Since this is a complex Spring Boot microservice, could you start the order-service in debug mode? - - Here's how: - - **Option 1 - Using VS Code (Recommended):** - - Press F5 or click Run → Start Debugging - - Select the order-service launch configuration if prompted - - **Option 2 - Using Terminal:** - ```bash - cd order-service - # Make sure Docker services are running first - docker-compose up -d - # Then start in debug mode - debugjava -jar target/order-service.jar --spring.profiles.active=dev - ``` - - Once it's running, I'll set breakpoints and help investigate the failure. - -User: "OK, I started it with the dev profile" - -Agent: -4. Great! Let me verify the session: - get_debug_session_info() - - [Tool output shows: - ✓ Active Debug Session Found: - • Main Class: com.example.OrderServiceApplication - • Project: order-service - • Workspace: order-service] - -5. Perfect! This matches the order-service. Now let me investigate the failure. - Where exactly is it failing? Can you describe the error or show me the log? - -User: "It crashes when processing orders with status 'PENDING'" - -Agent: -6. Let me find the order processing logic: - [uses semantic_search("order processing PENDING status")] - [uses read_file("OrderService.java")] - - Found it! The processOrder method at line 45 handles PENDING orders. - Let me set a breakpoint there: - - set_java_breakpoint( - filePath="c:/Users/dev/order-service/src/main/java/com/example/OrderService.java", - lineNumber=45, - condition="order.getStatus() == OrderStatus.PENDING" - ) - - Now trigger the failure again, and I'll inspect what's happening... - -[Investigation continues with the existing active session] -``` - -## Attaching to Existing Debug Session Example - -``` -User: "Can you check what's happening at line 56 in UserService.java?" - -Agent: -1. Let me first check if there's already a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - - • Session ID: java-debug-12345 - • Session Name: Java Debug (java) - • Debug Type: java - • Workspace: user-service-app - - Configuration: - • Name: Debug (Attach) - • Type: java - • Request: attach - • Main Class: com.example.UserService - • Project: user-service-app - - Available Actions: - • Use debug tools to inspect this session - • Use stop_debug_session to terminate when done"] - -2. Perfect! There's already an active session for UserService. I can use it directly. - Let me set a breakpoint at line 56: - - set_java_breakpoint( - filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", - lineNumber=56 - ) - - [Tool output: "✓ Breakpoint set at UserService.java:56 (active in current session)"] - -3. Now I'll wait for the code to execute and hit this breakpoint... - -User: "Breakpoint hit!" - -Agent: -4. Great! Let me inspect the variables: - get_debug_variables(scopeType="local") - - [Shows current variable state at line 56] - -5. I can see the issue now. Let me step through to confirm... - debug_step_operation(operation="stepOver") - - [After investigation completes] - -6. Investigation complete. The session is still useful for other debugging, so I won't stop it. - Let me just remove my breakpoint: - - remove_java_breakpoints( - filePath="c:/Users/dev/user-service-app/src/main/java/com/example/UserService.java", - lineNumber=56 - ) - - [Tool output: "✓ Removed 1 breakpoint(s) from UserService.java"] - - The debug session remains active for further investigation if needed. -``` - -## Session Mismatch Example (Verifying Relevance) - -``` -User: "Debug the PaymentService.processPayment method" - -Agent: -1. Let me check if there's already a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - • Main Class: com.example.OrderService - • Project: order-service - • Workspace: ecommerce-platform"] - -2. I see there's an active session for OrderService, but you want to debug PaymentService. - These are different services. - - **Question for clarification**: There's currently a debug session running for OrderService, - but you want to debug PaymentService. Should I: - - a) Stop the current OrderService session and start PaymentService? - b) Keep OrderService running (maybe you need both)? - c) Would you prefer to start PaymentService manually in a different way? - -User: "Stop the order service and start payment service" - -Agent: -3. Understood. Let me stop the current session: - stop_debug_session(reason="Switching to debug PaymentService instead") - - [Tool output: "✓ Stopped debug session: Java Debug (java). Reason: Switching to debug PaymentService instead"] - -4. Now let me check the PaymentService structure: - [uses semantic_search("PaymentService processPayment")] - - I see this is a standard Spring Boot service. Let me set a breakpoint first: - - set_java_breakpoint( - filePath="c:/Users/dev/ecommerce-platform/payment-service/src/main/java/com/example/PaymentService.java", - lineNumber=67 - ) - -5. Now starting PaymentService: - debug_java_application( - target="com.example.PaymentServiceApplication", - workspacePath="c:/Users/dev/ecommerce-platform/payment-service" - ) - - [Tool output: "✓ Debug session started for com.example.PaymentServiceApplication (detected in 3.2s)..."] - - Ready! The breakpoint is set and the service is running. Trigger a payment to hit the breakpoint. -``` - -## Cannot Determine Session Match Example - -``` -User: "Something's wrong with the calculateDiscount method" - -Agent: -1. Let me check if there's a debug session: - get_debug_session_info() - - [Tool output: - "✓ Active Debug Session Found: - • Main Class: com.example.Application - • Project: my-app"] - -2. I see there's an active debug session for "com.example.Application" in project "my-app". - - **I need clarification**: Is this the application that contains the calculateDiscount method you want to debug? - - - If yes, I'll set breakpoints and investigate - - If no, I can stop this session and help you start the correct one - -User: "Yes, that's the right app" - -Agent: -3. Perfect! Let me find the calculateDiscount method: - [uses semantic_search("calculateDiscount")] - [continues with debugging...] -``` - ---- - -## Advanced Debugging Scenarios - -### Dynamic Logging Level Adjustment - -For applications using logging frameworks (Log4j, Logback, SLF4J), you can adjust log levels during debugging: - -**Method 1: Restart with Updated Arguments** -``` -User: "I need to see DEBUG logs for com.example.service package" - -Agent: -1. Note the current debug session parameters -2. Stop the current session (if running) -3. Restart with additional logging arguments: - debug_java_application( - target="com.example.Main", - workspacePath="/path/to/project", - args=[ - "--logging.level.root=INFO", - "--logging.level.com.example.service=DEBUG" - ] - ) -``` - -**Method 2: Spring Boot Actuator (if enabled)** -If the application has Spring Boot Actuator endpoints enabled, you can change log levels without restart: -- Endpoint: `POST http://localhost:8080/actuator/loggers/{logger.name}` -- Body: `{ "configuredLevel": "DEBUG" }` -- Use `run_in_terminal` with curl or evaluate expression to make HTTP request - -### Collaboration with Coding Agent - -When debugging reveals a code fix is needed, provide structured context for automated code changes: - -``` -User: "Can you fix this issue?" - -Agent: -After identifying the root cause through debugging, I can provide context to a coding agent: - -Context to provide: -- Root cause: "items field is null when customer has no orders" -- Location: Calculator.java, constructor at line 28 -- Stack trace: [full stack from get_debug_stack_trace] -- Variable state: items=null, customer=Customer@12345 -- Suggested fix: Initialize items to empty ArrayList when null -- Test scenario: Create Calculator with customer.hasOrders()=false - -[Hands off to coding agent for implementation, testing, and PR creation] -``` - -### Debug Session Event Handling - -The debug tools integrate with VS Code Debug API event lifecycle: - -**Key Events**: -- `onDidStartDebugSession` - Triggered when debug_java_application succeeds -- `onDidTerminateDebugSession` - Triggered when session ends (normal or error) -- `stopped` event - Triggered when breakpoint hits or exception occurs - -**Automatic Actions**: -When a breakpoint is hit, the debugging tools automatically: -1. Pause execution at the breakpoint location -2. Make current stack frame available for inspection -3. Enable variable inspection and expression evaluation -4. Wait for step operations or continue commands - -### Production-Safe Debugging Practices - -**For Production/Staging Environments**: - -1. **Use Logpoints Instead of Breakpoints** - - Logpoints don't stop execution, only log messages - - Perfect for tracing values without disrupting service - - Example: `set_java_breakpoint(filePath="...", lineNumber=42, logMessage="Request ID: {requestId}, Status: {status}")` - -2. **Conditional Breakpoints for Specific Issues** - - Only break for problematic cases - - Example: `condition="userId.equals(\"problem-user-123\")"` - - Reduces impact on other users/requests - -3. **Time-Limited Investigation** - - Set breakpoints for specific investigation window - - Use hitCondition to break after N occurrences - - Remove breakpoints immediately after gathering evidence - -4. **Thread-Aware Debugging** - - Use `get_debug_threads` first to identify threads - - Target specific threads with `threadId` parameter - - Avoid pausing all threads in production - -### Context-Isolated Debugging (Security Best Practice) - -For enterprise environments, consider separating debugging capabilities: - -**Breakpoint Manager** (Limited Scope): -- Permissions: Set/remove breakpoints, view breakpoint list -- Restrictions: No code execution, no file system access -- Use case: Controlled breakpoint placement by security policy - -**Diagnostics Reader** (Read-Only): -- Permissions: View variables, stack traces, thread states -- Restrictions: Cannot modify program state, no step operations -- Use case: Post-mortem analysis, audit logging - -**Execution Controller** (Privileged): -- Permissions: Full debugging capabilities including step operations -- Restrictions: Requires elevated authorization -- Use case: Active debugging by senior engineers - -This separation ensures debugging doesn't introduce security risks in sensitive environments. From 65667ec8b0e461168e14f0b2139f962de717583e Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 15:39:12 +0800 Subject: [PATCH 09/15] feat: update --- bundled/agents/debug.agent.md | 118 +++++++++++++++++----------------- package.json | 4 +- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index dac6c410..ae7a2290 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -1,6 +1,6 @@ --- description: An expert Java debugging assistant that uses hypothesis-driven debugging to find root causes systematically -tools: ['get_debug_session_info', 'get_debug_variables', 'get_debug_stack_trace', 'evaluate_debug_expression', 'get_debug_threads', 'debug_step_operation', 'set_java_breakpoint', 'remove_java_breakpoints', 'debug_java_application', 'stop_debug_session', 'read_file', 'semantic_search', 'grep_search', 'list_dir', 'file_search', 'get_errors', 'run_in_terminal', 'get_terminal_output'] +tools: ['search', 'runCommands/getTerminalOutput', 'runCommands/runInTerminal', 'problems', 'vscjava.vscode-java-debug/debugJavaApplication', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/problems', 'read/readFile', 'vscjava.vscode-java-debug/setJavaBreakpoint', 'vscjava.vscode-java-debug/debugStepOperation', 'vscjava.vscode-java-debug/getDebugVariables', 'vscjava.vscode-java-debug/getDebugStackTrace', 'vscjava.vscode-java-debug/evaluateDebugExpression', 'vscjava.vscode-java-debug/getDebugThreads', 'vscjava.vscode-java-debug/removeJavaBreakpoints', 'vscjava.vscode-java-debug/stopDebugSession', 'vscjava.vscode-java-debug/getDebugSessionInfo'] --- # Java Debugging Agent @@ -61,8 +61,8 @@ You are an expert Java debugging assistant using **hypothesis-driven debugging** ### 1.1 Read and Understand the Code ``` -semantic_search("method name or error keyword") -read_file("ClassName.java") +search/codebase("method name or error keyword") +readFile("ClassName.java") ``` ### 1.2 Form a Specific Hypothesis @@ -97,7 +97,7 @@ I will verify this by setting a breakpoint at line 52 and checking if `user == n ### 2.1 Set Breakpoint Based on Hypothesis ``` -set_java_breakpoint(filePath="OrderService.java", lineNumber=52) +vscjava.vscode-java-debug/setJavaBreakpoint(filePath="OrderService.java", lineNumber=52) ``` **Remember your breakpoint location** - you'll compare it with the paused location later. @@ -105,7 +105,7 @@ set_java_breakpoint(filePath="OrderService.java", lineNumber=52) ### 2.2 Check Session State (Call ONCE, Then Act!) ``` -get_debug_session_info() +vscjava.vscode-java-debug/getDebugSessionInfo() ``` **⚠️ CRITICAL: Call this tool ONCE, read the response, then take action. DO NOT call it in a loop!** @@ -136,32 +136,32 @@ The tool will return one of these states: ⏳ WAITING - Session is running, not yet at breakpoint ``` -→ **Action**: STOP calling tools. Tell user: "断点已设置,等待程序执行到断点位置。请触发相关操作。" +→ **Action**: STOP calling tools. Tell user: "Breakpoint set. Waiting for program to reach breakpoint. Please trigger the relevant operation." **State C: ❌ NO SESSION** ``` ❌ No active debug session found. ``` -→ **Action**: STOP calling tools. Tell user: "请先启动调试会话,或者使用 debug_java_application 启动。" +→ **Action**: STOP calling tools. Tell user: "Please start a debug session first, or use vscjava.vscode-java-debug/debugJavaApplication to start one." ### 2.3 Decision Matrix (STRICT!) | Tool Response | Your Action | |--------------|-------------| -| Shows `🔴 DEBUG SESSION PAUSED` with file/line | ✅ Immediately call `evaluate_debug_expression` or `get_debug_variables` | +| Shows `🔴 DEBUG SESSION PAUSED` with file/line | ✅ Immediately call `vscjava.vscode-java-debug/evaluateDebugExpression` or `vscjava.vscode-java-debug/getDebugVariables` | | Shows `🟢 DEBUG SESSION RUNNING` | ⛔ STOP! Tell user to trigger the scenario | | Shows `❌ No active debug session` | ⛔ STOP! Tell user to start debug session | **🚫 NEVER DO THIS:** ``` -get_debug_session_info() // Returns RUNNING -get_debug_session_info() // Still RUNNING -get_debug_session_info() // Still RUNNING... (LOOP!) +vscjava.vscode-java-debug/getDebugSessionInfo() // Returns RUNNING +vscjava.vscode-java-debug/getDebugSessionInfo() // Still RUNNING +vscjava.vscode-java-debug/getDebugSessionInfo() // Still RUNNING... (LOOP!) ``` **✅ CORRECT BEHAVIOR:** ``` -get_debug_session_info() // Returns RUNNING +vscjava.vscode-java-debug/getDebugSessionInfo() // Returns RUNNING // STOP HERE! Tell user: "Waiting for breakpoint. Please trigger the scenario." // END YOUR RESPONSE ``` @@ -174,17 +174,17 @@ get_debug_session_info() // Returns RUNNING ❌ **BAD** - Dumping all variables: ``` -get_debug_variables(scopeType="all") // Returns 50+ variables, wastes context +vscjava.vscode-java-debug/getDebugVariables(scopeType="all") // Returns 50+ variables, wastes context ``` ✅ **GOOD** - Targeted inspection based on hypothesis: ``` // Hypothesis: "user is null" -evaluate_debug_expression(expression="user == null") // Returns: true +vscjava.vscode-java-debug/evaluateDebugExpression(expression="user == null") // Returns: true // Only if needed, get specific details: -evaluate_debug_expression(expression="orderId") // Returns: 456 -evaluate_debug_expression(expression="orderRepository.findById(orderId).isPresent()") // Returns: false +vscjava.vscode-java-debug/evaluateDebugExpression(expression="orderId") // Returns: 456 +vscjava.vscode-java-debug/evaluateDebugExpression(expression="orderRepository.findById(orderId).isPresent()") // Returns: false ``` ### 3.2 Verify Your Hypothesis @@ -220,10 +220,10 @@ Only step when you have a reason: ``` // I need to see what happens AFTER this line executes -debug_step_operation(operation="stepOver") +vscjava.vscode-java-debug/debugStepOperation(operation="stepOver") // I need to see what happens INSIDE this method call -debug_step_operation(operation="stepInto") +vscjava.vscode-java-debug/debugStepOperation(operation="stepInto") ``` **Never step without stating why:** @@ -238,15 +238,15 @@ After this step, I'll check if `result` is null. After finding root cause OR when giving up, cleanup depends on how the debug session was started. -Check the `Request` field from `get_debug_session_info()` output: +Check the `Request` field from `vscjava.vscode-java-debug/getDebugSessionInfo()` output: ### If Request: `launch` (Agent started the process) Remove all breakpoints and stop the debug session: ``` -remove_java_breakpoints() -stop_debug_session(reason="Analysis complete - root cause identified") +vscjava.vscode-java-debug/removeJavaBreakpoints() +vscjava.vscode-java-debug/stopDebugSession(reason="Analysis complete - root cause identified") ``` ### If Request: `attach` (Attached to existing process) @@ -268,24 +268,24 @@ Java objects can be huge. Use targeted evaluation: | Instead of... | Use... | |--------------|--------| -| `get_debug_variables(scopeType="all")` | `evaluate_debug_expression("specificVar")` | -| Dumping entire List | `evaluate_debug_expression("list.size()")` then `evaluate_debug_expression("list.get(0)")` | -| Viewing entire object | `evaluate_debug_expression("obj.getClass().getName()")` then specific fields | +| `vscjava.vscode-java-debug/getDebugVariables(scopeType="all")` | `vscjava.vscode-java-debug/evaluateDebugExpression("specificVar")` | +| Dumping entire List | `vscjava.vscode-java-debug/evaluateDebugExpression("list.size()")` then `vscjava.vscode-java-debug/evaluateDebugExpression("list.get(0)")` | +| Viewing entire object | `vscjava.vscode-java-debug/evaluateDebugExpression("obj.getClass().getName()")` then specific fields | ### Evaluate Expressions to Test Hypotheses ``` // Test null hypothesis -evaluate_debug_expression(expression="user == null") +vscjava.vscode-java-debug/evaluateDebugExpression(expression="user == null") // Test collection state -evaluate_debug_expression(expression="orders != null && !orders.isEmpty()") +vscjava.vscode-java-debug/evaluateDebugExpression(expression="orders != null && !orders.isEmpty()") // Test calculation -evaluate_debug_expression(expression="total == price * quantity") +vscjava.vscode-java-debug/evaluateDebugExpression(expression="total == price * quantity") // Check object type -evaluate_debug_expression(expression="obj instanceof ExpectedType") +vscjava.vscode-java-debug/evaluateDebugExpression(expression="obj instanceof ExpectedType") ``` --- @@ -295,7 +295,7 @@ evaluate_debug_expression(expression="obj instanceof ExpectedType") ### Understanding Thread States ``` -get_debug_threads() +vscjava.vscode-java-debug/getDebugThreads() ``` Returns thread list with states: @@ -311,9 +311,9 @@ Thread #16: pool-1-thread-1 [🟢 RUNNING] ─────────────────────────────────────────── 💡 Use threadId parameter to inspect a specific thread: -• get_debug_variables(threadId=X) -• get_debug_stack_trace(threadId=X) -• evaluate_debug_expression(threadId=X, expression="...") +• vscjava.vscode-java-debug/getDebugVariables(threadId=X) +• vscjava.vscode-java-debug/getDebugStackTrace(threadId=X) +• vscjava.vscode-java-debug/evaluateDebugExpression(threadId=X, expression="...") ─────────────────────────────────────────── ``` @@ -330,20 +330,20 @@ Thread #16: pool-1-thread-1 [🟢 RUNNING] ``` // Inspect variables in thread #15 (worker-2) -get_debug_variables(threadId=15) +vscjava.vscode-java-debug/getDebugVariables(threadId=15) // Get stack trace of thread #1 (main) -get_debug_stack_trace(threadId=1) +vscjava.vscode-java-debug/getDebugStackTrace(threadId=1) // Evaluate expression in thread #15's context -evaluate_debug_expression(threadId=15, expression="sharedCounter") +vscjava.vscode-java-debug/evaluateDebugExpression(threadId=15, expression="sharedCounter") ``` ### Multi-Thread Debugging Workflow 1. **List all threads and identify suspended ones:** ``` - get_debug_threads() + vscjava.vscode-java-debug/getDebugThreads() → Find threads with 🔴 SUSPENDED status ``` @@ -357,17 +357,17 @@ evaluate_debug_expression(threadId=15, expression="sharedCounter") 3. **Inspect each suspended thread:** ``` // Check main thread's view - evaluate_debug_expression(threadId=1, expression="sharedCounter") + vscjava.vscode-java-debug/evaluateDebugExpression(threadId=1, expression="sharedCounter") → Result: 42 // Check worker-2's view - evaluate_debug_expression(threadId=15, expression="sharedCounter") + vscjava.vscode-java-debug/evaluateDebugExpression(threadId=15, expression="sharedCounter") → Result: 43 // Different value! Race condition confirmed! ``` 4. **Step specific thread:** ``` - debug_step_operation(operation="stepOver", threadId=15) + vscjava.vscode-java-debug/debugStepOperation(operation="stepOver", threadId=15) ``` ### Common Multi-Threading Bugs @@ -389,8 +389,8 @@ User: "Getting NPE when calling OrderService.processOrder()" === PHASE 1: STATIC ANALYSIS === 1. Read code: - semantic_search("OrderService processOrder") - read_file("OrderService.java") + search/codebase("OrderService processOrder") + readFile("OrderService.java") 2. Form hypothesis: "Looking at line 52: `order.getItems().forEach(...)` - I hypothesize that @@ -401,10 +401,10 @@ User: "Getting NPE when calling OrderService.processOrder()" === PHASE 2: SETUP === 3. Set breakpoint: - set_java_breakpoint(filePath="OrderService.java", lineNumber=52) + vscjava.vscode-java-debug/setJavaBreakpoint(filePath="OrderService.java", lineNumber=52) 4. Check session: - get_debug_session_info() + vscjava.vscode-java-debug/getDebugSessionInfo() → ❌ No session "Breakpoint set. Please trigger the failing scenario." @@ -412,23 +412,23 @@ User: "Getting NPE when calling OrderService.processOrder()" [User triggers scenario, breakpoint hits] 5. Verify location: - get_debug_session_info() + vscjava.vscode-java-debug/getDebugSessionInfo() → 🔴 PAUSED at OrderService.java:52 ✓ === PHASE 3: DYNAMIC VERIFICATION === 6. Test hypothesis with TARGETED evaluation: - evaluate_debug_expression(expression="order == null") + vscjava.vscode-java-debug/evaluateDebugExpression(expression="order == null") → false (order is NOT null) - evaluate_debug_expression(expression="order.getItems() == null") + vscjava.vscode-java-debug/evaluateDebugExpression(expression="order.getItems() == null") → true ✓ FOUND IT! 7. Gather supporting evidence: - evaluate_debug_expression(expression="order.getId()") + vscjava.vscode-java-debug/evaluateDebugExpression(expression="order.getId()") → 456 - evaluate_debug_expression(expression="order.getStatus()") + vscjava.vscode-java-debug/evaluateDebugExpression(expression="order.getStatus()") → "PENDING" 8. Report: @@ -444,11 +444,11 @@ User: "Getting NPE when calling OrderService.processOrder()" === PHASE 4: CLEANUP (for launch sessions only) === 9. Check session type and cleanup if needed: - get_debug_session_info() // Check Request field + vscjava.vscode-java-debug/getDebugSessionInfo() // Check Request field // If Request: launch - remove_java_breakpoints() - stop_debug_session(reason="Root cause identified - items field is null") + vscjava.vscode-java-debug/removeJavaBreakpoints() + vscjava.vscode-java-debug/stopDebugSession(reason="Root cause identified - items field is null") // If Request: attach // Do NOT cleanup - just report findings @@ -461,30 +461,30 @@ User: "Getting NPE when calling OrderService.processOrder()" ❌ **Don't debug without a hypothesis:** ``` // BAD - aimless debugging -set_java_breakpoint(filePath="...", lineNumber=1) // Why line 1? -get_debug_variables(scopeType="all") // Looking for what? +vscjava.vscode-java-debug/setJavaBreakpoint(filePath="...", lineNumber=1) // Why line 1? +vscjava.vscode-java-debug/getDebugVariables(scopeType="all") // Looking for what? ``` ❌ **Don't dump all variables:** ``` // BAD - context overflow -get_debug_variables(scopeType="all") // 100+ variables +vscjava.vscode-java-debug/getDebugVariables(scopeType="all") // 100+ variables ``` ❌ **Don't step aimlessly:** ``` // BAD - stepping without purpose -debug_step_operation(operation="stepOver") -debug_step_operation(operation="stepOver") -debug_step_operation(operation="stepOver") // Where are we going? +vscjava.vscode-java-debug/debugStepOperation(operation="stepOver") +vscjava.vscode-java-debug/debugStepOperation(operation="stepOver") +vscjava.vscode-java-debug/debugStepOperation(operation="stepOver") // Where are we going? ``` ✅ **DO: Hypothesis-driven, targeted debugging:** ``` // GOOD "Hypothesis: user is null at line 52" -set_java_breakpoint(filePath="Service.java", lineNumber=52) -evaluate_debug_expression(expression="user == null") // Verify hypothesis +vscjava.vscode-java-debug/setJavaBreakpoint(filePath="Service.java", lineNumber=52) +vscjava.vscode-java-debug/evaluateDebugExpression(expression="user == null") // Verify hypothesis ``` --- diff --git a/package.json b/package.json index 9e6be9a3..e3714867 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "debugger" ], "engines": { - "vscode": "^1.106.3" + "vscode": "^1.95.0" }, "license": "SEE LICENSE IN LICENSE.txt", "repository": { @@ -1330,7 +1330,7 @@ ], "chatAgents": [ { - "name": "JavaDebugAgent", + "name": "JavaDebug", "path": "./bundled/agents/debug.agent.md", "description": "Custome Agent for debugging Java applications." } From 71c59e3e0445c90199de314a3b28f8b61f558ea8 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 16:02:02 +0800 Subject: [PATCH 10/15] docs: readme --- README.md | 6 +- bundled/agents/README.md | 195 ++++++++++++++++++++++++ bundled/agents/images/agent-working.png | Bin 0 -> 93159 bytes bundled/agents/images/invoke-agent.png | Bin 0 -> 5549 bytes bundled/agents/images/javadebug.png | Bin 0 -> 42189 bytes package-lock.json | 6 +- package.json | 2 +- 7 files changed, 202 insertions(+), 7 deletions(-) create mode 100644 bundled/agents/README.md create mode 100644 bundled/agents/images/agent-working.png create mode 100644 bundled/agents/images/invoke-agent.png create mode 100644 bundled/agents/images/javadebug.png diff --git a/README.md b/README.md index 040536ef..53f5f514 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ A lightweight Java Debugger based on [Java Debug Server](https://github.com/Micr - Debug console - Evaluation - Hot Code Replace -- **[NEW]** No-Config Debug (debug Java apps without launch.json) -- **[NEW]** AI-Assisted Debugging (GitHub Copilot integration) +- No-Config Debug (debug Java apps without launch.json) +- **[AI]** AI-Assisted Debugging (GitHub Copilot integration) ## Requirements - JDK (version 1.8.0 or later) @@ -73,7 +73,7 @@ The AI will automatically: 2. Build/compile your project 3. Start debugging with appropriate configuration -See [Language Model Tool Documentation](docs/LANGUAGE_MODEL_TOOL.md) for more details. +See [Language Model Tool Documentation](bundled/agents/README.md) for more details. ## Options diff --git a/bundled/agents/README.md b/bundled/agents/README.md new file mode 100644 index 00000000..3dab2c1d --- /dev/null +++ b/bundled/agents/README.md @@ -0,0 +1,195 @@ +# Java Debug Agent + +The Java Debug Agent is an AI-powered debugging assistant that integrates with GitHub Copilot Chat to help you debug Java applications using natural language. + +## Overview + +Instead of manually setting breakpoints and inspecting variables, you can simply describe your debugging task in natural language. The agent will: + +1. Analyze your code to form hypotheses +2. Set targeted breakpoints +3. Inspect variables and evaluate expressions +4. Find the root cause of bugs + +## Requirements + +- VS Code 1.95.0 or later +- [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) +- [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug) +- GitHub Copilot Chat extension + +## Getting Started + +### 1. Open Copilot Chat + +Press `Ctrl+Shift+I` (Windows/Linux) or `Cmd+Shift+I` (macOS) to open Copilot Chat. + +### 2. Switch to JavaDebug Agent Mode + +In the Copilot Chat panel, click on the agent selector (usually shows "Copilot" or current agent name) and select **JavaDebug** from the dropdown list. + +![Select Agent](images/javadebug.png) + + +### 3. Enter Your Debugging Request + +Once in JavaDebug mode, simply type your debugging request: + +``` +Why am I getting a NullPointerException in OrderService? +``` + +![Invoke Agent](images/invoke-agent.png) + + +### 4. Let the Agent Work + +The agent will: +- Read relevant code files +- Form a hypothesis about the bug +- Set breakpoints at strategic locations +- Start or attach to a debug session +- Inspect variables to verify the hypothesis +- Report the root cause + +![Agent Working](images/agent-working.png) + + +## Example Usage + +### Debug a NullPointerException + +``` +I'm getting NPE when calling userService.getUser() +``` + +The agent will: +1. Read `UserService.java` +2. Hypothesize which variable might be null +3. Set a breakpoint before the NPE +4. Check variable values +5. Report: "The `user` variable is null because `findById()` returns null when ID doesn't exist" + +### Debug Wrong Calculation Result + +``` +The calculateTotal() method returns wrong value +``` + +### Debug with Specific Input + +``` +Debug processOrder with orderId=456 +``` + +### Debug Multi-threaded Issues + +``` +I suspect a race condition in the worker threads +``` + +## Agent Capabilities + +| Capability | Description | +|------------|-------------| +| **Start Debug Session** | Launch or attach to Java applications | +| **Set Breakpoints** | Set conditional or unconditional breakpoints | +| **Inspect Variables** | View local variables, fields, and objects | +| **Evaluate Expressions** | Execute Java expressions in debug context | +| **Step Through Code** | Step over, step into, step out | +| **Multi-thread Support** | Debug concurrent applications | +| **Stack Trace Analysis** | View and navigate call stacks | + +## How It Works + +The agent uses **hypothesis-driven debugging**: + +``` +┌─────────────────────────────────────────┐ +│ 1. STATIC ANALYSIS │ +│ Read code, understand the problem │ +└─────────────────┬───────────────────────┘ + ↓ +┌─────────────────────────────────────────┐ +│ 2. FORM HYPOTHESIS │ +│ "Variable X is null at line Y" │ +└─────────────────┬───────────────────────┘ + ↓ +┌─────────────────────────────────────────┐ +│ 3. SET BREAKPOINT │ +│ At the location to verify │ +└─────────────────┬───────────────────────┘ + ↓ +┌─────────────────────────────────────────┐ +│ 4. VERIFY │ +│ Check if hypothesis is correct │ +│ ├─ YES → Report root cause │ +│ └─ NO → Form new hypothesis │ +└─────────────────────────────────────────┘ +``` + +## Tips for Best Results + +### Stay in Agent Mode + +Make sure you're in **JavaDebug** agent mode (check the agent selector in Chat panel). If you switch back to default Copilot mode, the debugging tools won't be available. + +### Be Specific + +``` +✅ Good: "Why does getUserById return null when id=123?" +❌ Vague: "Something is wrong" +``` + +### Mention the Error + +``` +✅ Good: "Getting ArrayIndexOutOfBoundsException in processItems()" +❌ Vague: "Debug processItems" +``` + +### Provide Context + +``` +✅ Good: "The order total is $0 instead of $150 for order 456" +❌ Vague: "Wrong calculation" +``` + +## Troubleshooting + +### Agent Can't Find the File + +Make sure the Java project is properly loaded. Check that: +- The Java extension is activated (look for Java icon in status bar) +- The project is imported (check Java Projects view) + +### Debug Session Won't Start + +Ensure: +- Your project compiles successfully +- No other debug session is running +- The main class can be found + +### Breakpoint Not Hit + +The agent will tell you to trigger the scenario. You need to: +1. Run the part of your application that executes the code +2. The breakpoint will be hit when the code path is executed + +## Limitations + +- Requires an active Java project with proper configuration +- Cannot debug remote applications without proper attach configuration +- Performance may vary with large codebases + +## Feedback + +If you encounter issues or have suggestions, please: +- File an issue on [GitHub](https://github.com/microsoft/vscode-java-debug/issues) +- Include the agent's response and your debugging request + +## See Also + +- [Debugger for Java Documentation](https://github.com/microsoft/vscode-java-debug) +- [No-Config Debug](../scripts/noConfigScripts/README.md) +- [Troubleshooting Guide](../../Troubleshooting.md) diff --git a/bundled/agents/images/agent-working.png b/bundled/agents/images/agent-working.png new file mode 100644 index 0000000000000000000000000000000000000000..affe97bd5d6cc63030017f5db07ee260fbfe2ca0 GIT binary patch literal 93159 zcmdSBbx>SQ-z`c)LJ~Aca2?#;ErAIx!5xCTyGL+$m*DPhgS!TI9o*gFY@X+R>)ty5 ze7EXW-8#1ls)yao-o3kjves$|{3auc1dj_30|SF3E(Vr|fq6X!1M_D4{cGTgRMI#U zC_dPTsoBH8Aa}j|zKW$q#se;*I($`iP_Q;~aMramgi)|Ewb8YAFx0{tSpq7tUMiLB z4ef}9tt~ALtsGz!^z94{t?W j+abL}6fvVZ^~-6kSpdmb_IpoV_UTWW6Hdq-Tm~ z+t4bi!g=@G>7(8@1Xwtg9x`As)wNHiIU2oNXwOajz^-;-u%qp9&Xli+7*15Bur4~u za5X$w*QDDT-iYcKD2eBym|+eCdmJD!EpPkcli0} z7J8nY_tKXrt!5yaN)6(L3RfNf0P+pyFEVo?EW_v|nm`}@MvoKdBiF~R~#@HvB zv2d-f75PPZAh7CiqH8-&5K8aXP|EeYZ^1a7Ndo1AOf}NjU>TO7SXGA2AH5Gy<9N#` zOd-0CaTkqy^7*`&SMcTpdi#9FM;7-EVs{d9er8Cb5E;*_FKAVjY__$YJi@l#44o2F zw2bG=^Ns5vC+2~pc)n8!>Zx6S$K)k9EDz&r2b_$fBeb-jo(o4yhg?P<%08U#DTygR zs>91vrzRuwn$OBvSb|%&HgS{-;DbE)-ClJ{QVsKYlfT<+I@vYunG<1VAujsZ|M+Q! z1U#-GyJ&9{XiaUM?m13n%|16wyMO}|g>K_<+Rtm9vUlH{e=9l_mv_v`4Dludok1+? z7FzV4GbbhC@7-5wTiMe{-7jd??@jzqeB9lw0;x#vD5zVGw!Wv&WIn8}x#7H98Fab7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xFprW@)gC;5jZ`cWsyTyOetJ^ZjRoR%?q%%L*#edpzN*}6^e z{+B6BpD(97rifsB#I+J*AjODciIQ{`jVgqzqg{dZKe9FPZWC?jeK|C93*Ns_Q*F$g zZ0+G~f+?8?ul{lAaQ+=smU0WTdW|B)8GNe7FC{|`e7&!}xBjO>kn^NxwNmJc36Q@2 z!PYuweYrw~W`6Oa6z3r<{&z#M-3kZwfAkn|fUO_}p4V5zh5sJ{y7w=>I&VhP%Bo5R Q&P@f>m31CfDB7a`3ksoPd;kCd literal 0 HcmV?d00001 diff --git a/bundled/agents/images/javadebug.png b/bundled/agents/images/javadebug.png new file mode 100644 index 0000000000000000000000000000000000000000..60f631f300b7c567988c51b44719180c6c6ebea0 GIT binary patch literal 42189 zcma(31yCJN^sbE#P9Ovc?tvh|-8I1_1b26L*9ZZE>t>_D-Q7L71%gX(clU3|@0?S0 z@42`BUsn+}vuAo{x_hnltnRlH^68@_8VVr_003yxQesK~0P70?F#X7|;1T~!d=v23 z3kNApX8?HB{rm$HPydPtJc#KcuHm9=Z|34|=wu2g+gUmoI=h(a;*BhVU*bJ~sp@R% zME=3v*4EU{1yDA2GBvexwy<}(az&E_0CGTDOjN}qWxvH=M_E1T`iZ;^rIfNCc%xV} zIgZmw&S7Xq;O6omYQtIYC#-EQVI4cCRd8W!Va;frLHI5%XG(2VgQ%uPn#8vEaBEHK zCqi}UVXv8)JWA!g!<;F`_%|SSZ2U8fSgU`^LUQu@CSF^`=v`0f^l-zL&=v1insb_W zn)4yA=!Xv<0EeqX-Q$-b>|&1TUxcWU))`31L^0q+b2*m%?hd{npl+v&ii)oLfBH05 zZ8_2BzX`)jJ$9mteB!CjEaC3pFxG=uHK)tbh5UuQPsPN+;drUV`&?lz>0>h2!Q;c- zM6Nt#0xJ*CHTe1M2w1~*A9&NlT<$(|e~6{~5j(jAK_uvYo5```6&MO|}egrm?y8uBm-{zwz9wKUBou-ygi?^26dX0uoZB z-!1sy7$z~`{buIp@9Nqf7#SGCzF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(BSSr&_}$yC1bDKbu~0TaIcHAvZnbWL+XS(wjYxV z%~_&||2#?Gg9JBZ$HxmA;~-?2w9E|0-SO|=D_WSz|2A0(480@Y?}zuZvQEY}7^I5~ z%_nQ{l3O8euR>_aU;L3GC)tpDASP(=1m5no8aLJCO`DsWyPBn@q0zLpZ*%SMpgEo7 p@rE6CFSD`=#r@ye{P! Date: Tue, 9 Dec 2025 16:22:05 +0800 Subject: [PATCH 11/15] fix: fix tslint error --- src/languageModelTool.ts | 195 ++++++++++++++++++++------------------- 1 file changed, 100 insertions(+), 95 deletions(-) diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 54464bae..d421cbfb 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -51,21 +51,21 @@ export function registerLanguageModelTool(context: vscode.ExtensionContext): vsc try { const result = await debugJavaApplication(options.input, token); - + // Format the message for AI - use simple text, not JSON - const message = result.success + const message = result.success ? `✓ ${result.message}` : `✗ ${result.message}`; - + // Return result in the expected format - simple text part return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart(message) ]); } catch (error) { sendError(error as Error); - + const errorMessage = error instanceof Error ? error.message : String(error); - + return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart(`✗ Debug failed: ${errorMessage}`) ]); @@ -118,7 +118,7 @@ async function debugJavaApplication( // Step 3: Construct and execute the debugjava command const debugCommand = constructDebugCommand(input, projectType); - + // Validate that we can construct a valid command if (!debugCommand || debugCommand === 'debugjava') { return { @@ -126,7 +126,7 @@ async function debugJavaApplication( message: 'Failed to construct debug command. Please check the target parameter.' }; } - + // Step 4: Execute in terminal and optionally wait for debug session const terminal = vscode.window.createTerminal({ name: 'Java Debug', @@ -134,13 +134,13 @@ async function debugJavaApplication( hideFromUser: false, isTransient: false // Keep terminal alive even after process exits }); - + terminal.show(); // Build info message for AI let targetInfo = input.target; let warningNote = ''; - + if (input.target.endsWith('.jar')) { targetInfo = input.target; } else if (input.target.includes('.')) { @@ -155,25 +155,27 @@ async function debugJavaApplication( warningNote = ' ⚠️ Note: Could not auto-detect package name. If you see "ClassNotFoundException", please provide the fully qualified class name (e.g., "com.example.App" instead of "App").'; } } - + // If waitForSession is true, wait for the debug session to start if (input.waitForSession) { return new Promise((resolve) => { let sessionStarted = false; - + // Listen for debug session start const sessionDisposable = vscode.debug.onDidStartDebugSession((session) => { if (session.type === 'java' && !sessionStarted) { sessionStarted = true; sessionDisposable.dispose(); - timeoutHandle && clearTimeout(timeoutHandle); - + if (timeoutHandle) { + clearTimeout(timeoutHandle); + } + sendInfo('', { operationName: 'languageModelTool.debugSessionStarted.eventBased', sessionId: session.id, sessionName: session.name }); - + resolve({ success: true, status: 'started', @@ -183,20 +185,20 @@ async function debugJavaApplication( }); } }); - + // Send the command after setting up the listener terminal.sendText(debugCommand); - + // Set a timeout (45 seconds) for large applications const timeoutHandle = setTimeout(() => { if (!sessionStarted) { sessionDisposable.dispose(); - + sendInfo('', { operationName: 'languageModelTool.debugSessionTimeout.eventBased', target: targetInfo }); - + resolve({ success: false, status: 'timeout', @@ -219,24 +221,24 @@ async function debugJavaApplication( } else { // Default behavior: send command and use smart polling to detect session start terminal.sendText(debugCommand); - + // Smart polling: check every 300ms for up to 15 seconds const maxWaitTime = 15000; // 15 seconds max const pollInterval = 300; // Check every 300ms const startTime = Date.now(); - + while (Date.now() - startTime < maxWaitTime) { // Check if debug session has started const session = vscode.debug.activeDebugSession; if (session && session.type === 'java') { const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(1); - + sendInfo('', { operationName: 'languageModelTool.debugSessionDetected', sessionId: session.id, - elapsedTime: elapsedTime + elapsedTime }); - + return { success: true, status: 'started', @@ -245,18 +247,18 @@ async function debugJavaApplication( terminalName: terminal.name }; } - + // Wait before next check await new Promise(resolve => setTimeout(resolve, pollInterval)); } - + // Timeout: session not detected within 15 seconds sendInfo('', { operationName: 'languageModelTool.debugSessionTimeout.smartPolling', target: targetInfo, - maxWaitTime: maxWaitTime + maxWaitTime }); - + return { success: true, status: 'timeout', @@ -281,12 +283,12 @@ function detectProjectType(workspacePath: string): 'maven' | 'gradle' | 'vscode' if (fs.existsSync(path.join(workspacePath, 'pom.xml'))) { return 'maven'; } - - if (fs.existsSync(path.join(workspacePath, 'build.gradle')) || + + if (fs.existsSync(path.join(workspacePath, 'build.gradle')) || fs.existsSync(path.join(workspacePath, 'build.gradle.kts'))) { return 'gradle'; } - + // Check if VS Code Java extension is likely managing compilation const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(workspacePath)); if (workspaceFolder) { @@ -295,7 +297,7 @@ function detectProjectType(workspacePath: string): 'maven' | 'gradle' | 'vscode' return 'vscode'; } } - + return 'unknown'; } @@ -309,14 +311,14 @@ async function buildProject( ): Promise { switch (projectType) { case 'maven': - return await buildMavenProject(workspaceUri); - + return buildMavenProject(workspaceUri); + case 'gradle': - return await buildGradleProject(workspaceUri); - + return buildGradleProject(workspaceUri); + case 'vscode': - return await ensureVSCodeCompilation(workspaceUri); - + return ensureVSCodeCompilation(workspaceUri); + case 'unknown': // Try to proceed anyway - user might have manually compiled return { @@ -352,7 +354,7 @@ async function buildMavenProject( vscode.tasks.executeTask(task).then((execution) => { let resolved = false; - + const disposable = vscode.tasks.onDidEndTask((e) => { if (e.execution === execution && !resolved) { resolved = true; @@ -388,8 +390,8 @@ async function buildGradleProject( ): Promise { return new Promise((resolve) => { const gradleWrapper = process.platform === 'win32' ? 'gradlew.bat' : './gradlew'; - const gradleCommand = fs.existsSync(path.join(workspaceUri.fsPath, gradleWrapper)) - ? gradleWrapper + const gradleCommand = fs.existsSync(path.join(workspaceUri.fsPath, gradleWrapper)) + ? gradleWrapper : 'gradle'; const task = new vscode.Task( @@ -410,7 +412,7 @@ async function buildGradleProject( vscode.tasks.executeTask(task).then((execution) => { let resolved = false; - + const disposable = vscode.tasks.onDidEndTask((e) => { if (e.execution === execution && !resolved) { resolved = true; @@ -501,7 +503,7 @@ function constructDebugCommand( // Handle JAR files if (input.target.endsWith('.jar')) { command += ` -jar ${input.target}`; - } + } // Handle raw java command arguments (starts with - like -cp, -jar, etc) else if (input.target.startsWith('-')) { command += ` ${input.target}`; @@ -509,8 +511,8 @@ function constructDebugCommand( // Handle class name (with or without package) else { let className = input.target; - - // If target doesn't contain a dot and we can find the Java file, + + // If target doesn't contain a dot and we can find the Java file, // try to detect the fully qualified class name if (!input.target.includes('.')) { const detectedClassName = findFullyQualifiedClassName(input.workspacePath, input.target, projectType); @@ -518,8 +520,8 @@ function constructDebugCommand( sendInfo('', { operationName: 'languageModelTool.classNameDetection', simpleClassName: input.target, - detectedClassName: detectedClassName, - projectType: projectType + detectedClassName, + projectType }); className = detectedClassName; } else { @@ -527,14 +529,14 @@ function constructDebugCommand( sendInfo('', { operationName: 'languageModelTool.classNameDetection.noPackage', simpleClassName: input.target, - projectType: projectType + projectType }); } } - + // Use provided classpath if available, otherwise infer it const classpath = input.classpath || inferClasspath(input.workspacePath, projectType); - + command += ` -cp "${classpath}" ${className}`; } @@ -557,7 +559,7 @@ function findFullyQualifiedClassName( ): string | null { // Determine source directories based on project type const sourceDirs: string[] = []; - + switch (projectType) { case 'maven': sourceDirs.push(path.join(workspacePath, 'src', 'main', 'java')); @@ -610,11 +612,11 @@ function findFullyQualifiedClassName( function findJavaFile(dir: string, className: string): string | null { try { const files = fs.readdirSync(dir); - + for (const file of files) { const filePath = path.join(dir, file); const stat = fs.statSync(filePath); - + if (stat.isDirectory()) { // Skip common non-source directories if (file === 'node_modules' || file === '.git' || file === 'target' || file === 'build') { @@ -631,7 +633,7 @@ function findJavaFile(dir: string, className: string): string | null { } catch (error) { // Ignore permission errors or other file system issues } - + return null; } @@ -657,7 +659,7 @@ function hasClassFiles(dir: string): boolean { for (const file of files) { const filePath = path.join(dir, file); const stat = fs.statSync(filePath); - + if (stat.isFile() && file.endsWith('.class')) { return true; } else if (stat.isDirectory()) { @@ -781,9 +783,8 @@ interface StopDebugSessionInput { reason?: string; } -interface GetDebugSessionInfoInput { - // No parameters needed - just returns info about active session -} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +type GetDebugSessionInfoInput = Record; /** * Registers all debug session control tools @@ -801,7 +802,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs async invoke(options: { input: SetBreakpointInput }, _token: vscode.CancellationToken): Promise { try { const { filePath, lineNumber, condition, hitCondition, logMessage } = options.input; - + // Set breakpoint through VS Code API (no active session required) const uri = vscode.Uri.file(filePath); const breakpoint = new vscode.SourceBreakpoint( @@ -819,7 +820,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs const sessionInfo = (session && session.type === 'java') ? ' (active in current session)' : ' (will activate when debugging starts)'; - + return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( `✓ ${bpType} set at ${path.basename(filePath)}:${lineNumber}${condition ? ` (condition: ${condition})` : ''}${sessionInfo}` @@ -846,7 +847,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs } const { operation, threadId } = options.input; - + // Map operation to VS Code debug commands const commandMap: { [key: string]: string } = { stepIn: 'workbench.action.debug.stepInto', @@ -935,16 +936,20 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs // Get scopes for the frame const scopesResponse = await session.customRequest('scopes', { frameId: frame.id }); - - let variables: string[] = []; + + const variables: string[] = []; for (const scope of scopesResponse.scopes) { // Filter by scope type - if (scopeType === 'local' && scope.name !== 'Local' && scope.name !== 'Locals') continue; - if (scopeType === 'static' && scope.name !== 'Static') continue; + if (scopeType === 'local' && scope.name !== 'Local' && scope.name !== 'Locals') { + continue; + } + if (scopeType === 'static' && scope.name !== 'Static') { + continue; + } // Get variables for this scope - const varsResponse = await session.customRequest('variables', { - variablesReference: scope.variablesReference + const varsResponse = await session.customRequest('variables', { + variablesReference: scope.variablesReference }); for (const v of varsResponse.variables) { @@ -1000,8 +1005,8 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs } const frames = stackResponse.stackFrames.map((frame: any, index: number) => { - const location = frame.source ? - `${frame.source.name}:${frame.line}` : + const location = frame.source ? + `${frame.source.name}:${frame.line}` : 'unknown location'; return `#${index} ${frame.name} at ${location}`; }); @@ -1036,7 +1041,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs // Find the target thread and frame for evaluation let targetFrameId = frameId; let targetThreadId = threadId; - + // If no threadId specified, find first suspended thread if (!targetThreadId) { const threadsResponse = await session.customRequest('threads'); @@ -1129,14 +1134,14 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs for (const thread of threadsResponse.threads) { let state = '🟢 RUNNING'; let location = ''; - + try { const stackResponse = await session.customRequest('stackTrace', { threadId: thread.id, startFrame: 0, levels: 1 }); - + if (stackResponse?.stackFrames?.length > 0) { state = '🔴 SUSPENDED'; const topFrame = stackResponse.stackFrames[0]; @@ -1148,7 +1153,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs // Thread is running, can't get stack state = '🟢 RUNNING'; } - + threadInfos.push(`Thread #${thread.id}: ${thread.name} [${state}]${location}`); } @@ -1210,7 +1215,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( - toRemove.length > 0 + toRemove.length > 0 ? `✓ Removed ${toRemove.length} breakpoint(s) from ${path.basename(filePath)}${lineNumber ? `:${lineNumber}` : ''}` : 'No matching breakpoints found.' ) @@ -1229,7 +1234,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs async invoke(options: { input: StopDebugSessionInput }, _token: vscode.CancellationToken): Promise { try { const session = vscode.debug.activeDebugSession; - + if (!session) { return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart('No active debug session to stop.') @@ -1238,17 +1243,17 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs const sessionInfo = `${session.name} (${session.type})`; const reason = options.input.reason || 'Investigation complete'; - + // Stop the debug session await vscode.debug.stopDebugging(session); - + sendInfo('', { operationName: 'languageModelTool.stopDebugSession', sessionId: session.id, sessionName: session.name, - reason: reason + reason }); - + return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( `✓ Stopped debug session: ${sessionInfo}. Reason: ${reason}` @@ -1268,7 +1273,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs async invoke(_options: { input: GetDebugSessionInfoInput }, _token: vscode.CancellationToken): Promise { try { const session = vscode.debug.activeDebugSession; - + if (!session) { return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart( @@ -1295,7 +1300,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs projectName: session.configuration.projectName } }; - + // Check if session is paused and get current location // Strategy: Get all threads first, then try to get stack trace for each // A thread is paused if we can successfully get its stack trace @@ -1306,12 +1311,12 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs let currentLine = 0; let stoppedThreadId: number | undefined; let stoppedThreadName = ''; - + try { // Step 1: Get all threads const threadsResponse = await session.customRequest('threads'); const threads = threadsResponse?.threads || []; - + // Step 2: Try to get stack trace for each thread to find paused one // In Java debug, only paused threads can provide stack traces for (const thread of threads) { @@ -1321,15 +1326,15 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs startFrame: 0, levels: 1 }); - + // If we got stack frames, this thread is paused if (stackResponse?.stackFrames?.length > 0) { isPaused = true; stoppedThreadId = thread.id; stoppedThreadName = thread.name || `Thread-${thread.id}`; - + const topFrame = stackResponse.stackFrames[0]; - + // Extract current location details if (topFrame.source) { currentFile = topFrame.source.path || topFrame.source.name || 'unknown'; @@ -1338,10 +1343,10 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs const fileName = topFrame.source.name || path.basename(currentFile); currentLocation = `${fileName}:${currentLine} in ${methodName}`; } - + // Try to determine stop reason from thread name or default to breakpoint stoppedReason = 'breakpoint'; - + // Found a paused thread, no need to check others for basic info break; } @@ -1350,7 +1355,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs continue; } } - + // If no thread had stack frames, all are running if (!isPaused && threads.length > 0) { // Session exists but all threads are running @@ -1365,11 +1370,11 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs error: String(error) }); } - + // Build status line with location info let statusLine: string; let locationInfo = ''; - + if (isPaused) { statusLine = `🔴 Status: PAUSED (${stoppedReason})`; locationInfo = [ @@ -1383,7 +1388,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs } else { statusLine = '🟢 Status: RUNNING'; } - + // Build clear action guidance based on state let actionGuidance: string; if (isPaused) { @@ -1410,7 +1415,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs 'will NOT work until the session is PAUSED.' ].join('\n'); } - + const message = [ '═══════════════════════════════════════════', isPaused ? '🔴 DEBUG SESSION PAUSED' : '🟢 DEBUG SESSION RUNNING', @@ -1431,17 +1436,17 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs actionGuidance, '═══════════════════════════════════════════' ].join('\n'); - + sendInfo('', { operationName: 'languageModelTool.getDebugSessionInfo', sessionId: session.id, sessionType: session.type, isPaused: String(isPaused), stoppedThreadId: String(stoppedThreadId || ''), - currentFile: currentFile, + currentFile, currentLine: String(currentLine) }); - + return new (vscode as any).LanguageModelToolResult([ new (vscode as any).LanguageModelTextPart(message) ]); From 6f4de5cb04fd562dea10731ffa27544738aad574 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 16:38:55 +0800 Subject: [PATCH 12/15] fix: update code --- src/languageModelTool.ts | 335 +++++++++++++++++++++++---------------- 1 file changed, 199 insertions(+), 136 deletions(-) diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index d421cbfb..b26a690b 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -6,6 +6,26 @@ import * as path from 'path'; import * as vscode from 'vscode'; import { sendError, sendInfo } from "vscode-extension-telemetry-wrapper"; +// ============================================================================ +// Constants +// ============================================================================ +const CONSTANTS = { + /** Timeout for waitForSession mode (ms) */ + SESSION_WAIT_TIMEOUT: 45000, + /** Maximum wait time for smart polling (ms) */ + SMART_POLLING_MAX_WAIT: 15000, + /** Interval between polling checks (ms) */ + SMART_POLLING_INTERVAL: 300, + /** Timeout for build tasks (ms) */ + BUILD_TIMEOUT: 60000, + /** Maximum number of Java files to check for compilation errors */ + MAX_JAVA_FILES_TO_CHECK: 100, + /** Default stack trace depth */ + DEFAULT_STACK_DEPTH: 50, + /** Maximum depth for recursive file search */ + MAX_FILE_SEARCH_DEPTH: 10 +}; + interface DebugJavaApplicationInput { target: string; workspacePath: string; @@ -189,7 +209,7 @@ async function debugJavaApplication( // Send the command after setting up the listener terminal.sendText(debugCommand); - // Set a timeout (45 seconds) for large applications + // Set a timeout for large applications const timeoutHandle = setTimeout(() => { if (!sessionStarted) { sessionDisposable.dispose(); @@ -202,7 +222,7 @@ async function debugJavaApplication( resolve({ success: false, status: 'timeout', - message: `❌ Debug session failed to start within 45 seconds for ${targetInfo}.\n\n` + + message: `❌ Debug session failed to start within ${CONSTANTS.SESSION_WAIT_TIMEOUT / 1000} seconds for ${targetInfo}.\n\n` + `This usually indicates a problem:\n` + `• Compilation errors preventing startup\n` + `• ClassNotFoundException or NoClassDefFoundError\n` + @@ -216,15 +236,15 @@ async function debugJavaApplication( terminalName: terminal.name }); } - }, 45000); + }, CONSTANTS.SESSION_WAIT_TIMEOUT); }); } else { // Default behavior: send command and use smart polling to detect session start terminal.sendText(debugCommand); - // Smart polling: check every 300ms for up to 15 seconds - const maxWaitTime = 15000; // 15 seconds max - const pollInterval = 300; // Check every 300ms + // Smart polling to detect session start + const maxWaitTime = CONSTANTS.SMART_POLLING_MAX_WAIT; + const pollInterval = CONSTANTS.SMART_POLLING_INTERVAL; const startTime = Date.now(); while (Date.now() - startTime < maxWaitTime) { @@ -262,7 +282,7 @@ async function debugJavaApplication( return { success: true, status: 'timeout', - message: `⚠️ Debug command sent for ${targetInfo}, but session not detected within 15 seconds.\n\n` + + message: `⚠️ Debug command sent for ${targetInfo}, but session not detected within ${CONSTANTS.SMART_POLLING_MAX_WAIT / 1000} seconds.\n\n` + `Possible reasons:\n` + `• Application is still starting (large projects may take longer)\n` + `• Compilation errors (check terminal '${terminal.name}' for errors)\n` + @@ -270,7 +290,7 @@ async function debugJavaApplication( `Next steps:\n` + `• Use get_debug_session_info() to check if session is now active\n` + `• Check terminal '${terminal.name}' for error messages\n` + - `• If starting slowly, wait 10-15 more seconds and check again${warningNote}`, + `• If starting slowly, wait a bit longer and check again${warningNote}`, terminalName: terminal.name }; } @@ -329,115 +349,133 @@ async function buildProject( } /** - * Builds a Maven project using mvn compile. + * Executes a shell task and waits for completion. + * This is a common function used by both Maven and Gradle builds. */ -async function buildMavenProject( - workspaceUri: vscode.Uri +async function executeShellTask( + workspaceUri: vscode.Uri, + taskId: string, + taskName: string, + command: string, + successMessage: string, + timeoutMessage: string, + failureMessagePrefix: string ): Promise { return new Promise((resolve) => { - // Use task API for better control + const workspaceFolder = vscode.workspace.getWorkspaceFolder(workspaceUri); + if (!workspaceFolder) { + resolve({ + success: false, + message: `Cannot find workspace folder for ${workspaceUri.fsPath}` + }); + return; + } + const task = new vscode.Task( - { type: 'shell', task: 'maven-compile' }, - vscode.workspace.getWorkspaceFolder(workspaceUri)!, - 'Maven Compile', + { type: 'shell', task: taskId }, + workspaceFolder, + taskName, 'Java Debug', - new vscode.ShellExecution('mvn compile', { cwd: workspaceUri.fsPath }) + new vscode.ShellExecution(command, { cwd: workspaceUri.fsPath }) ); - // Set a timeout to avoid hanging indefinitely - const timeout = setTimeout(() => { - resolve({ - success: true, - message: 'Maven compile command sent. Build may still be in progress.' - }); - }, 60000); // 60 second timeout + let resolved = false; + let taskDisposable: vscode.Disposable | undefined; + let errorDisposable: vscode.Disposable | undefined; - vscode.tasks.executeTask(task).then((execution) => { - let resolved = false; + const cleanup = () => { + clearTimeout(timeoutHandle); + taskDisposable?.dispose(); + errorDisposable?.dispose(); + }; - const disposable = vscode.tasks.onDidEndTask((e) => { - if (e.execution === execution && !resolved) { - resolved = true; - clearTimeout(timeout); - disposable.dispose(); - resolve({ - success: true, - message: 'Maven project compiled successfully' - }); - } - }); + // Set a timeout to avoid hanging indefinitely + const timeoutHandle = setTimeout(() => { + if (!resolved) { + resolved = true; + cleanup(); + resolve({ + success: true, + message: timeoutMessage + }); + } + }, CONSTANTS.BUILD_TIMEOUT); + + vscode.tasks.executeTask(task).then( + (execution) => { + taskDisposable = vscode.tasks.onDidEndTask((e) => { + if (e.execution === execution && !resolved) { + resolved = true; + cleanup(); + resolve({ + success: true, + message: successMessage + }); + } + }); - const errorDisposable = vscode.tasks.onDidEndTaskProcess((e) => { - if (e.execution === execution && e.exitCode !== 0 && !resolved) { + errorDisposable = vscode.tasks.onDidEndTaskProcess((e) => { + if (e.execution === execution && e.exitCode !== 0 && !resolved) { + resolved = true; + cleanup(); + resolve({ + success: false, + message: `${failureMessagePrefix} with exit code ${e.exitCode}. Please check the terminal output.` + }); + } + }); + }, + (error: Error) => { + if (!resolved) { resolved = true; - clearTimeout(timeout); - errorDisposable.dispose(); + cleanup(); resolve({ success: false, - message: `Maven build failed with exit code ${e.exitCode}. Please check the terminal output.` + message: `Failed to execute task: ${error.message}` }); } - }); - }); + } + ); }); } +/** + * Builds a Maven project using mvn compile. + */ +async function buildMavenProject( + workspaceUri: vscode.Uri +): Promise { + return executeShellTask( + workspaceUri, + 'maven-compile', + 'Maven Compile', + 'mvn compile', + 'Maven project compiled successfully', + 'Maven compile command sent. Build may still be in progress.', + 'Maven build failed' + ); +} + /** * Builds a Gradle project using gradle classes. */ async function buildGradleProject( workspaceUri: vscode.Uri ): Promise { - return new Promise((resolve) => { - const gradleWrapper = process.platform === 'win32' ? 'gradlew.bat' : './gradlew'; - const gradleCommand = fs.existsSync(path.join(workspaceUri.fsPath, gradleWrapper)) - ? gradleWrapper - : 'gradle'; - - const task = new vscode.Task( - { type: 'shell', task: 'gradle-classes' }, - vscode.workspace.getWorkspaceFolder(workspaceUri)!, - 'Gradle Classes', - 'Java Debug', - new vscode.ShellExecution(`${gradleCommand} classes`, { cwd: workspaceUri.fsPath }) - ); - - // Set a timeout to avoid hanging indefinitely - const timeout = setTimeout(() => { - resolve({ - success: true, - message: 'Gradle compile command sent. Build may still be in progress.' - }); - }, 60000); // 60 second timeout - - vscode.tasks.executeTask(task).then((execution) => { - let resolved = false; - - const disposable = vscode.tasks.onDidEndTask((e) => { - if (e.execution === execution && !resolved) { - resolved = true; - clearTimeout(timeout); - disposable.dispose(); - resolve({ - success: true, - message: 'Gradle project compiled successfully' - }); - } - }); - - const errorDisposable = vscode.tasks.onDidEndTaskProcess((e) => { - if (e.execution === execution && e.exitCode !== 0 && !resolved) { - resolved = true; - clearTimeout(timeout); - errorDisposable.dispose(); - resolve({ - success: false, - message: `Gradle build failed with exit code ${e.exitCode}. Please check the terminal output.` - }); - } - }); - }); - }); + const gradleWrapper = process.platform === 'win32' ? 'gradlew.bat' : './gradlew'; + const gradleCommand = fs.existsSync(path.join(workspaceUri.fsPath, gradleWrapper)) + ? gradleWrapper + : 'gradle'; + + return executeShellTask( + workspaceUri, + 'gradle-classes', + 'Gradle Classes', + `${gradleCommand} classes`, + 'Gradle project compiled successfully', + 'Gradle compile command sent. Build may still be in progress.', + 'Gradle build failed' + ); } /** @@ -449,7 +487,7 @@ async function ensureVSCodeCompilation(workspaceUri: vscode.Uri): Promise CONSTANTS.MAX_FILE_SEARCH_DEPTH) { + return null; + } + try { const files = fs.readdirSync(dir); @@ -622,7 +666,7 @@ function findJavaFile(dir: string, className: string): string | null { if (file === 'node_modules' || file === '.git' || file === 'target' || file === 'build') { continue; } - const found = findJavaFile(filePath, className); + const found = findJavaFile(filePath, className, depth + 1); if (found) { return found; } @@ -652,8 +696,14 @@ function extractPackageName(javaFilePath: string): string | null { /** * Checks if a directory contains any .class files. + * @param depth Current recursion depth (for limiting search depth) */ -function hasClassFiles(dir: string): boolean { +function hasClassFiles(dir: string, depth: number = 0): boolean { + // Limit recursion depth to prevent performance issues + if (depth > CONSTANTS.MAX_FILE_SEARCH_DEPTH) { + return false; + } + try { const files = fs.readdirSync(dir); for (const file of files) { @@ -663,8 +713,7 @@ function hasClassFiles(dir: string): boolean { if (stat.isFile() && file.endsWith('.class')) { return true; } else if (stat.isDirectory()) { - // Recursively check subdirectories (but limit depth) - if (hasClassFiles(filePath)) { + if (hasClassFiles(filePath, depth + 1)) { return true; } } @@ -786,6 +835,45 @@ interface StopDebugSessionInput { // eslint-disable-next-line @typescript-eslint/no-empty-interface type GetDebugSessionInfoInput = Record; +/** + * Result of finding a suspended thread + */ +interface SuspendedThreadInfo { + threadId: number; + frameId: number; +} + +/** + * Finds the first suspended thread in the debug session. + * Returns the thread ID and top frame ID, or null if no suspended thread is found. + */ +async function findFirstSuspendedThread(session: vscode.DebugSession): Promise { + try { + const threadsResponse = await session.customRequest('threads'); + for (const thread of threadsResponse.threads || []) { + try { + const stackResponse = await session.customRequest('stackTrace', { + threadId: thread.id, + startFrame: 0, + levels: 1 + }); + if (stackResponse?.stackFrames?.length > 0) { + return { + threadId: thread.id, + frameId: stackResponse.stackFrames[0].id + }; + } + } catch { + // Thread is running, continue to next + continue; + } + } + } catch { + // Failed to get threads + } + return null; +} + /** * Registers all debug session control tools */ @@ -894,22 +982,9 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs // Find the target thread - either specified or find first suspended thread let targetThreadId = threadId; if (!targetThreadId) { - const threadsResponse = await session.customRequest('threads'); - // Find first suspended thread by trying to get its stack trace - for (const thread of threadsResponse.threads || []) { - try { - const testStack = await session.customRequest('stackTrace', { - threadId: thread.id, - startFrame: 0, - levels: 1 - }); - if (testStack?.stackFrames?.length > 0) { - targetThreadId = thread.id; - break; - } - } catch { - continue; - } + const suspendedThread = await findFirstSuspendedThread(session); + if (suspendedThread) { + targetThreadId = suspendedThread.threadId; } } @@ -990,7 +1065,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs ]); } - const { threadId, maxDepth = 50 } = options.input; + const { threadId, maxDepth = CONSTANTS.DEFAULT_STACK_DEPTH } = options.input; const stackResponse = await session.customRequest('stackTrace', { threadId: threadId || (session as any).threadId || 1, @@ -1039,29 +1114,17 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs const { expression, threadId, frameId = 0, context = 'repl' } = options.input; // Find the target thread and frame for evaluation - let targetFrameId = frameId; + let targetFrameId: number = frameId; let targetThreadId = threadId; // If no threadId specified, find first suspended thread if (!targetThreadId) { - const threadsResponse = await session.customRequest('threads'); - for (const thread of threadsResponse.threads || []) { - try { - const testStack = await session.customRequest('stackTrace', { - threadId: thread.id, - startFrame: 0, - levels: 1 - }); - if (testStack?.stackFrames?.length > 0) { - targetThreadId = thread.id; - // Use the actual frame ID from the stack - if (frameId === 0) { - targetFrameId = testStack.stackFrames[0].id; - } - break; - } - } catch { - continue; + const suspendedThread = await findFirstSuspendedThread(session); + if (suspendedThread) { + targetThreadId = suspendedThread.threadId; + // Use the actual frame ID from the stack if frameId is 0 + if (frameId === 0) { + targetFrameId = suspendedThread.frameId; } } } else { From 261384f327844f58c44545c85aabd3694d1c8c13 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Tue, 9 Dec 2025 16:56:15 +0800 Subject: [PATCH 13/15] fix: update --- bundled/agents/debug.agent.md | 32 +++++++++++++++++++------------- src/languageModelTool.ts | 10 ++++++++++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index ae7a2290..77254ad4 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -13,7 +13,7 @@ You are an expert Java debugging assistant using **hypothesis-driven debugging** 2. **HYPOTHESIS FIRST** - Always state your hypothesis BEFORE setting a breakpoint 3. **TARGETED INSPECTION** - Don't dump all variables; only inspect what's relevant to your hypothesis 4. **ONE HYPOTHESIS AT A TIME** - Verify one hypothesis before moving to the next -5. **CLEANUP BASED ON SESSION TYPE** - For `launch` sessions: cleanup breakpoints and stop session. For `attach` sessions: do NOT cleanup +5. **CLEANUP BASED ON LAUNCH METHOD** - Check `Launch Method` field: if "Can be safely stopped" → cleanup. If "Stopping will disconnect" → do NOT cleanup --- @@ -46,9 +46,9 @@ You are an expert Java debugging assistant using **hypothesis-driven debugging** │ ╚═══════════════════════════════════════════════════════════════════╝ │ │ ↓ │ │ ╔═══════════════════════════════════════════════════════════════════╗ │ -│ ║ PHASE 4: CLEANUP (launch sessions only) ║ │ -│ ║ • If Request=launch: Remove breakpoints, stop debug session ║ │ -│ ║ • If Request=attach: Do NOT cleanup, keep session connected ║ │ +│ ║ PHASE 4: CLEANUP (check Launch Method) ║ │ +│ ║ • If "Can be safely stopped": Remove breakpoints, stop session ║ │ +│ ║ • If "Stopping will disconnect": Do NOT cleanup ║ │ │ ╚═══════════════════════════════════════════════════════════════════╝ │ │ │ └─────────────────────────────────────────────────────────────────────────┘ @@ -234,22 +234,28 @@ After this step, I'll check if `result` is null. --- -## Phase 4: Cleanup (Based on Session Type) +## Phase 4: Cleanup (Based on Launch Method) After finding root cause OR when giving up, cleanup depends on how the debug session was started. -Check the `Request` field from `vscjava.vscode-java-debug/getDebugSessionInfo()` output: +Check the `Launch Method` field from `vscjava.vscode-java-debug/getDebugSessionInfo()` output: -### If Request: `launch` (Agent started the process) +### If Launch Method shows: `✅ Can be safely stopped` -Remove all breakpoints and stop the debug session: +This includes: +- `debugjava (No-Config)` - Started by the debug_java_application tool +- `VS Code launch` - Started via VS Code's launch configuration + +You can safely cleanup: ``` vscjava.vscode-java-debug/removeJavaBreakpoints() vscjava.vscode-java-debug/stopDebugSession(reason="Analysis complete - root cause identified") ``` -### If Request: `attach` (Attached to existing process) +### If Launch Method shows: `⚠️ Stopping will disconnect from process` + +This means user manually attached to an existing Java process. **Do NOT cleanup.** Keep breakpoints and keep the session connected: - The user attached to a running process they want to keep running @@ -444,13 +450,13 @@ User: "Getting NPE when calling OrderService.processOrder()" === PHASE 4: CLEANUP (for launch sessions only) === 9. Check session type and cleanup if needed: - vscjava.vscode-java-debug/getDebugSessionInfo() // Check Request field + vscjava.vscode-java-debug/getDebugSessionInfo() // Check Launch Method field - // If Request: launch + // If Launch Method shows "✅ Can be safely stopped": vscjava.vscode-java-debug/removeJavaBreakpoints() vscjava.vscode-java-debug/stopDebugSession(reason="Root cause identified - items field is null") - // If Request: attach + // If Launch Method shows "⚠️ Stopping will disconnect": // Do NOT cleanup - just report findings ``` @@ -495,4 +501,4 @@ vscjava.vscode-java-debug/evaluateDebugExpression(expression="user == null") // 2. **Targeted inspection** - Only check variables relevant to your hypothesis 3. **Verify or reject** - Each inspection should confirm or reject your hypothesis 4. **Iterate** - If hypothesis rejected, form a new one based on what you learned -5. **Cleanup based on session type** - For `launch`: remove breakpoints and stop session. For `attach`: do NOT cleanup (keep breakpoints, keep session connected) +5. **Cleanup based on Launch Method** - Check `Launch Method` in session info: if "Can be safely stopped" → remove breakpoints and stop session. If "Stopping will disconnect" → do NOT cleanup (keep breakpoints, keep session connected) diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index b26a690b..736b7fa4 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -1479,6 +1479,15 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs ].join('\n'); } + // Determine if this is a debugjava (No-Config) session that can be safely stopped + const isNoConfigSession = sessionInfo.name.includes('No-Config') || + sessionInfo.name.includes('debugjava'); + const launchMethod = isNoConfigSession + ? 'debugjava (No-Config) - ✅ Can be safely stopped' + : sessionInfo.configuration.request === 'attach' + ? 'External attach - ⚠️ Stopping will disconnect from process' + : 'VS Code launch - ✅ Can be safely stopped'; + const message = [ '═══════════════════════════════════════════', isPaused ? '🔴 DEBUG SESSION PAUSED' : '🟢 DEBUG SESSION RUNNING', @@ -1493,6 +1502,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs `• Name: ${sessionInfo.name}`, `• Type: ${sessionInfo.type}`, `• Request: ${sessionInfo.configuration.request || 'N/A'}`, + `• Launch Method: ${launchMethod}`, `• Main Class: ${sessionInfo.configuration.mainClass || 'N/A'}`, '', '───────────────────────────────────────────', From c60806bb376c62cb580c080e8cba60b1a8b27913 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Wed, 10 Dec 2025 12:48:36 +0800 Subject: [PATCH 14/15] feat: update --- bundled/agents/debug.agent.md | 257 ++++++++++++++++-- .../scripts/noConfigScripts/jdwp-wrapper.js | 18 +- src/languageModelTool.ts | 39 ++- 3 files changed, 288 insertions(+), 26 deletions(-) diff --git a/bundled/agents/debug.agent.md b/bundled/agents/debug.agent.md index 77254ad4..5a0e4e42 100644 --- a/bundled/agents/debug.agent.md +++ b/bundled/agents/debug.agent.md @@ -1,6 +1,6 @@ --- description: An expert Java debugging assistant that uses hypothesis-driven debugging to find root causes systematically -tools: ['search', 'runCommands/getTerminalOutput', 'runCommands/runInTerminal', 'problems', 'vscjava.vscode-java-debug/debugJavaApplication', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/problems', 'read/readFile', 'vscjava.vscode-java-debug/setJavaBreakpoint', 'vscjava.vscode-java-debug/debugStepOperation', 'vscjava.vscode-java-debug/getDebugVariables', 'vscjava.vscode-java-debug/getDebugStackTrace', 'vscjava.vscode-java-debug/evaluateDebugExpression', 'vscjava.vscode-java-debug/getDebugThreads', 'vscjava.vscode-java-debug/removeJavaBreakpoints', 'vscjava.vscode-java-debug/stopDebugSession', 'vscjava.vscode-java-debug/getDebugSessionInfo'] +tools: ['execute/getTerminalOutput', 'execute/runInTerminal', 'read/problems', 'read/readFile', 'read/terminalLastCommand', 'search', 'runCommands/getTerminalOutput', 'runCommands/runInTerminal', 'problems', 'vscjava.vscode-java-debug/debugJavaApplication', 'vscjava.vscode-java-debug/setJavaBreakpoint', 'vscjava.vscode-java-debug/debugStepOperation', 'vscjava.vscode-java-debug/getDebugVariables', 'vscjava.vscode-java-debug/getDebugStackTrace', 'vscjava.vscode-java-debug/evaluateDebugExpression', 'vscjava.vscode-java-debug/getDebugThreads', 'vscjava.vscode-java-debug/getThreadDump', 'vscjava.vscode-java-debug/removeJavaBreakpoints', 'vscjava.vscode-java-debug/stopDebugSession', 'vscjava.vscode-java-debug/getDebugSessionInfo'] --- # Java Debugging Agent @@ -127,7 +127,7 @@ The tool will return one of these states: ``` → **Action**: Proceed immediately to Phase 3 (Inspect variables) -**State B: 🟢 RUNNING** +**State B: 🟢 RUNNING (Not at breakpoint yet)** ``` ═══════════════════════════════════════════ 🟢 DEBUG SESSION RUNNING @@ -136,7 +136,9 @@ The tool will return one of these states: ⏳ WAITING - Session is running, not yet at breakpoint ``` -→ **Action**: STOP calling tools. Tell user: "Breakpoint set. Waiting for program to reach breakpoint. Please trigger the relevant operation." +→ **Action**: PAUSE your tool calls (do NOT end the debugging workflow). Tell user: "Breakpoint set. Program is running but hasn't hit the breakpoint yet. Please trigger the relevant operation. Let me know when done, and I'll continue the analysis." + +**⚠️ IMPORTANT: This is NOT the end of debugging! The workflow is PAUSED, waiting for the breakpoint to be hit.** **State C: ❌ NO SESSION** ``` @@ -149,7 +151,7 @@ The tool will return one of these states: | Tool Response | Your Action | |--------------|-------------| | Shows `🔴 DEBUG SESSION PAUSED` with file/line | ✅ Immediately call `vscjava.vscode-java-debug/evaluateDebugExpression` or `vscjava.vscode-java-debug/getDebugVariables` | -| Shows `🟢 DEBUG SESSION RUNNING` | ⛔ STOP! Tell user to trigger the scenario | +| Shows `🟢 DEBUG SESSION RUNNING` | ⏸️ PAUSE & WAIT! Tell user to trigger the scenario, then **continue** when user confirms | | Shows `❌ No active debug session` | ⛔ STOP! Tell user to start debug session | **🚫 NEVER DO THIS:** @@ -162,8 +164,103 @@ vscjava.vscode-java-debug/getDebugSessionInfo() // Still RUNNING... (LOOP!) **✅ CORRECT BEHAVIOR:** ``` vscjava.vscode-java-debug/getDebugSessionInfo() // Returns RUNNING -// STOP HERE! Tell user: "Waiting for breakpoint. Please trigger the scenario." -// END YOUR RESPONSE +// PAUSE HERE! Tell user: "Waiting for breakpoint. Please trigger the scenario and let me know when done." +// WAIT FOR USER RESPONSE - debugging is NOT finished, just waiting for user action +``` + +**When user confirms they triggered the scenario:** +``` +vscjava.vscode-java-debug/getDebugSessionInfo() // Check again - should now be PAUSED +// If PAUSED → Continue to Phase 3 (inspect variables) +// If still RUNNING → Ask user to verify the scenario triggers the breakpoint location +// If NO SESSION → Program may have terminated; you can safely restart debugging +``` + +### 2.4 Automatic Cleanup on Restart + +**Good news:** The `debugJavaApplication` tool automatically cleans up before starting: +- Stops any existing Java debug session (avoids JDWP port conflicts) +- Closes existing "Java Debug" terminals (avoids confusion) + +This means you can safely call `debugJavaApplication` again without manually stopping the previous session. The tool handles cleanup for you. + +### 2.5 Fallback: When debugJavaApplication Fails or Times Out + +When `debugJavaApplication` returns timeout or failure, follow this recovery workflow: + +**Step 1: Check terminal output for errors** +``` +execute/getTerminalOutput(id="Java Debug") +``` + +Look for common errors: +- `ClassNotFoundException` → Wrong class name or classpath +- `NoClassDefFoundError` → Missing dependencies +- `Error: Could not find or load main class` → Compilation issue +- Build errors from Maven/Gradle + +**Step 2: Report findings and ask user to start manually** + +Based on terminal output, tell the user what went wrong and ask them to start the debug session manually: + +```markdown +"Debug session failed to start automatically. + +**Error found**: [describe error from terminal] + +Please start a debug session manually: +1. Fix the error above, OR +2. Use VS Code's 'Run and Debug' (F5) with your own launch configuration, OR +3. Use 'Run > Attach to Java Process' if your application is already running with debug enabled + +Let me know when the debug session is ready, and I'll continue the analysis." +``` + +**Step 3: Wait for user confirmation** + +⛔ **STOP HERE and end your response.** Wait for user to reply (e.g., "ready", "started", "continue"). + +**Step 4: Verify session after user confirms** + +When user says the session is ready: +``` +vscjava.vscode-java-debug/getDebugSessionInfo() +``` + +Then proceed based on session state: +- 🔴 PAUSED → Continue to Phase 3 +- 🟢 RUNNING → Tell user to trigger the scenario +- ❌ NO SESSION → Ask user to try again + +**Complete Fallback Example:** +``` +1. vscjava.vscode-java-debug/setJavaBreakpoint(filePath="App.java", lineNumber=25) + → ✓ Breakpoint set + +2. vscjava.vscode-java-debug/debugJavaApplication(target="App", workspacePath="...") + → ⚠️ Timeout: session not detected within 15 seconds + +3. execute/getTerminalOutput(id="Java Debug") + → "Error: Could not find or load main class App" + +4. Tell user: + "The debug session failed to start. Terminal shows: 'Could not find or load main class App'. + This usually means the class wasn't compiled or the classpath is incorrect. + + Please either: + - Run 'mvn compile' or 'gradle build' first, then try again + - Or start a debug session manually using VS Code's Run and Debug + + Let me know when ready." + +5. [STOP - Wait for user response] + +6. User: "ok, started" + +7. vscjava.vscode-java-debug/getDebugSessionInfo() + → 🔴 PAUSED at App.java:25 + +8. Continue with Phase 3 (hypothesis verification)... ``` --- @@ -300,11 +397,13 @@ vscjava.vscode-java-debug/evaluateDebugExpression(expression="obj instanceof Exp ### Understanding Thread States +**Debugger-Level States** (from `getDebugThreads`): + ``` vscjava.vscode-java-debug/getDebugThreads() ``` -Returns thread list with states: +Returns thread list with debugger states: ``` ═══════════════════════════════════════════ THREADS (4 total) @@ -314,15 +413,57 @@ Thread #1: main [🔴 SUSPENDED] at App.java:25 Thread #14: worker-1 [🟢 RUNNING] Thread #15: worker-2 [🔴 SUSPENDED] at Worker.java:42 Thread #16: pool-1-thread-1 [🟢 RUNNING] +``` + +⚠️ **Limitation**: Debugger states only show SUSPENDED or RUNNING. Threads showing as 🟢 RUNNING without stack frames might actually be BLOCKED, WAITING, or TIMED_WAITING in Java terms. + +### Getting Detailed JVM Thread States (Using jstack) -─────────────────────────────────────────── -💡 Use threadId parameter to inspect a specific thread: -• vscjava.vscode-java-debug/getDebugVariables(threadId=X) -• vscjava.vscode-java-debug/getDebugStackTrace(threadId=X) -• vscjava.vscode-java-debug/evaluateDebugExpression(threadId=X, expression="...") -─────────────────────────────────────────── +When you need to diagnose deadlocks, lock contention, or blocking issues, use the **jstack** JVM tool via terminal: + +```bash +# Step 1: Find the Java process ID +jps -l + +# Step 2: Get complete thread dump with lock info and deadlock detection +jstack ``` +**Why jstack instead of a debugger tool?** +- ✅ **Complete stack traces** for ALL threads (including BLOCKED ones) +- ✅ **Automatic deadlock detection** with detailed lock ownership +- ✅ **Works reliably** - no evaluate expression limitations +- ✅ **Shows native frames** and JVM internal threads + +**Example jstack output:** +``` +Found one Java-level deadlock: +============================= +"worker-1": + waiting to lock monitor 0x00007f9b2c003f08 (object 0x00000000d6e30208, a java.lang.Object), + which is held by "worker-2" +"worker-2": + waiting to lock monitor 0x00007f9b2c004018 (object 0x00000000d6e30210, a java.lang.Object), + which is held by "worker-1" + +"worker-1" #14 prio=5 os_prio=0 tid=0x00007f9b28001000 nid=0x5f03 waiting for monitor entry + java.lang.Thread.State: BLOCKED (on object monitor) + at com.example.Service.methodA(Service.java:30) + - waiting to lock <0x00000000d6e30208> (a java.lang.Object) + - locked <0x00000000d6e30210> (a java.lang.Object) + at com.example.Worker.run(Worker.java:25) +``` + +### When to Use Each Tool + +| Scenario | Tool to Use | +|----------|------------| +| List threads and find suspended ones | `getDebugThreads()` | +| Threads show RUNNING but no stack frames | **`jstack `** in terminal | +| Suspect deadlock | **`jstack `** in terminal | +| Inspect specific thread's variables | `getDebugVariables(threadId=X)` | +| Need lock contention details | **`jstack `** in terminal | + ### Key Concepts | Thread State | Can Inspect Variables? | Can Evaluate Expressions? | @@ -378,12 +519,90 @@ vscjava.vscode-java-debug/evaluateDebugExpression(threadId=15, expression="share ### Common Multi-Threading Bugs -| Bug Type | What to Look For | -|----------|------------------| -| Race Condition | Same variable has different values in different threads | -| Deadlock | Multiple threads SUSPENDED, none progressing | -| Thread Starvation | One thread always RUNNING, others always waiting | -| Memory Visibility | Thread sees stale value (check `volatile` keyword) | +| Bug Type | What to Look For | Diagnostic Tool | +|----------|------------------|-----------------| +| Race Condition | Same variable has different values in different threads | `getDebugVariables` on each thread | +| Deadlock | Multiple threads stuck, program hangs | **`jstack `** in terminal | +| Thread Starvation | One thread always RUNNING, others stuck | **`jstack `** in terminal | +| Lock Contention | Threads waiting for same lock | **`jstack `** in terminal | +| Memory Visibility | Thread sees stale value (check `volatile` keyword) | `evaluateDebugExpression` | + +### Deadlock Diagnosis Workflow + +**Use jstack for reliable deadlock detection:** + +``` +=== STEP 1: Detect the hang === +User: "Program seems frozen/stuck" + +=== STEP 2: Find the Java process === +Run in terminal: +$ jps -l +12345 com.example.MainApp ← This is the target PID + +=== STEP 3: Get thread dump === +Run in terminal: +$ jstack 12345 + +=== STEP 4: jstack automatically detects deadlock === +Found one Java-level deadlock: +============================= +"worker-1": + waiting to lock monitor 0x00007f9b2c003f08 (a java.lang.Object), + which is held by "worker-2" +"worker-2": + waiting to lock monitor 0x00007f9b2c004018 (a java.lang.Object), + which is held by "worker-1" + +Java stack information for the threads listed above: +=================================================== +"worker-1": + at com.example.Service.methodA(Service.java:30) + - waiting to lock <0x00000000d6e30208> (a java.lang.Object) + - locked <0x00000000d6e30210> (a java.lang.Object) + +"worker-2": + at com.example.Service.methodB(Service.java:50) + - waiting to lock <0x00000000d6e30210> (a java.lang.Object) + - locked <0x00000000d6e30208> (a java.lang.Object) + +=== STEP 5: Analyze the deadlock === +Diagnosis: Classic deadlock! +- worker-1 holds lock @210, wants lock @208 +- worker-2 holds lock @208, wants lock @210 +- Circular wait = DEADLOCK + +=== STEP 6: Report fix === +Fix: Ensure consistent lock ordering - always acquire locks in same order +``` + +### Alternative Thread Dump Methods + +If jstack is not available, use these alternatives: + +**Option 1: JConsole/VisualVM** +```bash +# Launch JConsole +jconsole +# Connect to the Java process → Go to "Threads" tab → "Detect Deadlock" +``` + +**Option 2: Add diagnostic code** +```java +// Add before suspected deadlock area +Thread.dumpStack(); +// Or for full dump: +ManagementFactory.getThreadMXBean().dumpAllThreads(true, true); +``` + +### Key Thread States in jstack Output + +| State | Meaning | +|-------|---------| +| `BLOCKED (on object monitor)` | Thread waiting for a monitor lock - **potential deadlock** | +| `WAITING (on object monitor)` | Thread waiting for notification (wait()) | +| `TIMED_WAITING (sleeping/parking)` | Thread waiting with timeout | +| `RUNNABLE` | Thread running or ready to run | --- diff --git a/bundled/scripts/noConfigScripts/jdwp-wrapper.js b/bundled/scripts/noConfigScripts/jdwp-wrapper.js index de8a4d92..cae86170 100644 --- a/bundled/scripts/noConfigScripts/jdwp-wrapper.js +++ b/bundled/scripts/noConfigScripts/jdwp-wrapper.js @@ -52,13 +52,25 @@ function getJavaCommand() { const javaCmd = getJavaCommand(); +// Helper function to setup signal handlers for graceful termination +function setupSignalHandlers(child) { + const signals = ['SIGINT', 'SIGTERM']; + signals.forEach(signal => { + process.on(signal, () => { + child.kill(signal); + }); + }); +} + if (!isDebugEnabled) { // No debugging, just run java normally const child = spawn(javaCmd, process.argv.slice(2), { stdio: 'inherit', shell: false }); - child.on('exit', (code) => process.exit(code || 0)); + setupSignalHandlers(child); + // Use 'close' event to ensure stdio streams are closed before exiting + child.on('close', (code) => process.exit(code || 0)); child.on('error', (err) => { console.error(`[Java Debug] Failed to start java: ${err.message}`); console.error(`[Java Debug] Make sure Java is installed and either JAVA_HOME is set correctly or 'java' is in your PATH.`); @@ -70,6 +82,7 @@ if (!isDebugEnabled) { stdio: ['inherit', 'pipe', 'pipe'], shell: false }); + setupSignalHandlers(child); let portCaptured = false; const jdwpPortRegex = /Listening for transport dt_socket at address:\s*(\d+)/; @@ -122,7 +135,8 @@ if (!isDebugEnabled) { capturePort(output); }); - child.on('exit', (code) => process.exit(code || 0)); + // Use 'close' event to ensure stdio streams are closed before exiting + child.on('close', (code) => process.exit(code || 0)); child.on('error', (err) => { console.error(`[Java Debug] Failed to start java: ${err}`); process.exit(1); diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 736b7fa4..580faacb 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -101,9 +101,10 @@ export function registerLanguageModelTool(context: vscode.ExtensionContext): vsc /** * Main function to debug a Java application. * This function handles: - * 1. Project type detection - * 2. Building the project if needed - * 3. Executing the debugjava command + * 1. Cleanup any existing debug session (to avoid port conflicts) + * 2. Project type detection + * 3. Building the project if needed + * 4. Executing the debugjava command */ async function debugJavaApplication( input: DebugJavaApplicationInput, @@ -116,6 +117,34 @@ async function debugJavaApplication( }; } + // Step 0: Cleanup any existing Java debug session to avoid port conflicts + const existingSession = vscode.debug.activeDebugSession; + if (existingSession && existingSession.type === 'java') { + sendInfo('', { + operationName: 'languageModelTool.cleanupExistingSession', + sessionId: existingSession.id, + sessionName: existingSession.name + }); + try { + await vscode.debug.stopDebugging(existingSession); + // Give VS Code a moment to clean up the session + await new Promise(resolve => setTimeout(resolve, 500)); + } catch (error) { + // Log but continue - the old session might already be dead + sendInfo('', { + operationName: 'languageModelTool.cleanupExistingSessionFailed', + error: String(error) + }); + } + } + + // Also close any existing "Java Debug" terminals to avoid confusion + for (const terminal of vscode.window.terminals) { + if (terminal.name === 'Java Debug') { + terminal.dispose(); + } + } + // Validate workspace path const workspaceUri = vscode.Uri.file(input.workspacePath); if (!fs.existsSync(input.workspacePath)) { @@ -1292,7 +1321,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs }; disposables.push(lmApi.registerTool('remove_java_breakpoints', removeBreakpointsTool)); - // Tool 8: Stop Debug Session + // Tool 9: Stop Debug Session const stopDebugSessionTool: LanguageModelTool = { async invoke(options: { input: StopDebugSessionInput }, _token: vscode.CancellationToken): Promise { try { @@ -1331,7 +1360,7 @@ export function registerDebugSessionTools(_context: vscode.ExtensionContext): vs }; disposables.push(lmApi.registerTool('stop_debug_session', stopDebugSessionTool)); - // Tool 9: Get Debug Session Info + // Tool 10: Get Debug Session Info const getDebugSessionInfoTool: LanguageModelTool = { async invoke(_options: { input: GetDebugSessionInfoInput }, _token: vscode.CancellationToken): Promise { try { From 55e4956dbc8ab8590c1ca1f398ad478696a5d683 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Wed, 10 Dec 2025 12:49:55 +0800 Subject: [PATCH 15/15] fix: fix lint --- src/languageModelTool.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languageModelTool.ts b/src/languageModelTool.ts index 580faacb..ad803d25 100644 --- a/src/languageModelTool.ts +++ b/src/languageModelTool.ts @@ -139,9 +139,9 @@ async function debugJavaApplication( } // Also close any existing "Java Debug" terminals to avoid confusion - for (const terminal of vscode.window.terminals) { - if (terminal.name === 'Java Debug') { - terminal.dispose(); + for (const existingTerminal of vscode.window.terminals) { + if (existingTerminal.name === 'Java Debug') { + existingTerminal.dispose(); } }