odysseus-dev/odysseus · error · HTTPException
Compaction failed
Error message
Compaction failed
What it means
A 500 wrap-up in compact_session: the summary LLM call (llm_call_async) raised or timed out (60s), so compaction aborted and the original history is untouched. The exception detail is logged, and the client gets this fixed message.
Solutions
- Retry compaction; check server logs for the model error.
- Verify the compaction model endpoint is reachable.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: 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.
Common situations: See trigger scenarios.
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/767d74f5cb69e0a6.
Report an issue: GitHub.
Appendix: source
Thrown at routes/session_routes.py:1022
"{n}", str(prior_compactions + 1)
)
convo_text = "\n".join(
f"{_message_role(m).upper()}: {_message_text(m)[:2000]}"
for m in older
)
try:
summary = await llm_call_async(
url,
model,
[{"role": "system", "content": prompt}, {"role": "user", "content": convo_text}],
temperature=0.2,
max_tokens=1024,
headers=headers,
timeout=60,
)
except Exception as e:
logger.error("Manual compaction failed: %s", e)
raise HTTPException(500, "Compaction failed")
summary_msg = ChatMessage(
role="system",
content=f"[Conversation summary]\n{summary}",
metadata={
"compacted": True,
"summarized_count": len(older),
"timestamp": utcnow_naive().isoformat(),
},
)
new_history = [summary_msg] + recent
if not session_manager.replace_messages(session_id, new_history):
raise HTTPException(500, "Failed to save compacted history")
return {
"ok": True,
"summarized": len(older),
"kept": len(recent),View on GitHub (pinned to f9235ebbf1)