From d91c8b86effd44dd94fd6d69e6413601ed0792e4 Mon Sep 17 00:00:00 2001 From: jerelvelarde Date: Tue, 24 Mar 2026 08:28:49 -0700 Subject: [PATCH 1/2] fix: remove @frenchfryai/runtime to eliminate suspected memory leak 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. --- 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 cefd0ae..98e55bb 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"; const agentHost = process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123"; const agentUrl = agentHost.startsWith("http") ? agentHost : `http://${agentHost}`; @@ -26,17 +25,9 @@ app.use("/*", cors()); app.route("/", copilotApp as any); -registerRealtimeSessionRoute(app, { - path: "/realtime/session", - openai: { - apiKey: process.env.OPENAI_API_KEY ?? "", - }, -}); - // Error resilience and memory monitoring — see resilience.ts for details import "./resilience.js"; const port = Number(process.env.PORT || 4000); serve({ fetch: app.fetch, port }); console.log(`Runtime server listening at http://localhost:${port}/api/copilotkit`); -console.log(`Realtime session endpoint at http://localhost:${port}/realtime/session`); From fdde6f685a5135f7be13d0babb7cfbdb61f089f5 Mon Sep 17 00:00:00 2001 From: Tyler Slaton <54378333+tylerslaton@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:03:11 -0400 Subject: [PATCH 2/2] Update server.ts --- apps/runtime/server.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/runtime/server.ts b/apps/runtime/server.ts index eb38bc9..0aeb8d2 100644 --- a/apps/runtime/server.ts +++ b/apps/runtime/server.ts @@ -36,9 +36,6 @@ app.use("/*", async (c, next) => { app.route("/", copilotApp as any); -// Error resilience and memory monitoring — see resilience.ts for details -import "./resilience.js"; - const port = Number(process.env.PORT || 4000); let server: ReturnType | undefined; server = serve({ fetch: app.fetch, port });