From 8def5ae1a348613308a67c6abf22432f9f39a807 Mon Sep 17 00:00:00 2001 From: zenchantlive <103866469+zenchantlive@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:00:14 -0800 Subject: [PATCH] Update src/app/api/events/route.ts Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com> --- src/app/api/events/route.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/api/events/route.ts b/src/app/api/events/route.ts index 4d1cfc9..9441aa3 100644 --- a/src/app/api/events/route.ts +++ b/src/app/api/events/route.ts @@ -7,7 +7,20 @@ const HEARTBEAT_MS = 15_000; export async function GET(request: Request): Promise { const url = new URL(request.url); - const projectRoot = canonicalizeWindowsPath(url.searchParams.get('projectRoot') ?? process.cwd()); + const projectRootSearchParam = url.searchParams.get('projectRoot'); + if (!projectRootSearchParam) { + return Response.json( + { + ok: false, + error: { + classification: 'bad_args', + message: 'The `projectRoot` query parameter is required.', + }, + }, + { status: 400 }, + ); + } + const projectRoot = canonicalizeWindowsPath(projectRootSearchParam); try { getIssuesWatchManager().startWatch(projectRoot);