batch4: chats-in-sessions, force-send, /compact, right-rail file browser
Session 1:N Chat data model with backfill. Workspace switches to client-side multi-tab pane management. Right-rail file browser with float-over viewer and click-drag line selection replaces FileBrowserPane. Adds /compact streaming summarizer (respects compact markers in context builder), force-send (cancels in-flight, persists partial as 'cancelled', awaits cancellation completion via deferred Promise + 5s timeout), message queue, stop generation, chat auto-rename, session archive/unarchive with Closed Sessions section on repo landing page. CHECK constraints on sessions.status, messages.role, messages.status with KEEP IN SYNC comments tying to MESSAGE_ROLES / MESSAGE_STATUSES const arrays. Deletes dead pane routes/hook and the api.panes.* client block. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ export function registerWebSocket(
|
||||
}
|
||||
|
||||
const messages = await sql<Message[]>`
|
||||
SELECT id, session_id, role, content, tool_calls, tool_results, status, last_seq,
|
||||
SELECT id, session_id, chat_id, role, content, kind, tool_calls, tool_results, status, last_seq,
|
||||
tokens_used, ctx_used, ctx_max, started_at, finished_at, created_at
|
||||
FROM messages
|
||||
WHERE session_id = ${sessionId}
|
||||
@@ -44,15 +44,8 @@ export function registerWebSocket(
|
||||
}
|
||||
);
|
||||
|
||||
app.get('/api/ws/user', { websocket: true }, async (socket, req) => {
|
||||
const user = req.user;
|
||||
// defensive: global auth hook (auth.ts) already rejects unauthenticated /api/* requests;
|
||||
// keep the explicit check here to close the WS cleanly (1008) rather than throwing.
|
||||
if (!user) {
|
||||
socket.close(1008, 'unauthenticated');
|
||||
return;
|
||||
}
|
||||
// No snapshot — user channel is purely live updates.
|
||||
app.get('/api/ws/user', { websocket: true }, async (socket) => {
|
||||
const user = 'default';
|
||||
const unsubscribe = broker.subscribeUser(user, (frame) => {
|
||||
if (socket.readyState !== socket.OPEN) return;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user