bytedance/deer-flow · error · HTTPException

Thread has a run in flight. Update state after the run finis

Error message

Thread has a run in flight. Update state after the run finishes.

What it means

Error "Thread has a run in flight. Update state after the run finishes." thrown in bytedance/deer-flow.

Source

Thrown at backend/app/gateway/routers/threads.py:1290

        if unknown_fields:
            raise HTTPException(
                status_code=422,
                detail=f"Unknown thread-state field(s): {', '.join(unknown_fields)}",
            )
    reducer_fields = graph_reducer_channels(getattr(accessor, "graph", None))
    if reducer_fields is None:
        reducer_fields = THREAD_STATE_REDUCER_FIELDS
    updates = {key: Overwrite(value) if key in reducer_fields else value for key, value in values.items()}
    try:
        async with reserve_checkpoint_write(request, thread_id, user_id=get_effective_user_id()):
            updated_config = await accessor.aupdate(
                read_config,
                updates,
                as_node=mutation_node,
            )
            snapshot = await accessor.aget(updated_config)
    except ConflictError:
        raise HTTPException(status_code=409, detail="Thread has a run in flight. Update state after the run finishes.") from None
    except _CHECKPOINT_MODE_ERRORS as exc:
        raise _checkpoint_mode_http_error(exc, thread_id) from exc
    except Exception:
        logger.exception("Failed to update state for thread %s", sanitize_log_param(thread_id))
        raise HTTPException(status_code=500, detail="Failed to update thread state")

    if thread_store and body.values and "title" in body.values:
        new_title = body.values["title"]
        if new_title:
            try:
                await thread_store.update_display_name(thread_id, new_title)
            except Exception:
                logger.debug("Failed to sync title to thread_meta for %s (non-fatal)", sanitize_log_param(thread_id))

    snapshot_config = snapshot.config or {}
    checkpoint_id = snapshot_config.get("configurable", {}).get("checkpoint_id")
    parent_config = snapshot.parent_config or {}
    parent_checkpoint_id = parent_config.get("configurable", {}).get("checkpoint_id")

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Wait for the in-flight run to finish before updating thread state.
  2. Cancel the active run first if the update is urgent.

When it happens

Trigger: Thrown at backend/app/gateway/routers/threads.py:1290 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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