Hi everyone,
I’m trying to run the examples/assistant-ui-claude example from the LangGraphJS repository.
After some setup issues (workspace dependencies, CLI naming, etc.), the application now starts successfully:
- Frontend is running on
http://localhost:5174
- LangGraph server is running on
http://localhost:2024
- The UI loads correctly
However, when I try to interact with the assistant, I get a 404 error on the following endpoint:
http://localhost:5174/api/langgraph/threads/<thread-id>/commands
Example:
/api/langgraph/threads/019ebc56-cd63-7742-b9a5-6d4e65308db9/commands
The request returns:
404 Not Found
A few questions:
- Is the
/commands endpoint still expected to exist in the current version of the example?
- Has the Assistant UI example become incompatible with recent LangGraph/LangGraph SDK versions?
- Is there an additional proxy or API route configuration that needs to be enabled?
- Has anyone successfully run the
assistant-ui-claude example recently from the current main branch?
Any guidance would be appreciated.
Thanks!
hi @gdrouet
I haven’t tried it lately, but from code investigation I’ve just proceeded I see this:
Root cause
src/components/my-assistant.tsx:25:
const apiUrl =
import.meta.env.VITE_LANGGRAPH_API_URL ??
`${window.location.origin}/api/langgraph`; // -> http://localhost:5174/api/langgraph
No VITE_LANGGRAPH_API_URL set + vite.config.ts has no proxy → request never reaches :2024. Thread id shows up because new SDK transport creates thread client-side before first command POST.
Per question
/commands exist? Yes. langgraph-api v1.3.0 registers it - src/api/protocol.mts:137 api.post("/threads/:thread_id/commands", …). New thread-centric HTTP+SSE transport (libs/sdk/.../transport/http.ts: commandsUrl = /threads/${threadId}/commands)
- Incompatible with recent SDK? No. Example + react SDK + langgraph + langgraph-api all same monorepo, pinned together (
workspace:*). Config bug, not skew
- Extra proxy/route config needed? Yes - the fix
- Runs from main? Yes, once configured
Fix - pick one
A. Point SDK at dev server. Make examples/assistant-ui-claude/.env:
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4.1-mini
VITE_LANGGRAPH_API_URL=http://localhost:2024
VITE_LANGGRAPH_ASSISTANT_ID=assistant-ui-claude
B. Same-origin + Vite proxy in vite.config.ts:
server: {
proxy: {
"/api/langgraph": {
target: "http://localhost:2024",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api\/langgraph/, ""),
},
},
},
(leave VITE_LANGGRAPH_API_URL unset).
Gotcha - second bug after URL fix
Code default assistantId: "claude" ≠ langgraph.json graph key assistant-ui-claude. Must set VITE_LANGGRAPH_ASSISTANT_ID=assistant-ui-claude or next error = graph-not-found.
Restart dev after .env edit - Vite reads .env from example folder, exposes only VITE_-prefixed vars.
===
Could you try it out and let me know whether it works for you?
Thanks it works now.
I’m testing with my own agent server built with the docker image langchain/langgraph-api:3.13and it seems /commands does not exist. Am I missing something?
hmmmm
can you try one of these?
-
Upgrade server to v3-capable langgraph-api (bump the server package, not the Python tag), rebuild image, re-probe. Keeps assistant-ui wiring unchanged.
-
Use the classic Runs hook if you can’t move the server:
import { useStream } from "@langchain/langgraph-sdk/react"; // v1.9.x — hits /threads/{id}/runs/stream
@langchain/react’s useStream can’t downgrade to the Runs API. The classic hook (stream.lgp.tsx → client.runs.stream) works against current Platform servers