fix(chat): drop legacy GET /api/chats/{id}/artist caller (#1767)
Merged
AH
6mo ago+135+135+012345678901234567890123456789-77-77-01234567890123456789
Summary by cubic
Stop calling the legacy GET /api/chats/{id}/artist endpoint (which caused 404s on workflow chats). Resolve the chat’s artist from GET /api/sessions/{sessionId} and keep the selected artist in sync.
-
Bug Fixes
- Added
useArtistFromChatto fetch the session and selectartistIdwith a user-scoped query; removeduseArtistFromRoom. - Updated
components/VercelChat/chat.tsxto passsessionId, use the new hook, and memoize onsessionId. - Added
lib/sessions/getSessionById.tswithzod-validated response and better error handling; removedlib/chats/getChatArtist.ts. - Dropped the conversations-cache fallback and
/chat/:iddeep-link handling; all chats use/sessions/{sessionId}/chats/{chatId}.
- Added
-
Refactors
- Extracted shared
lib/api/safeJsonParse.tsand used it ingetSessionById.
- Extracted shared
Summary by CodeRabbit
-
Improvements
- Chat artist management now properly integrated with session data for improved synchronization
-
Refactor
- Migrated from room-based to session-based artist selection
- Session ID now properly tracked throughout the chat interface