Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Debug Console history was polluted with incomplete/invalid expressions that failed evaluation. Typing myVar and pressing Enter before autocomplete finishes would add myVar to history even though it returned an error, pushing the correct myVariable down in suggestions.

Changes

Modified evaluation flow to track and propagate success status:

  • ReplModel.addReplExpression(): Returns Promise<boolean> instead of Promise<void>, capturing the result from evaluateExpression()
  • IDebugSession.addReplExpression(): Interface updated to return boolean
  • Repl.acceptReplInput() / sendReplInput(): Made async, conditionally add to history only on success
const success = await session.addReplExpression(stackFrame, input);
if (success) {
    this.history.add(input);
}

Tests

  • Added sendErrorResponse() to MockDebugAdapter for error simulation
  • Test coverage for both successful (returns true) and failed (returns false) evaluations
Original prompt

This section details on the original issue you should resolve

<issue_title>Don't save debugger completion history for evaluations that return errors</issue_title>
<issue_description>By default, completion in the Debug Console requires pressing <tab> to complete. Because I'm used to pressing <enter> I often send incomplete/invalid expressions. However these are still recorded to the history and then show in future invocations (which means the "top" entry is not the complete variable name that I want, but a previous mistyping):

Image

I think it would be better if expressions are only recorded to the history if they evaluate successfully and do not return an error ("success":false).</issue_description>

Comments on the Issue (you are @copilot in this section)

@roblourens You might like `debug.console.acceptSuggestionOnEnter`

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix debugger completion history for error evaluations Don't save debugger completion history for evaluations that return errors Jan 12, 2026
Copilot AI requested a review from roblourens January 12, 2026 23:34
@roblourens roblourens closed this Jan 13, 2026
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.

Don't save debugger completion history for evaluations that return errors

2 participants