From 4b76db93967c03c63dbef83e3471ebed92a367eb Mon Sep 17 00:00:00 2001 From: Devin <16897283+ishowman@users.noreply.github.com> Date: Thu, 11 Jun 2026 07:16:44 +0800 Subject: [PATCH] fix(annotate): improve error message for unsupported file types (#870) - When a file exists but has an unsupported type (.cs, .ts, .py, etc.), show 'File type not supported' instead of misleading 'File not found' - Display supported file types (.md, .mdx, .html, .htm) - Suggest using 'plannotator review' for code files - Maintains backward compatibility for actual missing files Fixes #757 Co-authored-by: ishowman --- apps/hook/server/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/hook/server/index.ts b/apps/hook/server/index.ts index f9f82e4b..1185d0bc 100644 --- a/apps/hook/server/index.ts +++ b/apps/hook/server/index.ts @@ -902,7 +902,20 @@ if (args[0] === "sessions") { process.exit(1); } if (resolved.kind === "not_found") { - console.error(`File not found: ${resolved.input}`); + // Check if file exists but has unsupported type + const resolvedPath = resolveUserPath(resolved.input, projectRoot); + const fileExists = existsSync(resolvedPath); + + if (fileExists) { + const ext = path.extname(resolvedPath).toLowerCase(); + console.error( + `File type not supported: ${ext}\n` + + `Only .md, .mdx, .html, .htm files are supported.\n` + + `For code review, use: plannotator review [file]` + ); + } else { + console.error(`File not found: ${resolved.input}`); + } process.exit(1); }