Skip to content

fix: stop recommending automatic Java launch retries - #1701

Open
wenyt (wenytang-ms) wants to merge 3 commits into
mainfrom
fix/lmt-stop-automatic-launch-retries
Open

wenyt (wenytang-ms) wants to merge 3 commits into
mainfrom
fix/lmt-stop-automatic-launch-retries

Conversation

@wenytang-ms

Copy link
Copy Markdown
Contributor

Summary

Stop recommending automatic Java launch retries after the first failure or timeout. This is a focused model-facing policy change, independent of the readiness design in #1696.

  • Remove unsupported claims that most timed-out launches recover on retry.
  • Include consistent failure guidance in launch tool results (including exceptions and disabled No-Config debugging), the tool description, chat instructions, and both skills.
  • Do not recommend relaunching through terminal commands as a fallback.
  • Describe timeouts as unconfirmed startup, allowing one diagnostic session-status check and inspection of existing output, without repeated polling or terminating the original launch.
  • Allow a new attempt only after an identified cause has been fixed or the user explicitly requests a retry, checking for an existing session first.
  • Do not render the polling timeout as a successful launch; consistently record outcome=timeout and errorCategory=timeout for both wait modes.

Scope

This updates guidance consumed by the model; it does not add a runtime retry counter or lock out subsequent tool invocations. The extension does not have an automatic relaunch loop to remove. Existing wait limits, readiness initialization, cancellation handling, session replacement behavior, and confirmed-start behavior are unchanged.

Validation

  • npm run compile
  • Targeted VS Code 1.95.3 extension-host suites: launch retry policy and existing No-Config settings/opt-out tests (11 passing).
  • TSLint on the new test file.
  • git diff --check

Regression cases cover both timeout paths, both confirmed-start paths, returned failure, exceptions, disabled No-Config debugging, timeout telemetry, consistent manifest/skill guidance, and no additional launch/stop/terminal-disposal side effects during timeout handling.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is focused and well tested, with only a minor guidance inconsistency remaining.

Pull request overview

Updates model-facing Java debugging guidance to prevent automatic retries after failures or timeouts.

Changes:

  • Standardizes launch failure and timeout guidance.
  • Corrects timeout outcomes and telemetry.
  • Adds focused regression coverage.
File summaries
File Description
test/languageModelToolLaunchPolicy.test.ts Tests retry policy and timeout handling.
src/languageModelTool.ts Updates launch results and telemetry.
resources/skills/java-launch-troubleshooting/SKILL.md Revises launch troubleshooting guidance.
resources/skills/java-debug-inspection/SKILL.md Revises inspection failure guidance.
resources/instruments/javaDebugContext.instructions.md Aligns model instructions with the policy.
package.json Updates the tool description.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread resources/skills/java-launch-troubleshooting/SKILL.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The shipped JavaDebug agent still recommends retries and terminal fallback.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

resources/instruments/javaDebugContext.instructions.md:16

  • The shipped bundled/agents/debug.agent.md still contradicts this policy. It says a missing session can be safely restarted (lines 176 and 185), asks the user to try again after no session (line 233), and recommends running mvn compile or gradle build before retrying (line 251). JavaDebug agent sessions can therefore continue recommending the automatic retries and terminal fallback this PR intends to stop. Update that agent guidance and include it in the consistency test.
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants