bytedance/deer-flow · warning · PydanticCustomError

unsupported_run_option

unsupported_run_option

Error message

Run option '{option}' is not supported by DeerFlow

What it means

Pydantic validation error (code unsupported_run_option) raised on run-creation payloads that set a run option to a value DeerFlow does not support. A field validator compares each gated option against its allowed default/enum (e.g. multitask_strategy must be one of reject/rollback/interrupt, if_not_exists must be 'create'); anything else is rejected at request validation time with HTTP 422.

Source

Thrown at backend/app/gateway/run_models.py:81

    def reject_unsupported_run_options(cls, value: Any, info: ValidationInfo) -> Any:
        if info.field_name in {"multitask_strategy", "if_not_exists"} and not isinstance(value, str):
            return value

        supported_defaults = {
            "webhook": None,
            "on_completion": None,
            "multitask_strategy": {"reject", "rollback", "interrupt"},
            "after_seconds": None,
            "if_not_exists": "create",
            "feedback_keys": None,
        }
        supported = supported_defaults[info.field_name]
        if isinstance(supported, set):
            is_supported = isinstance(value, str) and value in supported
        else:
            is_supported = value == supported
        if not is_supported:
            raise PydanticCustomError(
                "unsupported_run_option",
                "Run option '{option}' is not supported by DeerFlow",
                {"option": info.field_name},
            )
        return value

    @field_validator("stream_resumable", mode="before")
    @classmethod
    def reject_resumable_streams(cls, value: Any) -> Any:
        # LangGraph SDK clients always send this field (its default is ``False``, which the
        # payload's ``None`` filter keeps). ``False`` asks for the non-resumable stream
        # DeerFlow already serves, so only an explicit ``True`` requests the unsupported feature.
        if value is None or value is False:
            return value
        raise PydanticCustomError(
            "unsupported_run_option",
            "Run option '{option}' is not supported by DeerFlow",
            {"option": "stream_resumable"},

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Read the {option} placeholder in the error — it names the exact unsupported field; remove it or set it to the supported value.
  2. For multitask_strategy use 'reject', 'rollback', or 'interrupt'; for if_not_exists use 'create'; leave on_completion/after_seconds/feedback_keys unset.
  3. Pin the client to sending only options DeerFlow advertises; check the DeerFlow release notes when upgrading, as the supported set can change.

Example fix

# before
{"assistant_id": "lead_agent", "multitask_strategy": "enqueue", "input": {...}}

# after
{"assistant_id": "lead_agent", "multitask_strategy": "reject", "input": {...}}
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = {
  multitask_strategy: new Set(['reject', 'rollback', 'interrupt']),
  if_not_exists: 'create',
};
function sanitizeRunOptions(payload) {
  for (const [k, allowed] of Object.entries(SUPPORTED)) {
    const v = payload[k];
    if (v === undefined) continue;
    const ok = allowed instanceof Set ? allowed.has(v) : v === allowed;
    if (!ok) delete payload[k]; // or throw with field name
  }
  delete payload.on_completion;
  delete payload.after_seconds;
  return payload;
}

Try / catch

catch 422 with code 'unsupported_run_option'; parse the {option} from the message, strip/fix that field, retry once.

Prevention

When it happens

Trigger: POSTing a run (LangGraph-compatible /runs or stream endpoint) with e.g. multitask_strategy: 'enqueue', if_not_exists: 'replace', on_completion set to a non-null callback, or after_seconds set — values the supported_defaults map does not allow.

Common situations: Pointing an upstream LangGraph SDK/client at DeerFlow and sending options the full LangGraph platform supports but DeerFlow deliberately narrows; copying payload examples from LangGraph docs; version drift after DeerFlow tightened accepted options.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/727efd12230f0036. Report an issue: GitHub.