Skip to content

Commit ffc8023

Browse files
committed
fix: switch built-in-agent to single-route mode for smoke probe compatibility
1 parent 4d745fb commit ffc8023

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

  • showcase/integrations/built-in-agent/src/app/api/copilotkit

showcase/integrations/built-in-agent/src/app/api/copilotkit/route.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@ const runtime = new CopilotRuntime({
1313
const handler = createCopilotRuntimeHandler({
1414
runtime,
1515
basePath: "/api/copilotkit",
16+
mode: "single-route",
1617
});
1718

18-
async function withProbeCompat(req: Request): Promise<Response> {
19-
const res = await handler(req);
20-
if (res.status === 404) {
21-
const body = await res.text();
22-
return new Response(body, { status: 400, headers: res.headers });
23-
}
24-
return res;
25-
}
26-
2719
export const GET = (req: Request) => handler(req);
28-
export const POST = (req: Request) => withProbeCompat(req);
20+
export const POST = (req: Request) => handler(req);
2921
export const OPTIONS = (req: Request) => handler(req);

0 commit comments

Comments
 (0)