bytedance/deer-flow · warning · PydanticCustomError
unsupported_stream_mode
unsupported_stream_mode
Error message
Unsupported stream mode(s): {modes} What it means
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.
Source
Thrown at backend/app/gateway/run_models.py:113
return value
raise PydanticCustomError(
"unsupported_run_option",
"Run option '{option}' is not supported by DeerFlow",
{"option": "stream_resumable"},
)
@field_validator("stream_mode", mode="before")
@classmethod
def reject_unsupported_stream_modes(cls, value: Any) -> Any:
if value is None:
return value
if not isinstance(value, str) and (not isinstance(value, list) or not all(isinstance(mode, str) for mode in value)):
return value
try:
normalize_stream_modes(value)
except UnsupportedStreamModeError as exc:
modes = ", ".join(exc.modes)
raise PydanticCustomError(
"unsupported_stream_mode",
"Unsupported stream mode(s): {modes}",
{"modes": modes},
) from exc
return value
View on GitHub (pinned to 1dd6ba1acb)
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.
Example fix
# before
{"stream_mode": ["messages", "values"]}
# after
{"stream_mode": ["messages", "updates"]} Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_MODES = new Set(['messages', 'updates']); // keep in sync with DeerFlow
const modes = Array.isArray(payload.stream_mode) ? payload.stream_mode : [payload.stream_mode];
const bad = modes.filter(m => !SUPPORTED_MODES.has(m));
if (bad.length) throw new Error(`Unsupported stream mode(s): ${bad.join(', ')}`); Type guard
const isStreamMode = (m: unknown): m is string => typeof m === 'string' && SUPPORTED_MODES.has(m);
Try / catch
catch 422 code 'unsupported_stream_mode'; the detail lists the bad modes — remove them and retry.
Prevention
- Maintain a client-side constant of supported modes and validate before each request.
- Treat mode typos as build failures via payload schema tests.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- unsupported_run_option
- str(exc)
- Invalid agent name '{name}'. Must match ^[A-Za-z0-9-]+$ (let
- Unknown model '{model}'. Use a model name defined under `mod
- Password is too common; choose a stronger password.
AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14).
Data as JSON: /api/errors/00ec1e9933286e04.
Report an issue: GitHub.