{"record":{"id":"0423dc9005e5f132","repo":"bytedance/deer-flow","slug":"context-compaction-is-disabled","errorCode":null,"errorMessage":"Context compaction is disabled.","messagePattern":"Context compaction is disabled\\.","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"backend/app/gateway/routers/threads.py","lineNumber":1178,"sourceCode":"        raise _checkpoint_mode_http_error(exc, thread_id) from exc\n    keep = body.keep.to_tuple() if body.keep is not None else None\n    try:\n        async with reserve_checkpoint_write(request, thread_id, user_id=get_effective_user_id()):\n            result = await compact_thread_context(\n                accessor,\n                thread_id,\n                keep=keep,\n                force=body.force,\n                user_id=get_effective_user_id(),\n                agent_name=body.agent_name,\n                model_name=body.model_name,\n            )\n    except ConflictError:\n        raise HTTPException(status_code=409, detail=\"Thread has a run in flight. Compact after the run finishes.\") from None\n    except _CHECKPOINT_MODE_ERRORS as exc:\n        raise _checkpoint_mode_http_error(exc, thread_id) from exc\n    except ContextCompactionDisabled:\n        raise HTTPException(status_code=409, detail=\"Context compaction is disabled.\") from None\n    except ContextCompactionFailed:\n        raise HTTPException(status_code=500, detail=\"Failed to compact thread context.\") from None\n    except LookupError:\n        raise HTTPException(status_code=404, detail=f\"Thread {thread_id} not found\") from None\n    except HTTPException:\n        raise\n    except Exception:\n        logger.exception(\"Failed to compact thread %s\", sanitize_log_param(thread_id))\n        raise HTTPException(status_code=500, detail=\"Failed to compact thread context.\") from None\n    return _thread_compact_response(result)\n\n\n# ---------------------------------------------------------------------------\n@router.get(\"/{thread_id}/state\", response_model=ThreadStateResponse)\n@require_permission(\"threads\", \"read\", owner_check=True)\nasync def get_thread_state(thread_id: ThreadId, request: Request) -> ThreadStateResponse:\n    \"\"\"Get the latest materialized graph state for a thread.\"\"\"\n    # Resolve through the thread's assistant so custom middleware channels","sourceCodeStart":1160,"sourceCodeEnd":1196,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/threads.py#L1160-L1196","documentation":"Error \"Context compaction is disabled.\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/threads.py:1178 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable context compaction in config.yaml (context.compaction.enabled=true) and restart the Gateway.","If compaction is intentionally disabled, no action is needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}