{"record":{"id":"00ec1e9933286e04","repo":"bytedance/deer-flow","slug":"unsupported-stream-mode","errorCode":"unsupported_stream_mode","errorMessage":"Unsupported stream mode(s): {modes}","messagePattern":"Unsupported stream mode\\(s\\): (.+?)","errorType":"validation","errorClass":"PydanticCustomError","httpStatus":422,"severity":"warning","filePath":"backend/app/gateway/run_models.py","lineNumber":113,"sourceCode":"            return value\n        raise PydanticCustomError(\n            \"unsupported_run_option\",\n            \"Run option '{option}' is not supported by DeerFlow\",\n            {\"option\": \"stream_resumable\"},\n        )\n\n    @field_validator(\"stream_mode\", mode=\"before\")\n    @classmethod\n    def reject_unsupported_stream_modes(cls, value: Any) -> Any:\n        if value is None:\n            return value\n        if not isinstance(value, str) and (not isinstance(value, list) or not all(isinstance(mode, str) for mode in value)):\n            return value\n        try:\n            normalize_stream_modes(value)\n        except UnsupportedStreamModeError as exc:\n            modes = \", \".join(exc.modes)\n            raise PydanticCustomError(\n                \"unsupported_stream_mode\",\n                \"Unsupported stream mode(s): {modes}\",\n                {\"modes\": modes},\n            ) from exc\n        return value\n","sourceCodeStart":95,"sourceCodeEnd":119,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/run_models.py#L95-L119","documentation":"Pydantic validation error (code unsupported_stream_mode) raised when the stream_mode in a run payload contains mode names DeerFlow cannot serve. The validator delegates to normalize_stream_modes(); when that raises UnsupportedStreamModeError the offending mode list is joined into the message. HTTP 422 at request validation.","triggerScenarios":"Sending \"stream_mode\": \"values\" (or a list like [\"messages\",\"updates\",\"values\"]) where one of the modes is not in the supported set; sending arbitrary strings as stream modes.","commonSituations":"Clients ported from LangGraph Platform expecting its full mode set; typos in mode strings ('update' vs 'updates'); SDK defaults that include a mode DeerFlow has not implemented.","solutions":["Check the {modes} list in the error message — it names exactly which mode(s) to remove.","Use the documented DeerFlow stream modes (e.g. 'messages', 'updates', and other modes accepted by normalize_stream_modes).","Validate modes client-side against the accepted set before sending."],"exampleFix":"# before\n{\"stream_mode\": [\"messages\", \"values\"]}\n\n# after\n{\"stream_mode\": [\"messages\", \"updates\"]}","handlingStrategy":"validation","validationCode":"const SUPPORTED_MODES = new Set(['messages', 'updates']); // keep in sync with DeerFlow\nconst modes = Array.isArray(payload.stream_mode) ? payload.stream_mode : [payload.stream_mode];\nconst bad = modes.filter(m => !SUPPORTED_MODES.has(m));\nif (bad.length) throw new Error(`Unsupported stream mode(s): ${bad.join(', ')}`);","typeGuard":"const isStreamMode = (m: unknown): m is string =>\n  typeof m === 'string' && SUPPORTED_MODES.has(m);","tryCatchPattern":"catch 422 code 'unsupported_stream_mode'; the detail lists the bad modes — remove them and retry.","preventionTips":["Maintain a client-side constant of supported modes and validate before each request.","Treat mode typos as build failures via payload schema tests."],"tags":["runs","http-422","streaming","validation"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}