debug: add detailed error reporting for session detail serialization
Temporary debug commit — surfaces the actual exception when GET /ai-sessions/{id}
fails with 500, instead of generic "Internal server error" from middleware.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -645,9 +645,16 @@ async def get_session(
|
|||||||
confidence_score=step.confidence_at_step,
|
confidence_score=step.confidence_at_step,
|
||||||
))
|
))
|
||||||
|
|
||||||
detail = AISessionDetail.model_validate(session)
|
try:
|
||||||
detail.steps = step_responses
|
detail = AISessionDetail.model_validate(session)
|
||||||
return detail
|
detail.steps = step_responses
|
||||||
|
return detail
|
||||||
|
except Exception as e:
|
||||||
|
logger.exception("Failed to serialize session %s: %s", session_id, e)
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
|
detail=f"Session serialization error: {type(e).__name__}: {str(e)[:200]}",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# ── Documentation ──
|
# ── Documentation ──
|
||||||
|
|||||||
Reference in New Issue
Block a user