Skip to content

fix: resolve NoChangeError tool name interpolation and typo - #309709

Merged
Matt Bierner (mjbvz) merged 1 commit into
microsoft:mainfrom
Jah-yee:fix/NoChangeError-message
May 1, 2026
Merged

Matt Bierner (mjbvz) merged 1 commit into
microsoft:mainfrom
Jah-yee:fix/NoChangeError-message

Conversation

@Jah-yee

Copy link
Copy Markdown

Good day,

Thank you for your work on this project. I hope this small fix is helpful. Please let me know if there's anything to adjust.

Summary

Fixes two issues in the NoChangeError message:

  1. Broken template interpolation: The original code uses single quotes for a string containing ${ToolName.ReadFile}, but JavaScript template literals require backticks for interpolation. The model literally receives the text ${ToolName.ReadFile} instead of read_file.

  2. Typo: Fixed duplicate "and" in "re-read the file and and determine" → "re-read the file and determine".

Changes

  • Changed:Use the ${ToolName.ReadFile} tool to re-read the file and and determine

  • To: Use the read_file tool to re-read the file and determine

This error message is shown when the replace_string_in_file tool produces no actual change. The garbled tool name prevented the model from following the recovery instruction to re-read the file.

Warmly, RoomWithOutRoof

@mjbvz

Copy link
Copy Markdown
Contributor

Hi RoomWithOutRoof (@Jah-yee), sorry I missed this when it first came in. Can you please update this to resolve the conflicts. Thanks

Copilot AI review requested due to automatic review settings May 1, 2026 08:05
RoomWithOutRoof (Jah-yee) pushed a commit to Jah-yee/vscode-fork-jah-yee that referenced this pull request May 1, 2026
- Use backticks instead of single quotes for the error message string
- Replace literal ${ToolName.ReadFile} with read_file (the actual tool name)
- Fix duplicate 'and' typo: 'and and determine' → 'and determine'

Fixes microsoft#309709

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the recovery instruction text in NoChangeError emitted by the edit/replace-string tooling in the Copilot extension, so the model receives a correct tool name and a typo-free instruction.

Changes:

  • Fixes a broken tool-name interpolation in the NoChangeError message.
  • Fixes a duplicated “and” typo in the same message.

Comment thread extensions/copilot/src/extension/tools/node/editFileToolUtils.tsx
Use backticks for proper template literal interpolation of ${ToolName.ReadFile}.
Fix duplicate 'and and' → 'and'.
Import ToolName from registry so message stays in sync if tool name changes.

Addresses Copilot AI review feedback: keeps tool name in sync with registry.
@mjbvz
Matt Bierner (mjbvz) merged commit eaa498e into microsoft:main May 1, 2026
26 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone May 1, 2026
@Jah-yee
RoomWithOutRoof (Jah-yee) deleted the fix/NoChangeError-message branch May 1, 2026 20:09
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants