feat: persist orchestrator sessions + user service + docs update
- Orchestrator now saves turns to session store so history survives page refresh - UI session_id updated from job result; history controls attached to agent turns - Cortex migrated from system service to systemd user service (no more sudo) - Update README.md and CLAUDE.md with correct service commands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -651,7 +651,8 @@
|
||||
|
||||
activeController = new AbortController();
|
||||
|
||||
addMessage('user', text);
|
||||
currentHistory.push({ role: 'user', content: text });
|
||||
const userMsgDiv = addMessage('user', text);
|
||||
scrollToBottom();
|
||||
|
||||
const thinkingDiv = addMessage('assistant thinking', '⚡ working…');
|
||||
@@ -701,8 +702,20 @@
|
||||
|
||||
if (job.status === 'error') throw new Error(job.error || 'Orchestrator failed');
|
||||
|
||||
// Update session so this turn is part of the resumable history
|
||||
if (job.session_id) {
|
||||
sessionId = job.session_id;
|
||||
sessionEl.textContent = `session: ${sessionId}`;
|
||||
}
|
||||
|
||||
const userHistIdx = currentHistory.length - 1; // pushed before fetch
|
||||
attachHistoryControls(userMsgDiv, userHistIdx);
|
||||
|
||||
thinkingDiv.className = 'message assistant';
|
||||
setMessageText(thinkingDiv, 'assistant', job.response || '(no response)');
|
||||
const assistHistIdx = currentHistory.length;
|
||||
currentHistory.push({ role: 'assistant', content: job.response || '' });
|
||||
attachHistoryControls(thinkingDiv, assistHistIdx);
|
||||
|
||||
const n = job.tool_calls?.length || 0;
|
||||
if (n) {
|
||||
|
||||
Reference in New Issue
Block a user