windmill-labs/windmill · warning

No changes in file "${requested}". Changed files: ${changed}

Error message

No changes in file "${requested}". Changed files: ${changed}.

What it means

When diffing a multi-file app with a `file` argument, the tool resolves the requested name against the changed-file list: exact `/name` match first, then a unique suffix match. If no changed file resolves, it throws this error listing which files actually changed. Note it reports files with changes — an unchanged file is not in the list.

Source

Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6692

function renderEntryFiles(
	files: Record<string, DiffFileView>,
	configPatch: string,
	args: { file?: string; offset?: number; limit?: number }
): string {
	if (args.file !== undefined) {
		// App files are keyed with a leading slash ("/App.tsx") — accept the
		// slash-less spelling and a unique basename too.
		const names = Object.keys(files)
		const requested = args.file
		const resolved =
			names.find((n) => n === requested) ??
			names.find((n) => n === `/${requested}`) ??
			(names.filter((n) => n.endsWith(`/${requested.replace(/^\//, '')}`)).length === 1
				? names.find((n) => n.endsWith(`/${requested.replace(/^\//, '')}`))
				: undefined)
		if (resolved === undefined) {
			const changed = names.join(', ') || '(none)'
			throw new Error(`No changes in file "${requested}". Changed files: ${changed}.`)
		}
		const fileDiff = files[resolved]
		if (fileDiff.patch === '') {
			// Empty file added/deleted: the presence change IS the whole diff.
			return `File "${resolved}" was ${fileDiff.status} with empty content.`
		}
		return windowPatchBody(fileDiff.patch, args.offset ?? 0, args.limit ?? DIFF_READ_DEFAULT_LINES)
	}
	const sections: string[] = []
	const fileLines = Object.entries(files).map(
		([name, fileDiff]) =>
			`- ${name} — ${fileDiff.status}${fileDiff.status === 'deleted' ? '' : fileDiff.lineCount === 0 ? ' (empty file)' : ` (${fileDiff.lineCount} diff lines)`}`
	)
	sections.push(
		fileLines.length > 0
			? `${fileLines.length} file(s) changed:\n${fileLines.join('\n')}\nRead one with file="<name>".`
			: 'No file contents changed.'
	)

View on GitHub (pinned to e474e8803c)

Solutions

  1. Read the 'Changed files:' list in the error and retry with one of those exact names
  2. If the file exists but is unchanged, diff without `file` and inspect the full diff
  3. Use the app's file tree to get exact paths before narrowing

Example fix

// before
diff({ type: 'app', path: 'u/admin', file: 'app.ts' })
// error: Changed files: /scripts/loader.ts
// after
diff({ type: 'app', path: 'u/admin', file: 'scripts/loader.ts' })
Defensive patterns

Strategy: validation

Validate before calling

const changed = Object.keys(files)
const resolved = changed.find((n) => n === `/${requested}`) ??
  (changed.filter((n) => n.endsWith(`/${requested.replace(/^\//, '')}`)).length === 1
    ? changed.find((n) => n.endsWith(`/${requested.replace(/^\//, '')}`))
    : undefined)
if (!resolved) console.warn(`"${requested}" not changed; changed files: ${changed.join(', ')}`)

Try / catch

try {
  return await diffItem({ type: 'app', path, file: requested })
} catch (e) {
  const m = /Changed files: (.*)\.$/.exec(String(e?.message))
  if (m) {
    const [first] = m[1].split(', ')
    return await diffItem({ type: 'app', path, file: first.replace(/^\//, '') })
  }
  throw e
}

Prevention

When it happens

Trigger: Calling diff on an app with `file` set to a name that is not among the changed files: misspelled name, wrong relative path, the file exists in the app but was not modified, or the suffix match is ambiguous (two files end with the same suffix) so resolution returns undefined.

Common situations: Agents guessing file names without listing the app; asking for 'index.ts' when the change is in 'backend/index.ts' and a sibling 'frontend/index.ts' also changed (ambiguous); requesting a file that exists but has no diff.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/e5a6585bc1a87530. Report an issue: GitHub.