diff --git a/apps/server/src/persistenceService.test.ts b/apps/server/src/persistenceService.test.ts index f08b3cb317..2db46503cc 100644 --- a/apps/server/src/persistenceService.test.ts +++ b/apps/server/src/persistenceService.test.ts @@ -125,9 +125,11 @@ describe("PersistenceService", () => { const catchUp = service.catchUp({ afterSeq: 0 }); expect(catchUp.events.length).toBeGreaterThan(0); - expect(catchUp.events.every((event, index, events) => event.seq === events[index]?.seq)).toBe( - true, - ); + expect( + catchUp.events.every( + (event, index, events) => index === 0 || event.seq > events[index - 1]!.seq, + ), + ).toBe(true); expect(catchUp.events.some((event) => event.eventType === "project.upsert")).toBe(true); expect(catchUp.events.some((event) => event.eventType === "thread.upsert")).toBe(true); expect(catchUp.events.some((event) => event.eventType === "message.upsert")).toBe(true); diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index 434e7cd266..21113658fc 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -120,7 +120,6 @@ export default function BranchToolbar({ if (sessionId && worktreePath !== activeWorktreePath) { void api?.providers.stopSession({ sessionId }).catch(() => undefined); } - void api?.threads.updateBranch({ threadId: activeThreadId, branch, worktreePath }).catch(() => undefined); dispatch({ type: "SET_THREAD_BRANCH", threadId: activeThreadId, branch, worktreePath }); }; diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index e3afaacb93..63e869f75d 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -782,6 +782,9 @@ export default function ChatView({ threadId }: ChatViewProps) { .catch(() => undefined); }, [activeThread?.id, activeThread?.branch, activeThread?.worktreePath, api]); + const terminalIdsKey = JSON.stringify(activeThread?.terminalIds ?? null); + const terminalGroupsKey = JSON.stringify(activeThread?.terminalGroups ?? null); + useEffect(() => { if (!api || !activeThread) return; void api.threads @@ -795,13 +798,14 @@ export default function ChatView({ threadId }: ChatViewProps) { activeTerminalGroupId: activeThread.activeTerminalGroupId, }) .catch(() => undefined); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ activeThread?.id, activeThread?.terminalOpen, activeThread?.terminalHeight, - activeThread?.terminalIds, + terminalIdsKey, activeThread?.activeTerminalId, - activeThread?.terminalGroups, + terminalGroupsKey, activeThread?.activeTerminalGroupId, api, ]);