{"record":{"id":"767d74f5cb69e0a6","repo":"odysseus-dev/odysseus","slug":"compaction-failed","errorCode":null,"errorMessage":"Compaction failed","messagePattern":"Compaction failed","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/session_routes.py","lineNumber":1022,"sourceCode":"            \"{n}\", str(prior_compactions + 1)\n        )\n        convo_text = \"\\n\".join(\n            f\"{_message_role(m).upper()}: {_message_text(m)[:2000]}\"\n            for m in older\n        )\n        try:\n            summary = await llm_call_async(\n                url,\n                model,\n                [{\"role\": \"system\", \"content\": prompt}, {\"role\": \"user\", \"content\": convo_text}],\n                temperature=0.2,\n                max_tokens=1024,\n                headers=headers,\n                timeout=60,\n            )\n        except Exception as e:\n            logger.error(\"Manual compaction failed: %s\", e)\n            raise HTTPException(500, \"Compaction failed\")\n\n        summary_msg = ChatMessage(\n            role=\"system\",\n            content=f\"[Conversation summary]\\n{summary}\",\n            metadata={\n                \"compacted\": True,\n                \"summarized_count\": len(older),\n                \"timestamp\": utcnow_naive().isoformat(),\n            },\n        )\n        new_history = [summary_msg] + recent\n        if not session_manager.replace_messages(session_id, new_history):\n            raise HTTPException(500, \"Failed to save compacted history\")\n\n        return {\n            \"ok\": True,\n            \"summarized\": len(older),\n            \"kept\": len(recent),","sourceCodeStart":1004,"sourceCodeEnd":1040,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/session_routes.py#L1004-L1040","documentation":"Error \"Compaction failed\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Retry compaction; check server logs for the model error.","Verify the compaction model endpoint is reachable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}