@@ -302,17 +302,21 @@ async function debugJavaApplication(
302302 resolve ( {
303303 success : false ,
304304 status : 'timeout' ,
305- message : `❌ Debug session failed to start within ${ CONSTANTS . SESSION_WAIT_TIMEOUT / 1000 } seconds for ${ targetInfo } .\n\n` +
306- `This usually indicates a problem:\n` +
307- `• Compilation errors preventing startup\n` +
308- `• ClassNotFoundException or NoClassDefFoundError\n` +
309- `• Application crashed during initialization\n` +
310- `• Incorrect main class or classpath configuration\n\n` +
311- `Action required:\n` +
312- `1. Check terminal '${ terminal . name } ' for error messages\n` +
313- `2. Verify the target class name is correct\n` +
314- `3. Ensure the project is compiled successfully\n` +
315- `4. Use get_debug_session_info() to confirm session status${ warningNote } ` ,
305+ message : `⏳ Debug session not yet detected for ${ targetInfo } after `
306+ + `${ CONSTANTS . SESSION_WAIT_TIMEOUT / 1000 } seconds.\n\n`
307+ + `This is often transient — the JVM may still be starting up (large `
308+ + `projects, cold class-loading, or remote workspaces can need additional `
309+ + `time). Telemetry shows that retrying a timed-out launch succeeds for `
310+ + `the majority of cases.\n\n`
311+ + `Recommended next actions (in order):\n`
312+ + `1. Call debug_java_application again — most timeout cases recover on retry.\n`
313+ + `2. Call get_debug_session_info() to check whether the session has since `
314+ + `become active.\n`
315+ + `3. If retrying still times out, inspect terminal '${ terminal . name } ' for `
316+ + `compilation errors, ClassNotFoundException, NoClassDefFoundError, or `
317+ + `other startup failures.\n`
318+ + `4. Verify the target class name and classpath are correct, then retry.`
319+ + `${ warningNote } ` ,
316320 terminalName : terminal . name
317321 } ) ;
318322 }
@@ -362,15 +366,18 @@ async function debugJavaApplication(
362366 return {
363367 success : true ,
364368 status : 'timeout' ,
365- message : `⚠️ Debug command sent for ${ targetInfo } , but session not detected within ${ CONSTANTS . SMART_POLLING_MAX_WAIT / 1000 } seconds.\n\n` +
366- `Possible reasons:\n` +
367- `• Application is still starting (large projects may take longer)\n` +
368- `• Compilation errors (check terminal '${ terminal . name } ' for errors)\n` +
369- `• Application may have started and already terminated\n\n` +
370- `Next steps:\n` +
371- `• Use get_debug_session_info() to check if session is now active\n` +
372- `• Check terminal '${ terminal . name } ' for error messages\n` +
373- `• If starting slowly, wait a bit longer and check again${ warningNote } ` ,
369+ message : `⏳ Debug command sent for ${ targetInfo } ; session not yet detected within `
370+ + `${ CONSTANTS . SMART_POLLING_MAX_WAIT / 1000 } seconds.\n\n`
371+ + `This is often transient — the application may still be starting in terminal `
372+ + `'${ terminal . name } '. Telemetry shows that retrying or polling for status is more `
373+ + `likely to succeed than treating this as a permanent failure.\n\n`
374+ + `Recommended next actions (in order):\n`
375+ + `1. Call get_debug_session_info() to check whether the session has since become active.\n`
376+ + `2. Call debug_java_application again — most timeout cases recover on retry. `
377+ + `In the input arguments, set "waitForSession": true (JSON object syntax) to `
378+ + `extend the wait window for slow-starting apps.\n`
379+ + `3. If retrying still times out, inspect terminal '${ terminal . name } ' for compilation `
380+ + `errors or startup failures, then retry.${ warningNote } ` ,
374381 terminalName : terminal . name
375382 } ;
376383 }
0 commit comments