Load long threads as a bounded window, reconnect when the socket drops

Full snapshots of long threads exceeded the server's WebSocket message
limit (close 1009), which killed the shared socket and every thread on it.
Subscribe with acceptBoundedSnapshot like the web client, page older turns
over the history endpoint, and reconnect with backoff, resubscribing
watched threads, whenever the socket closes.
This commit is contained in:
Callum Alpass committed 2026-11-02 17:19:22 +11:00
1 parent cea1409f40
commit 4f42407099
3 files changed
+134 -19

No files matched your search

+8 -1
View File
@@ -175,7 +175,14 @@ export function App(props: { readonly session: T3Session; readonly attachThreadI
return { needs, active };
}, [shell.snapshot]);
const status = shell.status.type === "error" ? `error: ${shell.status.message}` : shell.status.type === "connecting" ? "connecting…" : (shell.serverUrl ?? "");
const status =
shell.status.type === "error"
? `error: ${shell.status.message}`
: shell.status.type === "connecting"
? "connecting…"
: shell.status.type === "reconnecting"
? "reconnecting…"
: (shell.serverUrl ?? "");
const listWidth = attachThreadId ? 0 : Math.min(46, Math.max(28, Math.floor(width * 0.3)));
const subtitle = threadShell
? [threadShell.modelSelection.model === "default" ? "" : threadShell.modelSelection.model, threadShell.branch, relativeTime(lastActivity(threadShell))].filter(Boolean).join(" · ")