fix(session): resolve ClaudeSession type errors — UUID cast and missing timestamp on restored messages
This commit is contained in:
parent
5a9f67fcb6
commit
0a51fc4b02
1 changed files with 2 additions and 1 deletions
|
|
@ -51,7 +51,7 @@
|
||||||
const state = await loadProjectAgentState(projectId);
|
const state = await loadProjectAgentState(projectId);
|
||||||
lastState = state;
|
lastState = state;
|
||||||
if (state?.last_session_id) {
|
if (state?.last_session_id) {
|
||||||
sessionId = state.last_session_id;
|
sessionId = state.last_session_id as ReturnType<typeof crypto.randomUUID>;
|
||||||
|
|
||||||
// Restore cached messages into the agent store
|
// Restore cached messages into the agent store
|
||||||
const records = await loadAgentMessages(projectId);
|
const records = await loadAgentMessages(projectId);
|
||||||
|
|
@ -92,6 +92,7 @@
|
||||||
type: r.message_type as AgentMessage['type'],
|
type: r.message_type as AgentMessage['type'],
|
||||||
content: JSON.parse(r.content),
|
content: JSON.parse(r.content),
|
||||||
parentId: r.parent_id ?? undefined,
|
parentId: r.parent_id ?? undefined,
|
||||||
|
timestamp: r.created_at ?? Date.now(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
appendAgentMessages(sid, messages);
|
appendAgentMessages(sid, messages);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue