bytedance/deer-flow · error · HTTPException
Thread has a run in flight. Compact after the run finishes.
Error message
Thread has a run in flight. Compact after the run finishes.
What it means
Error "Thread has a run in flight. Compact after the run finishes." thrown in bytedance/deer-flow.
Source
Thrown at backend/app/gateway/routers/threads.py:1174
thread_id=thread_id,
as_node="manual_compaction",
)
except _CHECKPOINT_MODE_ERRORS as exc:
raise _checkpoint_mode_http_error(exc, thread_id) from exc
keep = body.keep.to_tuple() if body.keep is not None else None
try:
async with reserve_checkpoint_write(request, thread_id, user_id=get_effective_user_id()):
result = await compact_thread_context(
accessor,
thread_id,
keep=keep,
force=body.force,
user_id=get_effective_user_id(),
agent_name=body.agent_name,
model_name=body.model_name,
)
except ConflictError:
raise HTTPException(status_code=409, detail="Thread has a run in flight. Compact after the run finishes.") from None
except _CHECKPOINT_MODE_ERRORS as exc:
raise _checkpoint_mode_http_error(exc, thread_id) from exc
except ContextCompactionDisabled:
raise HTTPException(status_code=409, detail="Context compaction is disabled.") from None
except ContextCompactionFailed:
raise HTTPException(status_code=500, detail="Failed to compact thread context.") from None
except LookupError:
raise HTTPException(status_code=404, detail=f"Thread {thread_id} not found") from None
except HTTPException:
raise
except Exception:
logger.exception("Failed to compact thread %s", sanitize_log_param(thread_id))
raise HTTPException(status_code=500, detail="Failed to compact thread context.") from None
return _thread_compact_response(result)
# ---------------------------------------------------------------------------
@router.get("/{thread_id}/state", response_model=ThreadStateResponse)View on GitHub (pinned to 1dd6ba1acb)
Solutions
- Wait for the in-flight run to finish before compacting.
- Cancel the active run first if compaction is urgent.
When it happens
Trigger: Thrown at backend/app/gateway/routers/threads.py:1174 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/bd5dfb99383ac445.
Report an issue: GitHub.