mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
def354e36b
The integration-demo parity-check CI job was red on main: langgraph-js, strands-python, and langgraph-fastapi diverged from the langgraph-python north-star on two tracked verbatim files. Root cause is the partial revert in3721e7b36(Revert of #5151), NOT #5222. The v2 API migration (23af69041) moved north-star and all instances to the v2 surface. The revert rolled the *instances'* example-layout/index.tsx and docker-route-override.ts back to the v1 API (@copilotkit/react-core, @copilotkit/runtime) while leaving the north-star on v2 (@copilotkit/react-core/v2, @copilotkit/runtime/v2). That left the demos internally inconsistent: each instance's real src/app/api/copilotkit route already uses runtime/v2 on copilotkit 1.59.3, but its Docker route override and example layout were stuck on v1. Re-baseline forward by syncing the three instances to the v2 north-star via `pnpm parity:sync --all`. Only the 5 drifting verbatim files change; no package.json keys move (all instances already pin 1.59.3) and no agent-surface or allowed-divergence files are touched. `pnpm parity:check` is now green (0 errors across all instances).
33 lines
827 B
TypeScript
33 lines
827 B
TypeScript
/**
|
|
* Docker-specific route override.
|
|
* In Docker, the agent is served via AG-UI (not LangGraph Platform)
|
|
* because langgraph-cli dev requires Docker-in-Docker.
|
|
* The original route.ts (using LangGraphAgent) is preserved unchanged.
|
|
*/
|
|
import {
|
|
CopilotRuntime,
|
|
InMemoryAgentRunner,
|
|
createCopilotEndpoint,
|
|
} from "@copilotkit/runtime/v2";
|
|
import { HttpAgent } from "@ag-ui/client";
|
|
import { handle } from "hono/vercel";
|
|
|
|
const agentUrl = process.env.AGENT_URL || "http://localhost:8123";
|
|
|
|
const defaultAgent = new HttpAgent({
|
|
url: `${agentUrl}/`,
|
|
});
|
|
|
|
const runtime = new CopilotRuntime({
|
|
agents: { default: defaultAgent },
|
|
runner: new InMemoryAgentRunner(),
|
|
});
|
|
|
|
const app = createCopilotEndpoint({
|
|
runtime,
|
|
basePath: "/api/copilotkit",
|
|
});
|
|
|
|
export const GET = handle(app);
|
|
export const POST = handle(app);
|