|
94 | 94 | "description": "Maximum number of output lines (stderr/stdout) to buffer per debug session for runtime error reporting.", |
95 | 95 | "scope": "resource" |
96 | 96 | }, |
| 97 | + "copilot-debugger.maxOutputChars": { |
| 98 | + "type": "integer", |
| 99 | + "default": 8192, |
| 100 | + "description": "Maximum number of characters returned by Copilot debugger tools (tool output is truncated with a suffix when exceeded).", |
| 101 | + "scope": "resource" |
| 102 | + }, |
97 | 103 | "copilot-debugger.consoleLogLevel": { |
98 | 104 | "type": "string", |
99 | 105 | "enum": [ |
|
122 | 128 | "displayName": "Start Debugger", |
123 | 129 | "toolReferenceName": "startDebugSessionWithBreakpoints", |
124 | 130 | "canBeReferencedInPrompt": true, |
125 | | - "userDescription": "Start a debug session, set breakpoints, and wait until a breakpoint is hit. Supports onHit behaviors: break (pause & return), captureAndContinue (collect variables & interpolated log messages then resume automatically), stopDebugging (terminate after hit). Supports serverReady.action types: httpRequest | shellCommand | vscodeCommand (auto-run after readiness trigger). Exact numeric hitCount pauses on that occurrence.", |
126 | | - "modelDescription": "Start a debug session using the configured default launch configuration or an explicitly provided configurationName. Auto-selects sole launch config when none specified and no default setting is present. Each breakpoint can specify an onHit: break (pause), captureAndContinue (non-blocking gather of variables & interpolation of {var} placeholders in logMessage then continue), or stopDebugging (terminate immediately after hit). Supports serverReady with trigger {path+line | pattern | omitted attach} and action.type httpRequest | shellCommand | vscodeCommand. Conditional expressions and exact numeric hitCount only. variableFilter required only for captureAndContinue; omit to capture all locals up to captureMaxVariables.", |
| 131 | + "userDescription": "Start a debug session, set breakpoints, and wait until a breakpoint is hit. Supports onHit behaviors: break (pause), captureAndContinue (collect variables then auto-resume), stopDebugging (terminate after hit). Default mode is singleShot: the tool terminates the session before returning so the model cannot accidentally run external curl/browser probes against a paused debuggee. If you need an interactive paused workflow, set mode=inspect.", |
| 132 | + "modelDescription": "Start a debug session using the configured default launch configuration or an explicitly provided configurationName. Auto-selects sole launch config when none specified and no default setting is present. Each breakpoint can specify an onHit: break (pause), captureAndContinue (collect variables & interpolate {var} placeholders then continue automatically), or stopDebugging (terminate immediately after hit). IMPORTANT protocol: if the tool returns while paused (inspect mode), you must NOT run external HTTP requests (curl/wget/browser/fetch) against the debuggee; only use debugger operations (evaluateExpression/getVariables/expandVariable/resume/stop) until resumed. Supports serverReady with trigger {path+line | pattern | omitted attach} and action.type httpRequest | shellCommand | vscodeCommand. httpRequest is the recommended canonical way to trigger a request intended to hit breakpoints because it is executed by the tool with timeout handling. shellCommand runs in a terminal and can block if it performs a request that hits a break breakpoint. Conditional expressions and exact numeric hitCount only. variableFilter required only for captureAndContinue; omit to capture all locals up to captureMaxVariables.", |
127 | 133 | "inputSchema": { |
128 | 134 | "type": "object", |
129 | 135 | "properties": { |
|
135 | 141 | "type": "string", |
136 | 142 | "description": "Name of launch configuration to start. If omitted uses copilot-debugger.defaultLaunchConfiguration or auto-selects sole configuration if exactly one exists." |
137 | 143 | }, |
| 144 | + "mode": { |
| 145 | + "type": "string", |
| 146 | + "enum": [ |
| 147 | + "singleShot", |
| 148 | + "inspect" |
| 149 | + ], |
| 150 | + "description": "Tool mode. singleShot (default): terminate the session before returning. inspect: allow returning while paused for iterative inspection/resume workflows." |
| 151 | + }, |
138 | 152 | "breakpointConfig": { |
139 | 153 | "type": "object", |
140 | 154 | "properties": { |
|
157 | 171 | "items": { |
158 | 172 | "type": "string" |
159 | 173 | }, |
160 | | - "minItems": 1, |
161 | | - "description": "List of exact variable names to include when reporting variables for this breakpoint or for interpolation in captureAndContinue onHit. Required only if onHit=captureAndContinue and you want a subset; when omitted for captureAndContinue all locals (up to captureMaxVariables) are auto-collected. Ignored for break/stopDebugging. Case-sensitive." |
| 174 | + "description": "Required list of exact variable names to include when reporting variables for this breakpoint or for interpolation in captureAndContinue onHit. Use an empty array to opt into auto-capture (up to captureMaxVariables). Ignored for break/stopDebugging. Case-sensitive." |
162 | 175 | }, |
163 | 176 | "onHit": { |
164 | 177 | "type": "string", |
|
189 | 202 | "required": [ |
190 | 203 | "path", |
191 | 204 | "line", |
192 | | - "onHit" |
| 205 | + "onHit", |
| 206 | + "variableFilter" |
193 | 207 | ] |
194 | 208 | }, |
195 | 209 | "description": "Breakpoints to add before starting session." |
|
198 | 212 | }, |
199 | 213 | "serverReady": { |
200 | 214 | "type": "object", |
201 | | - "description": "Optional server readiness automation. New flat schema: trigger {path+line | pattern | omitted attach}; action.type in httpRequest | shellCommand | vscodeCommand. Backward compatible with legacy shape.", |
| 215 | + "description": "Optional server readiness automation (trigger + action). Canonical pattern for driving a request into a breakpoint is action.type=httpRequest (tool-executed with timeout handling). shellCommand is allowed (including curl), but it can block if it performs a request that hits a break breakpoint. NOTE: the most common failure mode is external curl AFTER the tool returned while paused (inspect mode).", |
202 | 216 | "properties": { |
203 | 217 | "trigger": { |
204 | 218 | "type": "object", |
|
220 | 234 | }, |
221 | 235 | "action": { |
222 | 236 | "type": "object", |
223 | | - "description": "Action executed when ready. Flat schema with discriminator 'type'.", |
| 237 | + "description": "Action executed when ready. Flat schema with discriminator 'type'. Blocking behavior: shellCommand runs in a terminal and may block if it performs a request that hits a break breakpoint; httpRequest is executed by the tool with timeout handling and is recommended for triggering breakpoints.", |
224 | 238 | "properties": { |
225 | 239 | "type": { |
226 | 240 | "type": "string", |
|
229 | 243 | "shellCommand", |
230 | 244 | "vscodeCommand" |
231 | 245 | ], |
232 | | - "description": "Action type discriminator." |
| 246 | + "description": "Action type discriminator. Prefer httpRequest to trigger requests intended to hit breakpoints. shellCommand is allowed (including curl), but may block if it triggers a break breakpoint." |
233 | 247 | }, |
234 | 248 | "url": { |
235 | 249 | "type": "string", |
|
252 | 266 | }, |
253 | 267 | "shellCommand": { |
254 | 268 | "type": "string", |
255 | | - "description": "Shell command executed in a new terminal (shellCommand)." |
| 269 | + "description": "Shell command executed in a new terminal (shellCommand). Allowed to run curl/wget/etc, but may block if it triggers a break breakpoint." |
256 | 270 | }, |
257 | 271 | "command": { |
258 | 272 | "type": "string", |
|
284 | 298 | { |
285 | 299 | "workspaceFolder": "/abs/path/project", |
286 | 300 | "configurationName": "Run test.js", |
| 301 | + "mode": "singleShot", |
287 | 302 | "breakpointConfig": { |
288 | 303 | "breakpoints": [ |
289 | 304 | { |
|
309 | 324 | }, |
310 | 325 | { |
311 | 326 | "workspaceFolder": "/abs/path/project", |
| 327 | + "mode": "inspect", |
312 | 328 | "breakpointConfig": { |
313 | 329 | "breakpoints": [ |
314 | 330 | { |
|
320 | 336 | "serverReady": { |
321 | 337 | "action": { |
322 | 338 | "type": "shellCommand", |
323 | | - "shellCommand": "curl http://localhost:3000/health" |
| 339 | + "shellCommand": "curl -sS http://localhost:3000/health || exit 1" |
324 | 340 | } |
325 | 341 | } |
326 | 342 | } |
|
364 | 380 | "items": { |
365 | 381 | "type": "string" |
366 | 382 | }, |
367 | | - "minItems": 1, |
368 | 383 | "description": "Variable names to include in reporting or interpolation for capture action." |
369 | 384 | }, |
370 | 385 | "action": { |
|
391 | 406 | }, |
392 | 407 | "required": [ |
393 | 408 | "path", |
394 | | - "line" |
| 409 | + "line", |
| 410 | + "variableFilter" |
395 | 411 | ] |
396 | 412 | } |
397 | 413 | } |
|
503 | 519 | "@anthropic-ai/sdk": "^0.27.3", |
504 | 520 | "@reactive-vscode/reactivity": "^0.4.1", |
505 | 521 | "@vscode/prompt-tsx": "^0.4.0-alpha.5", |
| 522 | + "markdown-table": "^3.0.4", |
506 | 523 | "mocha": "^10.7.3", |
507 | 524 | "reactive-vscode": "^0.4.1", |
508 | 525 | "strip-ansi": "^7.1.2" |
|
0 commit comments