From aa4a8f197d85cf42dc171c29f5e8f80aee7a73a1 Mon Sep 17 00:00:00 2001 From: Jerel <85066839+GeneralJerel@users.noreply.github.com> Date: Wed, 25 Mar 2026 06:04:06 +0800 Subject: [PATCH] fix: remove @frenchfryai/runtime to eliminate suspected memory leak (#3) The realtime session route is unused by this demo and is the most likely source of the monotonic heap growth causing OOM crashes. Removing the dependency and route registration to verify. Co-authored-by: Tyler Slaton <54378333+tylerslaton@users.noreply.github.com> --- apps/runtime/package.json | 1 - apps/runtime/server.ts | 9 --------- 2 files changed, 10 deletions(-) diff --git a/apps/runtime/package.json b/apps/runtime/package.json index 1a66f80..fa950b5 100644 --- a/apps/runtime/package.json +++ b/apps/runtime/package.json @@ -7,7 +7,6 @@ }, "dependencies": { "@copilotkit/runtime": "1.54.0", - "@frenchfryai/runtime": "^0.1.1", "@hono/node-server": "^1.13.6", "hono": "^4.11.4" }, diff --git a/apps/runtime/server.ts b/apps/runtime/server.ts index 343070d..0aeb8d2 100644 --- a/apps/runtime/server.ts +++ b/apps/runtime/server.ts @@ -3,7 +3,6 @@ import { serve } from "@hono/node-server"; import { cors } from "hono/cors"; import { CopilotRuntime, createCopilotEndpointSingleRoute } from "@copilotkit/runtime/v2"; import { LangGraphHttpAgent } from "@copilotkit/runtime/langgraph"; -import { registerRealtimeSessionRoute } from "@frenchfryai/runtime"; import { isShuttingDown, onShutdown } from "./resilience.js"; const agentHost = process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123"; @@ -37,16 +36,8 @@ app.use("/*", async (c, next) => { app.route("/", copilotApp as any); -registerRealtimeSessionRoute(app, { - path: "/realtime/session", - openai: { - apiKey: process.env.OPENAI_API_KEY ?? "", - }, -}); - const port = Number(process.env.PORT || 4000); let server: ReturnType | undefined; server = serve({ fetch: app.fetch, port }); onShutdown(() => server?.close()); console.log(`Runtime server listening at http://localhost:${port}/api/copilotkit`); -console.log(`Realtime session endpoint at http://localhost:${port}/realtime/session`);