Skip to content

fix: use backtick template literal in NoChangeError message#310741

Open
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/nochangeerror-template-interpolation-v2
Open

fix: use backtick template literal in NoChangeError message#310741
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/nochangeerror-template-interpolation-v2

Conversation

@Jah-yee
Copy link
Copy Markdown

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

Good day

Summary

Fixed two issues in the NoChangeError message in editFileToolUtils.tsx:

  1. Broken template interpolation: Single-quoted strings do not support ${...} interpolation in JavaScript/TypeScript. The model literally received the text ${ToolName.ReadFile} instead of read_file. Added the missing ToolName import and changed to backtick template literal.

  2. Doubled word typo: Fixed and and to and.

Changes

  • Added import { ToolName } from '../common/toolNames';
  • Changed single quotes to backticks for proper template interpolation
  • Fixed re-read the file and and determinere-read the file and determine

Testing

const ToolName = { ReadFile: 'read_file' };
const bugged = 'Use the ${ToolName.ReadFile} tool';
const fixed  = `Use the ${ToolName.ReadFile} tool`;
console.log('BUGGED:', bugged); // "Use the ${ToolName.ReadFile} tool"
console.log('FIXED: ', fixed);  // "Use the read_file tool"

Fixes #308365

Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly.

Warmly,
RoomWithOutRoof

- Import ToolName from toolNames to enable proper template interpolation
- Change single quotes to backticks so ${ToolName.ReadFile} becomes 'read_file'
- Fix doubled word 'and and' to 'and'

Fixes microsoft#308365
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.

NoChangeError message has broken ToolName interpolation and typo

2 participants