{"record":{"id":"5e688f9e3529323b","repo":"BerriAI/litellm","slug":"langgraph-platform-discovery-requires-params-assis","errorCode":null,"errorMessage":"langgraph_platform discovery requires params.assistant_id","messagePattern":"langgraph_platform discovery requires params\\.assistant_id","errorType":"exception","errorClass":"AgentCardDiscoveryError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/a2a/discovery.py","lineNumber":69,"sourceCode":"\n\ndef _normalize_base_url(base_url: str) -> str:\n    return base_url.rstrip(\"/\")\n\n\ndef _build_langgraph_platform_paths(\n    params: dict[str, Any] | None,\n) -> tuple[str, ...]:\n    \"\"\"Build the paths to try for LangGraph Platform discovery.\n\n    LangGraph serves the card at ``/.well-known/agent-card.json`` with the\n    ``assistant_id`` carried as a query parameter. We still try the other\n    A2A path variants (with the same query string appended) so we degrade\n    gracefully if a deployment uses an older spec name.\n    \"\"\"\n    assistant_id: Final = (params or {}).get(\"assistant_id\")\n    if not assistant_id:\n        raise AgentCardDiscoveryError(\"langgraph_platform discovery requires params.assistant_id\")\n    query: Final = urlencode({\"assistant_id\": str(assistant_id)})\n    return tuple(f\"{path}?{query}\" for path in AGENT_CARD_WELL_KNOWN_PATHS)\n\n\ndef _paths_for_mode(mode: DiscoveryMode, params: dict[str, Any] | None) -> tuple[str, ...]:\n    if mode == DiscoveryMode.WELL_KNOWN_FALLBACK:\n        return AGENT_CARD_WELL_KNOWN_PATHS\n    if mode == DiscoveryMode.LANGGRAPH_PLATFORM:\n        return _build_langgraph_platform_paths(params)\n    raise AgentCardDiscoveryError(f\"unsupported discovery_mode: {mode}\")\n\n\nasync def fetch_well_known_card(\n    base_url: str,\n    *,\n    discovery_mode: DiscoveryMode = DiscoveryMode.WELL_KNOWN_FALLBACK,\n    params: dict[str, Any] | None = None,\n    timeout: float = DEFAULT_DISCOVERY_TIMEOUT_SECONDS,","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/a2a/discovery.py#L51-L87","documentation":"Validation when building A2A discovery paths for LangGraph Platform: params (or params.assistant_id) is missing, but LangGraph serves agent cards per assistant, so the assistant_id query parameter is mandatory.","triggerScenarios":"Thrown at litellm/proxy/a2a/discovery.py:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include params.assistant_id in the discovery request."],"exampleFix":"params={'assistant_id': 'asst_...'}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}