{"record":{"id":"e62b4019afb01a5e","repo":"zylon-ai/private-gpt","slug":"overloaded-condensation-error","errorCode":"OVERLOADED_CONDENSATION_ERROR","errorMessage":"Condensation strategy timed out after {timeout_seconds} seconds","messagePattern":"Condensation strategy timed out after (.+?) seconds","errorType":"http","errorClass":"Errors.Overloaded","httpStatus":529,"severity":"error","filePath":"private_gpt/components/chat/processors/chat_history/memory/tldr_processor.py","lineNumber":195,"sourceCode":"\nasync def _apply_condensation_strategy(\n    chat_history: list[ChatMessage],\n    condense_strategy: BaseMemoryStrategy,\n    max_length: int,\n    timeout_seconds: int | None = None,\n    **kwargs: dict[str, Any],\n) -> list[ChatMessage]:\n    \"\"\"Apply the specified condensation strategy to chat history.\"\"\"\n    try:\n        coro = condense_strategy.get_memory(\n            chat_history=chat_history, max_length=max_length, **kwargs\n        )\n        if timeout_seconds is None:\n            return await coro\n\n        return await asyncio.wait_for(coro, timeout=timeout_seconds)\n    except TimeoutError as e:\n        raise Errors.Overloaded(\n            f\"Condensation strategy timed out after {timeout_seconds} seconds\",\n            event_code=Errors.Codes.OVERLOADED_CONDENSATION_ERROR,\n        ) from e\n","sourceCodeStart":177,"sourceCodeEnd":199,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/chat/processors/chat_history/memory/tldr_processor.py#L177-L199","documentation":"Wrapped as Errors.Overloaded with event_code OVERLOADED_CONDENSATION_ERROR when the condensation strategy's async get_memory() call does not finish within timeout_seconds (enforced via asyncio.wait_for). It signals the backend (typically an LLM summarization call) is too slow or saturated, not that the history is malformed.","triggerScenarios":"Calling the strategy wrapper with a finite timeout_seconds while condense_strategy.get_memory() (LLM-backed summarization) takes longer; a slow or overloaded LLM endpoint; a huge conversation being summarized in one call.","commonSituations":"Self-hosted LLM under load; network latency spikes; timeout_seconds set tighter than typical LLM latency; retry storms amplifying backend slowness.","solutions":["Increase timeout_seconds to comfortably exceed p99 LLM latency for summarization","Pass timeout_seconds=None to disable the timeout when condensation is trusted to finish","Reduce the history size fed to the summarizer (fewer messages = faster call)","Address backend saturation: more capacity, faster model, or load shedding upstream"],"exampleFix":"# before\nhistory = await apply_condense_strategy(\n    condense_strategy, chat_history, max_length,\n    timeout_seconds=5,\n)\n\n# after\nhistory = await apply_condense_strategy(\n    condense_strategy, chat_history, max_length,\n    timeout_seconds=120,\n)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    history = await apply_condense_strategy(strategy, chat_history, max_length, timeout_seconds=60)\nexcept Errors.Overloaded as e:\n    if e.event_code == Errors.Codes.OVERLOADED_CONDENSATION_ERROR:\n        history = await apply_condense_strategy(strategy, chat_history, max_length, timeout_seconds=180)\n    else:\n        raise","preventionTips":["Size timeout_seconds from measured p99 of the summarizer LLM","Shed load before condensation when the backend is saturated","Retry with backoff, not immediately, to avoid amplifying overload"],"tags":["timeout","condensation","overloaded","asyncio","llm"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}