Repository navigation
fix(showcase/langgraph-typescript): replace langgraph-cli dev with direct @langchain/langgraph-api server - #4132
Merged
Merged
Conversation
…rect @langchain/langgraph-api server Root cause of the 4+ day langgraph-typescript Railway flap: `npx @langchain/langgraph-cli dev` is a dev-mode CLI that compiles TypeScript on-demand per HTTP request, blocking the single-thread event loop ~5s per /schemas call. On Railway, Studio IPC handshake + langgraph-api JIT spawn + graph compile routinely exceeded the 90s watchdog budget; PR #4123's 180s grace papered over cold-start but didn't fix steady-state event-loop blocking. Replace the CLI with a direct import of startServer from @langchain/langgraph-api/server (the same Hono server dev wraps, minus the tsx watcher, Studio handshake, and LangSmith tenant lookup). Schema extraction runs in a worker_thread and is pre-warmed in parallel with server startup. Container-tested on node:22-slim: - /ok live in <3s (vs. 5-30s dev) - /ok steady-state <10ms - /assistants/search returns the registered graph - Pre-warm log: [server] Pre-warmed schemas in ~1.3-3.4s Caveats: - Uses --legacy-peer-deps for @langchain/langgraph-sdk version skew. - @langchain/langgraph-api exports ./server but it's not officially public API — exact version pin (1.1.17) required. - /runs streaming not end-to-end tested (dummy key); /assistants/search and schema extraction verified.
jpr5
requested review from
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
April 21, 2026 21:34
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
This was referenced Apr 21, 2026
Merged
jpr5
added a commit
that referenced
this pull request
Apr 22, 2026
…er prod-mode migration (#4140) ## Summary - Root cause: #4132 migrated langgraph-typescript from `langgraph-cli dev` (which exposed `/ok` immediately) to `@langchain/langgraph-api` `startServer`. That server DOES register `/ok` via its meta routes, but only binds the port AFTER `registerFromEnv` imports the graph and spawns the N workers. On Railway that window has been exceeding the watchdog's 180s startup grace + 90s strike budget, producing an infinite restart loop (deploy `ddc88ef9` is flapping ~every 4m30s). - Fix: move liveness off the heavy Hono path entirely. `server.mjs` now starts a bare `node:http` server on port 8124 (configurable via `HEALTH_PORT`) synchronously before any `await`, answering `GET /ok` with `{"status":"ok"}`. `entrypoint.sh` watchdog now probes `127.0.0.1:8124/ok` instead of `:8123/ok`. ## Why The service has been 502-ing all day. Railway deploy `ddc88ef9` never serves a single `/api/health` 200 despite `[server] LangGraph API listening on 0.0.0.0:8123` landing in the logs — the `listening` callback fires after the watchdog has already killed PID 4 and triggered a restart. Liveness on a sibling port is independent of whether :8123 has finished its graph import, so the probe reflects what the watchdog actually cares about: is the Node process alive and its event loop responsive. A true hang (event loop pinned) still fails the probe and triggers container restart, so hang-detection is preserved. ## Test plan - [x] Local Docker build green (`--platform linux/amd64`, depot) - [x] Local container `curl http://127.0.0.1:8124/ok` returns `HTTP=200 {"status":"ok"}` within 20s of boot - [x] `[server] Liveness probe listening on 0.0.0.0:8124` emitted before `[server] LangGraph API listening on 0.0.0.0:8123` - [ ] Railway redeploy recovers `/api/health` + `/api/smoke`
jpr5
added a commit
that referenced
this pull request
Apr 22, 2026
…ers, 17 packages (#4147) ## Summary - Rewrite starter Dockerfile templates (`typescript`, `python`, `java`, `dotnet`) as true multi-stage: builder has dev tools, runner is minimal. No `pip`/`npm`/`pnpm`/`tsx`/`*-cli dev` in runtime stages. - Encode prod-mode behaviors for `claude-sdk-typescript`, `mastra`, `langgraph-typescript` directly in the TS template + generator conditionals (folds in the pattern from #4132 for langgraph-ts; adds parallel migration for claude-sdk-ts + mastra). - Regenerate all 17 starter Dockerfiles. - Rewrite all 17 package Dockerfiles to match the template shape (multi-stage, venv builder for Python, 3-stage Python runtime, `USER app`, etc.). - Cold-start instrumentation on `claude-sdk-typescript` package (absorbed from closed PR #4133). - Pin `platforms: linux/amd64` in the showcase deploy workflow (`docker/build-push-action` step) to match what Railway + GHCR require. - Template `README.md` documenting multi-stage conventions, size target, platform mandate, and the `dockerfile_hygiene` probe. - `generate-starters.ts` strips the `langgraph-typescript` starter's dead `server.mjs` + its `start` script (both reference deps only needed in the package's prod-mode path). ## Why Railway cold starts exceed the 180s watchdog grace when the runtime stage boots via `langgraph-cli dev` / `npx mastra dev` / `npx tsx` — the dev-mode work (TS compile, Rollup bundle, native libsql init) blocks the health probe. #4132 proved the fix is to move this to image build time for langgraph-ts. This PR generalizes that shape to all TS starters that need it and reshapes every Dockerfile in the tree so runners no longer carry dev toolchains. Secondary outcomes: - Smaller runtime images (pip/npm toolchain moved to builder only). - Consistent `--platform linux/amd64` pinning end-to-end. - No `pnpm install --frozen-lockfile` in the TS starter template (starters are no-lockfile by design). - `validate-pins` ratchet re-baselined to match the regenerated spec strings. ## Test plan - [ ] `docker build --platform linux/amd64` green for every starter (17) and package (17) locally - [ ] `pnpm -C showcase/scripts` vitest: 1085/1085 pass - [ ] `tsc --noEmit -p showcase/scripts/tsconfig.json` clean - [ ] `oxfmt --check` + `oxlint` clean on touched TS files - [ ] validate-pins: count 110, hash matches updated baseline - [ ] CI Showcase Validate green on PR HEAD - [ ] Post-merge: showcase deploy for mastra + claude-sdk-typescript goes green (currently flapping)
pull Bot
pushed a commit
to KornaAI/CopilotKit
that referenced
this pull request
Apr 22, 2026
… break watchdog restart loop PR CopilotKit#4132 migrated away from `langgraph-cli dev` to the @langchain/langgraph-api `startServer` Hono server. That server does bind `/ok` via its meta routes, but only AFTER `registerFromEnv` imports the graph and spawns the N workers — on Railway that window has been exceeding the watchdog's 180s startup grace plus the 90s strike budget, producing an infinite restart loop (deploy ddc88ef9 is currently flapping ~every 4m30s). Move liveness off the heavy Hono path entirely: - server.mjs now spins up a bare node:http server on port 8124 (configurable via HEALTH_PORT) *synchronously before any await*, answering GET /ok with {"status":"ok"}. Always live within ms of `node` boot. - entrypoint.sh watchdog now probes 127.0.0.1:8124/ok instead of :8123/ok. The liveness port is independent of whether :8123 has finished graph import, so the probe reflects what the watchdog actually cares about: is the Node process alive and its event loop responsive. A true hang (event loop pinned) still fails the probe and triggers container restart, so the existing hang-detection behavior is preserved. Local Docker smoke (amd64): curl /ok returned 200 within 20s of container start; LangGraph API logged "listening on 0.0.0.0:8123" ~15s later as normal.
pull Bot
pushed a commit
to KornaAI/CopilotKit
that referenced
this pull request
Apr 22, 2026
…rod-mode tokens Restructure the shared starter Dockerfile templates so the runtime stage ships only a minimal base plus built artifacts — no dev toolchains (pip, pnpm, tsx, *-cli dev) run in the runner stage. Dockerfile.typescript: - Add AGENT_BUILD_STEPS / AGENT_BUILD_COPY template tokens so per-slug prod-mode compiles (claude-sdk-typescript tsc, mastra `mastra build`) can be emitted by the generator. Mirrors PR CopilotKit#4132's langgraph-typescript fix for the rest of the TS starter slots — cold start becomes a straight `node` call instead of `npx tsx` / `npx mastra dev` on Railway. Dockerfile.python: - Split pip install into a dedicated agent-builder stage that carries full `python:3.12` (with compilers + dev headers needed for wheels that don't ship pre-built for -slim), and produces a self-contained /opt/venv. The runner then COPYs /opt/venv as a single opaque tree — no pip, no build tools in the final image. Dockerfile.java and Dockerfile.dotnet already implement the true multi-stage shape (temurin-21 JDK / dotnet-9 SDK builder + JRE / aspnet runtime); no structural changes needed. Regenerating the 17 starter Dockerfiles happens in the next commit block — this commit is template-authoring only.
pull Bot
pushed a commit
to KornaAI/CopilotKit
that referenced
this pull request
Apr 22, 2026
…ls per framework Add per-slug Dockerfile emitters that pair with the new AGENT_BUILD_STEPS / AGENT_BUILD_COPY tokens in Dockerfile.typescript: - getAgentBuildSteps(fw): runs in the builder stage, after `npm run build`. Emits `npx tsc` for claude-sdk-typescript (compiles agent/index.ts → /app/dist/agent/index.js with flags that match the sibling package Dockerfile), and `npx mastra build --dir src/mastra` for mastra (bundles the server into .mastra/output/index.mjs). Returns "" for every other slug so their Dockerfile cache stays unchanged. - getAgentBuildCopy(fw): runs in the runner stage, after the agent-code COPY. Moves /app/dist (claude-sdk-ts) or /app/.mastra (mastra) from the frontend stage into the runner. - getEntrypointBlock() prod-mode updates: mastra now boots via `node /app/.mastra/output/index.mjs` (not `npx mastra dev`) and claude-sdk-typescript via `node /app/dist/agent/index.js` (not `npx tsx agent/index.ts`). Cold start is a straight `node` invocation on Railway — mirrors PR CopilotKit#4132's fix for langgraph-ts. - Wire AGENT_BUILD_STEPS / AGENT_BUILD_COPY into the `vars` map in generateStarterImpl so the template substitution picks up the new tokens, and export the two helpers so the test suite can guard them. Also refresh the generator header comment to describe the multi-stage shape (builder toolchain vs. minimal runtime) and the prod-mode emitter wiring. Tests: - Replace the legacy `mastra dev` / `npx tsx` entrypoint expectations with prod-mode assertions (`node /app/.mastra/output/index.mjs`, `node /app/dist/agent/index.js`), plus not-to-contain guards so a future refactor can't accidentally re-enable the tsx/dev path. - Add a dedicated describe block for getAgentBuildSteps / getAgentBuildCopy covering the two opted-in slots, the "" fallthrough for langgraph-typescript (which has its own server.mjs migration path), and the "" fallthrough for every Python slug (Python prod-mode is shared-template, not per-slug). Full `vitest run` in showcase/scripts is green (1085 tests). Starter Dockerfile regeneration is deferred to a follow-up commit block once Task 1's template wiring lands.
3 tasks
marthakelly
added a commit
that referenced
this pull request
May 5, 2026
…[email protected] (#4665) ## Summary - The `langgraph-js` starter agent container has been crashing on startup with `SyntaxError: The requested module '@langchain/langgraph/web' does not provide an export named 'STREAM_EVENTS_V3_MODES'` - Root cause: `@langchain/[email protected]` (pulled transitively by `npx @langchain/langgraph-cli`) imports `STREAM_EVENTS_V3_MODES` from `@langchain/langgraph/web`, which only exists in `@langchain/[email protected]+`. The starter pinned langgraph to `1.2.9` in both `package.json#overrides` and `agent/package.json#dependencies`, so the symbol wasn't there at runtime - Bump `@langchain/langgraph` to `1.3.0` in both pin sites - Pin `@langchain/[email protected]` in the two npx invocations (`agent/package.json` dev script and `docker/Dockerfile.agent` CMD) so a future LangChain cross-package drift cannot silently re-break the starter This is the same class of failure as PR #4132 in `langgraph-typescript`. Same starter family, same npx-pulls-latest fragility, different root mitigation. ## Test plan - [ ] CI smoke test for `langgraph-js` passes (currently failing on `main` and on every open PR) - [ ] `docker compose -f docker-compose.test.yml up` boots the agent container without the `STREAM_EVENTS_V3_MODES` SyntaxError - [ ] `npm install && npm run dev` from `examples/integrations/langgraph-js/` brings up the agent on port 8123
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…rect @langchain/langgraph-api server (CopilotKit#4132) ## Summary Root cause of the 4+ day `langgraph-typescript` flap: `npx @langchain/langgraph-cli dev` is a dev-mode CLI that compiles TypeScript on-demand per HTTP request, blocking the single-thread event loop ~5s per request. On Railway, Studio IPC + `langgraph-api` JIT spawn + graph compile routinely exceeded the 90s watchdog budget; PR CopilotKit#4123's 180s grace papered over cold-start but didn't fix steady-state `/schemas` event-loop blocking. This PR replaces the CLI with a direct import of `startServer` from `@langchain/langgraph-api/server` (the same Hono server `dev` wraps, minus the tsx watcher, Studio handshake, and LangSmith tenant lookup). Schema extraction runs in a `worker_thread` and is pre-warmed in parallel with server startup. Container-tested on `node:22-slim`: - `/ok` live in <3s (vs. 5-30s dev) - `/ok` steady-state <10ms - `/assistants/search` returns the registered `starterAgent` graph - Pre-warm log: `[server] Pre-warmed schemas in 3402ms` ## Caveats - Uses `--legacy-peer-deps` for `@langchain/langgraph-sdk` version skew. - `@langchain/langgraph-api` exports `./server` but it's not officially public API — exact version pin (`1.1.17`) required. - `/runs` streaming not end-to-end tested (dummy key); `/assistants/search` and schema extraction verified. ## Test plan - [ ] `docker build` of package succeeds (verified locally on `node:22-slim`, arm64) - [ ] Railway deploy passes healthcheck within watchdog budget - [ ] Live probe: `curl https://showcase-langgraph-typescript-production.up.railway.app/api/health` returns 200 + `agent: ok` - [ ] Smoke test run through Studio / demo client end-to-end (real key) ## Related - Prior attempts: CopilotKit#4116 (watchdog), CopilotKit#4123 (180s grace) — neither addressed the structural issue - Proposal context: https://www.notion.so/3493aa381852814d968df05fc461206d §2c
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
… break watchdog restart loop PR CopilotKit#4132 migrated away from `langgraph-cli dev` to the @langchain/langgraph-api `startServer` Hono server. That server does bind `/ok` via its meta routes, but only AFTER `registerFromEnv` imports the graph and spawns the N workers — on Railway that window has been exceeding the watchdog's 180s startup grace plus the 90s strike budget, producing an infinite restart loop (deploy ddc88ef9 is currently flapping ~every 4m30s). Move liveness off the heavy Hono path entirely: - server.mjs now spins up a bare node:http server on port 8124 (configurable via HEALTH_PORT) *synchronously before any await*, answering GET /ok with {"status":"ok"}. Always live within ms of `node` boot. - entrypoint.sh watchdog now probes 127.0.0.1:8124/ok instead of :8123/ok. The liveness port is independent of whether :8123 has finished graph import, so the probe reflects what the watchdog actually cares about: is the Node process alive and its event loop responsive. A true hang (event loop pinned) still fails the probe and triggers container restart, so the existing hang-detection behavior is preserved. Local Docker smoke (amd64): curl /ok returned 200 within 20s of container start; LangGraph API logged "listening on 0.0.0.0:8123" ~15s later as normal.
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…er prod-mode migration (CopilotKit#4140) ## Summary - Root cause: CopilotKit#4132 migrated langgraph-typescript from `langgraph-cli dev` (which exposed `/ok` immediately) to `@langchain/langgraph-api` `startServer`. That server DOES register `/ok` via its meta routes, but only binds the port AFTER `registerFromEnv` imports the graph and spawns the N workers. On Railway that window has been exceeding the watchdog's 180s startup grace + 90s strike budget, producing an infinite restart loop (deploy `ddc88ef9` is flapping ~every 4m30s). - Fix: move liveness off the heavy Hono path entirely. `server.mjs` now starts a bare `node:http` server on port 8124 (configurable via `HEALTH_PORT`) synchronously before any `await`, answering `GET /ok` with `{"status":"ok"}`. `entrypoint.sh` watchdog now probes `127.0.0.1:8124/ok` instead of `:8123/ok`. ## Why The service has been 502-ing all day. Railway deploy `ddc88ef9` never serves a single `/api/health` 200 despite `[server] LangGraph API listening on 0.0.0.0:8123` landing in the logs — the `listening` callback fires after the watchdog has already killed PID 4 and triggered a restart. Liveness on a sibling port is independent of whether :8123 has finished its graph import, so the probe reflects what the watchdog actually cares about: is the Node process alive and its event loop responsive. A true hang (event loop pinned) still fails the probe and triggers container restart, so hang-detection is preserved. ## Test plan - [x] Local Docker build green (`--platform linux/amd64`, depot) - [x] Local container `curl http://127.0.0.1:8124/ok` returns `HTTP=200 {"status":"ok"}` within 20s of boot - [x] `[server] Liveness probe listening on 0.0.0.0:8124` emitted before `[server] LangGraph API listening on 0.0.0.0:8123` - [ ] Railway redeploy recovers `/api/health` + `/api/smoke`
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…rod-mode tokens Restructure the shared starter Dockerfile templates so the runtime stage ships only a minimal base plus built artifacts — no dev toolchains (pip, pnpm, tsx, *-cli dev) run in the runner stage. Dockerfile.typescript: - Add AGENT_BUILD_STEPS / AGENT_BUILD_COPY template tokens so per-slug prod-mode compiles (claude-sdk-typescript tsc, mastra `mastra build`) can be emitted by the generator. Mirrors PR CopilotKit#4132's langgraph-typescript fix for the rest of the TS starter slots — cold start becomes a straight `node` call instead of `npx tsx` / `npx mastra dev` on Railway. Dockerfile.python: - Split pip install into a dedicated agent-builder stage that carries full `python:3.12` (with compilers + dev headers needed for wheels that don't ship pre-built for -slim), and produces a self-contained /opt/venv. The runner then COPYs /opt/venv as a single opaque tree — no pip, no build tools in the final image. Dockerfile.java and Dockerfile.dotnet already implement the true multi-stage shape (temurin-21 JDK / dotnet-9 SDK builder + JRE / aspnet runtime); no structural changes needed. Regenerating the 17 starter Dockerfiles happens in the next commit block — this commit is template-authoring only.
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…ls per framework Add per-slug Dockerfile emitters that pair with the new AGENT_BUILD_STEPS / AGENT_BUILD_COPY tokens in Dockerfile.typescript: - getAgentBuildSteps(fw): runs in the builder stage, after `npm run build`. Emits `npx tsc` for claude-sdk-typescript (compiles agent/index.ts → /app/dist/agent/index.js with flags that match the sibling package Dockerfile), and `npx mastra build --dir src/mastra` for mastra (bundles the server into .mastra/output/index.mjs). Returns "" for every other slug so their Dockerfile cache stays unchanged. - getAgentBuildCopy(fw): runs in the runner stage, after the agent-code COPY. Moves /app/dist (claude-sdk-ts) or /app/.mastra (mastra) from the frontend stage into the runner. - getEntrypointBlock() prod-mode updates: mastra now boots via `node /app/.mastra/output/index.mjs` (not `npx mastra dev`) and claude-sdk-typescript via `node /app/dist/agent/index.js` (not `npx tsx agent/index.ts`). Cold start is a straight `node` invocation on Railway — mirrors PR CopilotKit#4132's fix for langgraph-ts. - Wire AGENT_BUILD_STEPS / AGENT_BUILD_COPY into the `vars` map in generateStarterImpl so the template substitution picks up the new tokens, and export the two helpers so the test suite can guard them. Also refresh the generator header comment to describe the multi-stage shape (builder toolchain vs. minimal runtime) and the prod-mode emitter wiring. Tests: - Replace the legacy `mastra dev` / `npx tsx` entrypoint expectations with prod-mode assertions (`node /app/.mastra/output/index.mjs`, `node /app/dist/agent/index.js`), plus not-to-contain guards so a future refactor can't accidentally re-enable the tsx/dev path. - Add a dedicated describe block for getAgentBuildSteps / getAgentBuildCopy covering the two opted-in slots, the "" fallthrough for langgraph-typescript (which has its own server.mjs migration path), and the "" fallthrough for every Python slug (Python prod-mode is shared-template, not per-slug). Full `vitest run` in showcase/scripts is green (1085 tests). Starter Dockerfile regeneration is deferred to a follow-up commit block once Task 1's template wiring lands.
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…ers, 17 packages (CopilotKit#4147) ## Summary - Rewrite starter Dockerfile templates (`typescript`, `python`, `java`, `dotnet`) as true multi-stage: builder has dev tools, runner is minimal. No `pip`/`npm`/`pnpm`/`tsx`/`*-cli dev` in runtime stages. - Encode prod-mode behaviors for `claude-sdk-typescript`, `mastra`, `langgraph-typescript` directly in the TS template + generator conditionals (folds in the pattern from CopilotKit#4132 for langgraph-ts; adds parallel migration for claude-sdk-ts + mastra). - Regenerate all 17 starter Dockerfiles. - Rewrite all 17 package Dockerfiles to match the template shape (multi-stage, venv builder for Python, 3-stage Python runtime, `USER app`, etc.). - Cold-start instrumentation on `claude-sdk-typescript` package (absorbed from closed PR CopilotKit#4133). - Pin `platforms: linux/amd64` in the showcase deploy workflow (`docker/build-push-action` step) to match what Railway + GHCR require. - Template `README.md` documenting multi-stage conventions, size target, platform mandate, and the `dockerfile_hygiene` probe. - `generate-starters.ts` strips the `langgraph-typescript` starter's dead `server.mjs` + its `start` script (both reference deps only needed in the package's prod-mode path). ## Why Railway cold starts exceed the 180s watchdog grace when the runtime stage boots via `langgraph-cli dev` / `npx mastra dev` / `npx tsx` — the dev-mode work (TS compile, Rollup bundle, native libsql init) blocks the health probe. CopilotKit#4132 proved the fix is to move this to image build time for langgraph-ts. This PR generalizes that shape to all TS starters that need it and reshapes every Dockerfile in the tree so runners no longer carry dev toolchains. Secondary outcomes: - Smaller runtime images (pip/npm toolchain moved to builder only). - Consistent `--platform linux/amd64` pinning end-to-end. - No `pnpm install --frozen-lockfile` in the TS starter template (starters are no-lockfile by design). - `validate-pins` ratchet re-baselined to match the regenerated spec strings. ## Test plan - [ ] `docker build --platform linux/amd64` green for every starter (17) and package (17) locally - [ ] `pnpm -C showcase/scripts` vitest: 1085/1085 pass - [ ] `tsc --noEmit -p showcase/scripts/tsconfig.json` clean - [ ] `oxfmt --check` + `oxlint` clean on touched TS files - [ ] validate-pins: count 110, hash matches updated baseline - [ ] CI Showcase Validate green on PR HEAD - [ ] Post-merge: showcase deploy for mastra + claude-sdk-typescript goes green (currently flapping)
zeekay
pushed a commit
to Dream-AI-4444/CopilotKit
that referenced
this pull request
Sep 11, 2026
…[email protected] (CopilotKit#4665) ## Summary - The `langgraph-js` starter agent container has been crashing on startup with `SyntaxError: The requested module '@langchain/langgraph/web' does not provide an export named 'STREAM_EVENTS_V3_MODES'` - Root cause: `@langchain/[email protected]` (pulled transitively by `npx @langchain/langgraph-cli`) imports `STREAM_EVENTS_V3_MODES` from `@langchain/langgraph/web`, which only exists in `@langchain/[email protected]+`. The starter pinned langgraph to `1.2.9` in both `package.json#overrides` and `agent/package.json#dependencies`, so the symbol wasn't there at runtime - Bump `@langchain/langgraph` to `1.3.0` in both pin sites - Pin `@langchain/[email protected]` in the two npx invocations (`agent/package.json` dev script and `docker/Dockerfile.agent` CMD) so a future LangChain cross-package drift cannot silently re-break the starter This is the same class of failure as PR CopilotKit#4132 in `langgraph-typescript`. Same starter family, same npx-pulls-latest fragility, different root mitigation. ## Test plan - [ ] CI smoke test for `langgraph-js` passes (currently failing on `main` and on every open PR) - [ ] `docker compose -f docker-compose.test.yml up` boots the agent container without the `STREAM_EVENTS_V3_MODES` SyntaxError - [ ] `npm install && npm run dev` from `examples/integrations/langgraph-js/` brings up the agent on port 8123
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause of the 4+ day
langgraph-typescriptflap:npx @langchain/langgraph-cli devis a dev-mode CLI that compiles TypeScript on-demand per HTTP request, blocking the single-thread event loop ~5s per request. On Railway, Studio IPC +langgraph-apiJIT spawn + graph compile routinely exceeded the 90s watchdog budget; PR #4123's 180s grace papered over cold-start but didn't fix steady-state/schemasevent-loop blocking.This PR replaces the CLI with a direct import of
startServerfrom@langchain/langgraph-api/server(the same Hono serverdevwraps, minus the tsx watcher, Studio handshake, and LangSmith tenant lookup). Schema extraction runs in aworker_threadand is pre-warmed in parallel with server startup.Container-tested on
node:22-slim:/oklive in <3s (vs. 5-30s dev)/oksteady-state <10ms/assistants/searchreturns the registeredstarterAgentgraph[server] Pre-warmed schemas in 3402msCaveats
--legacy-peer-depsfor@langchain/langgraph-sdkversion skew.@langchain/langgraph-apiexports./serverbut it's not officially public API — exact version pin (1.1.17) required./runsstreaming not end-to-end tested (dummy key);/assistants/searchand schema extraction verified.Test plan
docker buildof package succeeds (verified locally onnode:22-slim, arm64)curl https://showcase-langgraph-typescript-production.up.railway.app/api/healthreturns 200 +agent: okRelated