Skip to content

Commit 60d8139

Browse files
committed
fix(showcase): register all 25 graphs in langgraph-typescript server
The production LangGraph server only registered 5 of 25 graphs from langgraph.json, causing 404s for all unregistered graph endpoints. Also adds 6 missing agent registrations to the main route and normalizes deploymentUrl trailing slashes across dedicated routes.
1 parent faac42c commit 60d8139

8 files changed

Lines changed: 42 additions & 9 deletions

File tree

showcase/integrations/langgraph-typescript/src/agent/server.mjs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,36 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4040
// production parser walks the source file with the TypeScript API; pointing at
4141
// dist/graph.js still works because the parser reads whatever path we hand it,
4242
// but the runtime import lives in the same location so no tsx is required.
43+
// IMPORTANT: This must stay in sync with langgraph.json. Every graph
44+
// the Next.js API routes reference must be registered here, otherwise the
45+
// LangGraph server returns 404 on /runs/stream and the runtime surfaces
46+
// net::ERR_ABORTED to the browser.
4347
const graphSpec = {
4448
starterAgent: "./graph.ts:graph",
45-
shared_state_read_write: "./shared-state-read-write.ts:graph",
46-
subagents: "./subagents.ts:graph",
49+
beautiful_chat: "./beautiful-chat.ts:graph",
50+
headless_complete: "./headless-complete.ts:graph",
51+
multimodal: "./multimodal.ts:graph",
52+
agent_config_agent: "./agent-config.ts:graph",
53+
"agentic-chat-reasoning": "./reasoning-agent.ts:graph",
54+
"reasoning-default-render": "./reasoning-agent.ts:graph",
55+
"tool-rendering-default-catchall": "./tool-rendering.ts:graph",
56+
"tool-rendering-custom-catchall": "./tool-rendering.ts:graph",
57+
"tool-rendering-reasoning-chain": "./tool-rendering-reasoning-chain.ts:graph",
58+
interrupt_agent: "./interrupt-agent.ts:graph",
59+
a2ui_dynamic: "./a2ui-dynamic.ts:graph",
60+
a2ui_fixed: "./a2ui-fixed.ts:graph",
61+
mcp_apps: "./mcp-apps.ts:graph",
62+
frontend_tools: "./frontend-tools.ts:graph",
63+
frontend_tools_async: "./frontend-tools-async.ts:graph",
4764
hitl_in_app: "./hitl-in-app.ts:graph",
4865
hitl_in_chat: "./hitl-in-chat.ts:graph",
66+
readonly_state_agent_context: "./readonly-state.ts:graph",
67+
byoc_hashbrown: "./byoc-hashbrown.ts:graph",
68+
byoc_json_render: "./byoc-json-render.ts:graph",
69+
open_gen_ui: "./open-gen-ui.ts:graph",
70+
open_gen_ui_advanced: "./open-gen-ui-advanced.ts:graph",
71+
shared_state_read_write: "./shared-state-read-write.ts:graph",
72+
subagents: "./subagents.ts:graph",
4973
};
5074

5175
// Pre-warm schema cache before we accept traffic. This is what the official

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-a2ui-fixed-schema/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const LANGGRAPH_URL =
1414
process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123";
1515

1616
const a2uiFixedSchemaAgent = new LangGraphAgent({
17-
deploymentUrl: LANGGRAPH_URL,
17+
deploymentUrl: `${LANGGRAPH_URL}/`,
1818
graphId: "a2ui_fixed",
1919
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2020
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-agent-config/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function repackForwardedPropsIntoConfigurable<
142142
}
143143

144144
const agentConfigAgent = new AgentConfigLangGraphAgent({
145-
deploymentUrl: LANGGRAPH_URL,
145+
deploymentUrl: `${LANGGRAPH_URL}/`,
146146
graphId: "agent_config_agent",
147147
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
148148
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-byoc-hashbrown/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const LANGGRAPH_URL =
2323
process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123";
2424

2525
const byocHashbrownAgent = new LangGraphAgent({
26-
deploymentUrl: LANGGRAPH_URL,
26+
deploymentUrl: `${LANGGRAPH_URL}/`,
2727
graphId: "byoc_hashbrown",
2828
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2929
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-byoc-json-render/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const LANGGRAPH_URL =
2020
process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123";
2121

2222
const byocJsonRenderAgent = new LangGraphAgent({
23-
deploymentUrl: LANGGRAPH_URL,
23+
deploymentUrl: `${LANGGRAPH_URL}/`,
2424
graphId: "byoc_json_render",
2525
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2626
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-declarative-gen-ui/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const LANGGRAPH_URL =
1616
process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123";
1717

1818
const declarativeGenUiAgent = new LangGraphAgent({
19-
deploymentUrl: LANGGRAPH_URL,
19+
deploymentUrl: `${LANGGRAPH_URL}/`,
2020
graphId: "a2ui_dynamic",
2121
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2222
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit-ogui/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const LANGGRAPH_URL =
1616
process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123";
1717

1818
const openGenUiAgent = new LangGraphAgent({
19-
deploymentUrl: LANGGRAPH_URL,
19+
deploymentUrl: `${LANGGRAPH_URL}/`,
2020
graphId: "open_gen_ui",
2121
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2222
});
2323
const openGenUiAdvancedAgent = new LangGraphAgent({
24-
deploymentUrl: LANGGRAPH_URL,
24+
deploymentUrl: `${LANGGRAPH_URL}/`,
2525
graphId: "open_gen_ui_advanced",
2626
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
2727
});

showcase/integrations/langgraph-typescript/src/app/api/copilotkit/route.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const starterAgentNames = [
4242
// Headless Chat (Simple) — reuses the default `starterAgent` graph; the
4343
// demo's surface and frontend tool wiring live in the page component.
4444
"headless-simple",
45+
// Hitl demo (original) — reuses starter agent.
46+
"hitl",
4547
];
4648

4749
const agents: Record<string, LangGraphAgent> = {};
@@ -68,6 +70,13 @@ const demoAgents: Record<string, string> = {
6870
"readonly-state-agent-context": "readonly_state_agent_context",
6971
"shared-state-read-write": "shared_state_read_write",
7072
subagents: "subagents",
73+
// Reasoning demos — use dedicated reasoning agent graph.
74+
"agentic-chat-reasoning": "agentic-chat-reasoning",
75+
"reasoning-default-render": "reasoning-default-render",
76+
// Tool rendering variants — each has its own graph in langgraph.json.
77+
"tool-rendering-default-catchall": "tool-rendering-default-catchall",
78+
"tool-rendering-custom-catchall": "tool-rendering-custom-catchall",
79+
"tool-rendering-reasoning-chain": "tool-rendering-reasoning-chain",
7180
};
7281
for (const [agentName, graphId] of Object.entries(demoAgents)) {
7382
agents[agentName] = createAgent(graphId);

0 commit comments

Comments
 (0)