feat(chatd): persist last_error on chats table (#22436)

Adds a nullable `last_error` column to the `chats` table so error
reasons survive page reloads.

**Backend:**
- Migration adds `last_error TEXT` (nullable) to chats
- `UpdateChatStatus` writes the error reason when status transitions to
`error`, clears it (NULL) on recovery
- `convertChat` maps `sql.NullString` to `*string` in the SDK

**Frontend:**
- Sidebar falls back to `chat.last_error` when no stream error reason is
cached
- Chat detail page does the same for `persistedErrorReason`
- Fixtures updated for new required field
This commit is contained in:
Kyle Carberry
2026-02-28 12:27:26 -05:00
committed by GitHub
parent d412972cd5
commit 0ad2f9ecd7
16 changed files with 134 additions and 38 deletions
+2 -1
View File
@@ -1274,7 +1274,8 @@ CREATE TABLE chats (
parent_chat_id uuid,
root_chat_id uuid,
last_model_config_id uuid NOT NULL,
archived boolean DEFAULT false NOT NULL
archived boolean DEFAULT false NOT NULL,
last_error text
);
CREATE TABLE connection_logs (