Skip to content

fix: resolve NoChangeError tool name interpolation and typo#309709

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
Jah-yee:fix/NoChangeError-message
May 1, 2026
Merged

fix: resolve NoChangeError tool name interpolation and typo#309709
mjbvz merged 1 commit intomicrosoft:mainfrom
Jah-yee:fix/NoChangeError-message

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 14, 2026

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
Collaborator

mjbvz commented May 1, 2026

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

@Jah-yee Jah-yee force-pushed the fix/NoChangeError-message branch from cd15b08 to 5d5fd93 Compare May 1, 2026 08:05
Copilot AI review requested due to automatic review settings May 1, 2026 08:05
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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.
@Jah-yee Jah-yee force-pushed the fix/NoChangeError-message branch from 5d5fd93 to 25c2fe3 Compare May 1, 2026 14:55
@mjbvz mjbvz enabled auto-merge May 1, 2026 17:53
@mjbvz 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 Jah-yee deleted the fix/NoChangeError-message branch May 1, 2026 20:09
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.

5 participants