bytedance/deer-flow · error · HTTPException
Assistant {assistant_id} not found
Error message
Assistant {assistant_id} not found What it means
404 from the LangGraph-compat assistants route: GET /api/assistants/{assistant_id} scans the configured assistant list and no entry matches the id. The Gateway has no per-assistant persistence; it serves a static list derived from configuration, so unknown ids are simply not present.
Source
Thrown at backend/app/gateway/routers/assistants_compat.py:115
assistants = await asyncio.to_thread(_list_assistants)
if body and body.graph_id:
assistants = [a for a in assistants if a.graph_id == body.graph_id]
if body and body.name:
assistants = [a for a in assistants if body.name.lower() in a.name.lower()]
offset = body.offset if body else 0
limit = body.limit if body else 10
return assistants[offset : offset + limit]
@router.get("/{assistant_id}", response_model=AssistantResponse)
async def get_assistant_compat(assistant_id: str) -> AssistantResponse:
"""Get an assistant by ID."""
for a in await asyncio.to_thread(_list_assistants):
if a.assistant_id == assistant_id:
return a
raise HTTPException(status_code=404, detail=f"Assistant {assistant_id} not found")
@router.get("/{assistant_id}/graph")
async def get_assistant_graph(assistant_id: str) -> dict:
"""Get the graph structure for an assistant.
Returns a minimal graph description. Full graph introspection is
not supported in the Gateway — this stub satisfies SDK validation.
"""
found = any(a.assistant_id == assistant_id for a in await asyncio.to_thread(_list_assistants))
if not found:
raise HTTPException(status_code=404, detail=f"Assistant {assistant_id} not found")
return {
"graph_id": "lead_agent",
"nodes": [],
"edges": [],
}View on GitHub (pinned to 1dd6ba1acb)
Solutions
- GET /api/assistants first and use an assistant_id from the returned list
- Configure the assistant you need in the Gateway config so its id appears in the list
- If using the LangGraph SDK, pass assistant_id from the listed values rather than a fabricated one
- Treat 404 here as terminal for that id — retrying unchanged will not help
Example fix
# before client.threads.create_run(thread_id, assistant_id="agent") # after assistants = client.assistants.search() assistant_id = assistants[0]["assistant_id"] # from the Gateway's list client.threads.create_run(thread_id, assistant_id=assistant_id)
Defensive patterns
Strategy: validation
Validate before calling
const assistants = await client.assistants.search();
const ids = new Set(assistants.map((a) => a.assistant_id));
if (!ids.has(myAssistantId)) throw new Error(`Unknown assistant: ${myAssistantId}`); Try / catch
try { await getAssistant(id); } catch (e) { if (e.status === 404) return null; throw e; } Prevention
- Never hardcode assistant ids; resolve them from the list at startup
- Re-resolve the list after Gateway config changes
When it happens
Trigger: GET /api/assistants/{id} where id is not one of the configured assistant ids (default is the lead agent). Typical with LangGraph SDK clients that enumerate assistants from another server or use hardcoded ids like 'agent' or a UUID.
Common situations: Pointing the LangGraph SDK/Studio at the Gateway while assuming assistants are stored and addressable by arbitrary ids; upgrading from a version where the id namespace differed; typo in a client-side default assistant id.
Related errors
- Artifact not found: {path}
- Skill file not found: {skill_file_path}
- File '{internal_path}' not found in skill archive
- Request failed.
- Failed to load thread history.
AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14).
Data as JSON: /api/errors/b36940c05d0f0715.
Report an issue: GitHub.