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
+6 -2
View File
@@ -170,8 +170,12 @@ export async function spawnClaudeStreaming(
const subModel = params.model?.split('/')[1];
if (subModel) claudeArgs.push('--model', subModel);
if (existingSession) {
claudeArgs.push('--resume', existingSession);
// Resume: an in-memory mapping (subsequent turns of a live chat) takes precedence; otherwise a
// caller-supplied session uuid (reopening a session from the /chat list) resumes Claude's transcript.
const resumeId = existingSession ?? params.resumeSessionId;
if (resumeId) {
claudeArgs.push('--resume', resumeId);
if (!existingSession) setClaudeSession(sessionKey, resumeId);
}
const spawnCmd = isSuperAdmin ? claudeArgs : [...buildSandboxArgs(email), ...claudeArgs];
+1
View File
@@ -73,6 +73,7 @@ export type ClaudeSpawnStreamingParams = {
cwd?: string;
model?: string;
role?: string;
resumeSessionId?: string; // resume this Claude session uuid (from the /chat session list)
};
export type ClaudeCodeResult = {