{"record":{"id":"b36940c05d0f0715","repo":"bytedance/deer-flow","slug":"assistant-assistant-id-not-found","errorCode":null,"errorMessage":"Assistant {assistant_id} not found","messagePattern":"Assistant (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"backend/app/gateway/routers/assistants_compat.py","lineNumber":115,"sourceCode":"    assistants = await asyncio.to_thread(_list_assistants)\n\n    if body and body.graph_id:\n        assistants = [a for a in assistants if a.graph_id == body.graph_id]\n    if body and body.name:\n        assistants = [a for a in assistants if body.name.lower() in a.name.lower()]\n\n    offset = body.offset if body else 0\n    limit = body.limit if body else 10\n    return assistants[offset : offset + limit]\n\n\n@router.get(\"/{assistant_id}\", response_model=AssistantResponse)\nasync def get_assistant_compat(assistant_id: str) -> AssistantResponse:\n    \"\"\"Get an assistant by ID.\"\"\"\n    for a in await asyncio.to_thread(_list_assistants):\n        if a.assistant_id == assistant_id:\n            return a\n    raise HTTPException(status_code=404, detail=f\"Assistant {assistant_id} not found\")\n\n\n@router.get(\"/{assistant_id}/graph\")\nasync def get_assistant_graph(assistant_id: str) -> dict:\n    \"\"\"Get the graph structure for an assistant.\n\n    Returns a minimal graph description. Full graph introspection is\n    not supported in the Gateway — this stub satisfies SDK validation.\n    \"\"\"\n    found = any(a.assistant_id == assistant_id for a in await asyncio.to_thread(_list_assistants))\n    if not found:\n        raise HTTPException(status_code=404, detail=f\"Assistant {assistant_id} not found\")\n\n    return {\n        \"graph_id\": \"lead_agent\",\n        \"nodes\": [],\n        \"edges\": [],\n    }","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/assistants_compat.py#L97-L133","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nclient.threads.create_run(thread_id, assistant_id=\"agent\")\n\n# after\nassistants = client.assistants.search()\nassistant_id = assistants[0][\"assistant_id\"]  # from the Gateway's list\nclient.threads.create_run(thread_id, assistant_id=assistant_id)","handlingStrategy":"validation","validationCode":"const assistants = await client.assistants.search();\nconst ids = new Set(assistants.map((a) => a.assistant_id));\nif (!ids.has(myAssistantId)) throw new Error(`Unknown assistant: ${myAssistantId}`);","typeGuard":null,"tryCatchPattern":"try { await getAssistant(id); } catch (e) { if (e.status === 404) return null; throw e; }","preventionTips":["Never hardcode assistant ids; resolve them from the list at startup","Re-resolve the list after Gateway config changes"],"tags":["assistants","http-404","langgraph-compat","api"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}