feat(chat): add /sessions/[sid]/chats/[cid] route + session-scoped loader
Merged
AR
6mo ago+55+55+01234567890123456789-43-43-01234567890123456789
Adds the canonical workflow URL /sessions/{sessionId}/chats/{chatId} and points the message loader at the matching session-scoped api endpoint.
- New route
app/sessions/[sessionId]/chats/[chatId]/page.tsxmounts<Chat id={chatId} sessionId={sessionId} />. useMessageLoadertakes(sessionId, chatId, ...)and fetches fromGET /api/sessions/{sid}/chats/{cid}; legacymemoriesfetcher deleted.- Skips when either id is missing — the legacy
/chat/{roomId}route still renders, just with an empty transcript (no fallback to memories).
The sidebar PR (chat#1756) emits canonical URLs that this route receives. Merge order: chat#1756 → chat#1752 (back-to-back; sidebar links 404 between them).
silentlyUpdateUrl rewrite + HomePage refactor live in a follow-up PR.
Test plan
- On a Vercel preview, navigate directly to
/sessions/{sid}/chats/{cid}for a workflow chat → messages load → reload preserves them. - Visit a sidebar row (after chat#1756 lands) → arrives at the same route → messages render.
- Legacy
/chat/{roomId}still resolves but shows an empty transcript.