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:
@@ -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];
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user