chat: click-to-resume /chat sessions via Claude --resume

Clicking a session in the list loads its transcript (GET /chat/sessions/:id,
parsed from Claude's JSONL into display messages) and continues the actual Claude
session: a resumeSessionId is threaded chat handler -> send-claude-code -> sidecar
-> claude-manager, which passes --resume <uuid> (in-memory session mapping still
takes precedence for live turns). Parser verified against real transcripts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-24 10:11:58 +00:00
co-authored by Claude Opus 4.8
parent bea3d0a487
commit 9565cd9462
10 changed files with 158 additions and 16 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import { createRouter } from '../../create-router';
import { getClaudeSessionsCwd, listClaudeSessions } from './claude-sessions';
import { getClaudeSessionsCwd, listClaudeSessions, loadClaudeSession } from './claude-sessions';
export const chatRouter = createRouter();
@@ -10,3 +10,11 @@ chatRouter.get('/sessions', (ctx) => {
const sessions = listClaudeSessions(email, getClaudeSessionsCwd(email));
return ctx.json({ sessions });
});
// GET /chat/sessions/:id — one conversation's full transcript, parsed into display-ready messages.
chatRouter.get('/sessions/:id', (ctx) => {
const email = ctx.get('user').email;
const detail = loadClaudeSession(email, getClaudeSessionsCwd(email), ctx.req.param('id'));
if (!detail) return ctx.text('Not found', 404);
return ctx.json(detail);
});