Bug
A single session with a malformed time_archived value in the SQLite database causes the entire session list API to fail with HTTP 400. This makes CodeNomad display zero sessions with no error indication.
Root Cause
The OpenCode session list response is a paginated array. When serializing, the schema for SessionInfo.time.archived expects DateTime.Utc format, but the DB stores a raw millisecond timestamp:
1781132189927 (milliseconds since epoch)
When the encoder reaches the session with this bad value, serialization fails:
Expected DateTime.Utc, got 1781132189927
at ["items"][37]["time"]["archived"]
Impact
Any session list request with a page size larger than the index of the corrupted session fails with HTTP 400. CodeNomad requests 50-200 sessions per page — if the bad session is within that range, ZERO sessions return. The UI never gets data and shows the empty "Start a conversation" state.
Reproduction
- Set any session's
time_archived to a raw millisecond number in the shared SQLite DB
- Open a workspace with that session in CodeNomad
- Session list returns 0 items (HTTP 400 swallowed silently)
Fix
Two fixes needed:
- Data cleanup: Set the bad
time_archived to NULL
- Resilience: The API should skip or gracefully handle individual session serialization failures rather than failing the entire response
Environment
- CodeNomad v0.17.0 (Tauri) and v0.17.1 (web)
- OpenCode binary v1.15.13
Bug
A single session with a malformed
time_archivedvalue in the SQLite database causes the entire session list API to fail with HTTP 400. This makes CodeNomad display zero sessions with no error indication.Root Cause
The OpenCode session list response is a paginated array. When serializing, the schema for
SessionInfo.time.archivedexpectsDateTime.Utcformat, but the DB stores a raw millisecond timestamp:When the encoder reaches the session with this bad value, serialization fails:
Impact
Any session list request with a page size larger than the index of the corrupted session fails with HTTP 400. CodeNomad requests 50-200 sessions per page — if the bad session is within that range, ZERO sessions return. The UI never gets data and shows the empty "Start a conversation" state.
Reproduction
time_archivedto a raw millisecond number in the shared SQLite DBFix
Two fixes needed:
time_archivedto NULLEnvironment