getSessionTimeline() grouped/ordered by a bare `bucket` identifier, assuming SQLite would resolve it against the SELECT list's alias - it doesn't in this generated query, so every /sessions/:id page and /api/stats/sessions/:id/timeline request failed with "no such column: bucket". Fixed by reusing the actual bucket expression object in groupBy/orderBy instead of referencing it by name. Verified against a seeded session - previously every request, now correct bucketed data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W8WkFF5ppURBAB918593Eb