bytedance/deer-flow · error · HTTPException

Context compaction is disabled.

Error message

Context compaction is disabled.

What it means

Error "Context compaction is disabled." thrown in bytedance/deer-flow.

Source

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

        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)
@require_permission("threads", "read", owner_check=True)
async def get_thread_state(thread_id: ThreadId, request: Request) -> ThreadStateResponse:
    """Get the latest materialized graph state for a thread."""
    # Resolve through the thread's assistant so custom middleware channels

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Enable context compaction in config.yaml (context.compaction.enabled=true) and restart the Gateway.
  2. If compaction is intentionally disabled, no action is needed.

When it happens

Trigger: Thrown at backend/app/gateway/routers/threads.py:1178 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/0423dc9005e5f132. Report an issue: GitHub.