Skip to content

feat(cloud-agent): paginate workspace chat tabs - #11557

Open
eshurakov wants to merge 6 commits into
kilo/long-crest-fnofrom
kilo/lean-canvas-mwa
Open

eshurakov wants to merge 6 commits into
kilo/long-crest-fnofrom
kilo/lean-canvas-mwa

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Return chat counts and navigation IDs in sidebar summaries instead of chat lists.
  • Show up to 50 open chats in saved order for the selected workspace. Keep the active chat visible and move the remaining open tabs under More tabs.
  • Load closed tabs on demand, 20 at a time, newest closure first. Paging does not close chats or limit how many chats a workspace can hold.

Verification

  • Manual browser verification: seeded a local workspace with 76 synthetic chats, but Chromium navigation timed out before the workspace loaded.

Visual Changes

No screenshots available because the local browser check did not reach the workspace.

Reviewer Notes

Stacked on #11225. The web typecheck and 331 focused tests passed. The lint process was terminated before it finished.

@eshurakov
eshurakov added this pull request to stack #11558 November 18, 2026 13:08

@iscekic iscekic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bot: Automated code review for this pull request, requested by @eshurakov.

This PR moves workspace chats out of the sidebar summary and into separate paged reads: workspaceSummaries/listWorkspaces now return counts and navigation IDs instead of openChats/closedChats, cliSessionsV2.workspaceChats gains tabState and sessionId filters plus a positional cursor, and the chat header renders at most 50 open tabs in saved order with the active chat kept visible and the rest under More tabs. Closed tabs load 20 at a time when the Sessions menu opens.

What I checked: the new SQL in apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts (membership scoping, the closed/open position ordering against closed_session_ids/tab_order, the count lateral, and that workspace rows with no visible chat are still dropped by the inner root join); the client paging in hooks/useWorkspaceChats.ts including the current-session fallback that keeps a deep-linked chat visible and routes a closed one into the reopen path; the tab cap and overflow logic in CloudAgentWorkspaceTabs.tsx; the reconciliation flow in hooks/useClosedWorktreeChatTabs.ts; and the live-update invalidation. Scoping is still per user and organization, the new inputs are Zod-bounded and parameterized, and the removed openChats/closedChats fields have no remaining consumers in this repository. I could not run the suites, so nothing here is a claim about test results.

Act first on the reconciliation change in useClosedWorktreeChatTabs.ts: the pending tab action is now dropped even when the follow-up refetch fails, so a close the server accepted can flip back to an open tab silently, and the refetch is no longer serialized with the next tab write on the same worktree. Also delete the now-unused patchWorkspaceChatTabs with its tests, stabilize the new paging values before they reach the sidebar context memo, and add the missing Sessions-menu test for the on-demand load.

E2E: not run.

No end-to-end check was run: this checkout has no installed dependencies and the job does not install any, so the changed tab paging (workspaceChats tabState open/closed, More tabs, Sessions load-on-demand) was reviewed by reading the code, the SQL in workspace-read-model-queries.ts, the tab-state writers in workspace-tab-state.ts, and the tests, not by executing them. The PR's own manual browser verification is also unchecked in its description.

Every remark is attached to the changed line where GitHub accepts one.

This service never pushes, rebases, forces, closes, labels, or merges, and it posts nothing else on this pull request.

@kilo-code-bot

kilo-code-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The only incremental change extends the closed-tab CONFLICT regression to load two pages before the conflict, and its new assertions now distinguish rebuilt page parameters from replayed stale cursors.

Assumptions: [INFERENCE] Tests were not run in this sandbox; verification is by reading the extended test and the unchanged useWorkspaceChats restart logic at HEAD 1a903cd3af.

Files Reviewed (1 file)
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts
Previous Review Summaries (6 snapshots, latest commit e9118ac)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit e9118ac)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The new CONFLICT-restart regression covers only a single loaded closed page, so it proves page-one recovery but not that later loaded pages drop their stale tabOrderVersion; the restart logic itself is unchanged from the previously reviewed commit.

Assumptions: [INFERENCE] React Query 5.104.3 infinite-query refetch() internals could not be inspected because dependencies are not installed in this sandbox, so whether stored page params are rebuilt or replayed for pages 2..N is unproven, and no tests were run.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts 283 The restart test loads only one closed page before the CONFLICT, so it cannot detect stale page params being replayed for pages 2..N.
Files Reviewed (1 file)
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 0b046de)

Status: 1 Issue Found | Recommendation: Merge after confirming the client paging restart

Executive Summary

The stale-cursor guard closes the prior duplicate/skip paging defect server-side: every close, reopen, and reorder changes the hashed tab-order version, so a stale cursor now fails with CONFLICT instead of replaying or skipping chats, and the MCP catalog documents the new cursor contract. The remaining gap is that nothing verifies the client half of that recovery.

Assumptions: [INFERENCE] the React Query 5.104.3 semantics for refetch() on an infinite query (whether page params are rebuilt from getNextPageParam or replayed from cache) could not be verified here because dependencies are not installed in this sandbox, and no tests were run.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts 44 The CONFLICT restart calls refetch() and has no test proving the stale tabOrderVersion is dropped; if the cached page params are replayed, every page after the first keeps returning CONFLICT and the list stays in its error state.
Files Reviewed (7 files)
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts - 1 issue
  • apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-list-workspaces.test.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-router.ts - no issues
  • services/kilo-mcp/catalog.json - generated, no issues

Previous review (commit 206b708)

The review did not run because the selected model is no longer available.

Choose another model in Kilo Code review settings: https://app.kilo.ai/code-reviews

Previous review (commit 206b708)

Status: 3 Issues Found | Recommendation: Address before merge

Executive Summary

The new cursor.position requirement closes the page-1 replay, but keyset paging still leads with the mutable tab-order arrays, so paging can repeat or drop a chat when a tab is closed or reopened between requests; the rewritten tab reconciliation and the new status-event workspace fallback otherwise check out.

Assumptions: [INFERENCE] short-form session.status.updated events carry no parent-session marker, so the new cliSessionsV2.get fallback cannot skip child sessions before fetching; the extra read is bounded by the 5 s staleTime and a single in-flight fetch per session.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts 441 The keyset comparison leads with array_position into closed_session_ids/tab_order. Close prepends the id and reopen removes it, so every later position shifts between page requests: the boundary row is returned twice after a close and can be skipped after a reopen, producing duplicate or missing chats while the Sessions list or More tabs pages. Order by the immutable created_at/session_id pair and keep position for display order, or snapshot the id order in the cursor.

SUGGESTION

File Line Issue
apps/web/src/routers/cli-sessions-v2-router.ts 604 The conditional "position required when tabState is set" rule cannot be expressed in JSON Schema, so services/kilo-mcp/catalog.json still requires only createdAt/sessionId. An MCP agent that builds the cursor from the published schema gets BAD_REQUEST on its second page; document the requirement in the description the catalog generator emits.
apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts 256 refreshTabs invalidates the workspace chat infinite query on every workspace.updated and root session.created with no coalescing, refetching every loaded page per event while the summary refresh above is already debounced. Route tab invalidation through the same coordinator.
Files Reviewed (16 files)
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.tsx - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts - 1 issue
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/worktree-chat-tabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/worktree-chat-tabs.ts - no issues
  • apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts - 1 issue
  • apps/web/src/routers/cli-sessions-v2-list-workspaces.test.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-router.ts - 1 issue
  • services/kilo-mcp/catalog.json - generated, no issues

Fix these issues in Kilo Cloud

Previous review (commit 7dfe48c)

Status: 7 Issues Found | Recommendation: Address before merge

Executive Summary

A tab-page cursor without position silently replays page 1, and the narrowed workspaceHasNavigationSession matcher can no longer resolve short-form status events for chats outside a workspace's navigation set.

Assumptions: [INFERENCE] the live-update gap depends on short-form session.status.updated root events broadcast by UserConnectionDO in services/session-ingest, which carry no worktree id and are not paired with workspace.updated. The SidebarLayoutContext memo dependency defect from the previous review is still present at CloudSidebarLayout.tsx:1155 but is already covered by an active inline comment, so it is not repeated here. Inline review comments were rejected by the sandbox (Permission denied: shell) on both the atomic call and the batched retry, so every finding is recorded in this summary.

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 5
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/routers/cli-sessions-v2-router.ts 599 cursor.position is optional, but every tabState row has position >= 1, so (position, created_at, session_id) > (cursor.position ?? 0, …) in readWorkspaceChatPage matches every row. A cursor carrying only createdAt/sessionId - still the required shape in services/kilo-mcp/catalog.json - silently returns page 1 again with a fresh nextCursor, so an agent paging through the catalog loops forever. Make position required when tabState is set (and regenerate the catalog), or fall back to comparing only created_at/session_id when it is absent.
apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts 273 workspaceHasNavigationSession now only matches latestSessionId, latestOpenSessionId, rootSessionId, or status.sessionId; short-form session.status.updated events carry no worktree id, so they resolve the workspace through this matcher. status.sessionId is only the highest-priority status session, so a status change on any other root chat in the worktree finds no workspace and schedules no summary refresh, leaving the sidebar row status stale until something else refetches.

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts 390 refreshTabs invalidates the tab queries on every workspace.updated and every root session.created with no debounce. Invalidating an active infinite query refetches all of its loaded pages, so one event costs several workspaceChats round trips on top of the already debounced summary refresh scheduled just above.
apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts 442 Keyset paging uses the mutable tab_order/closed_session_ids index as its leading sort key. Closing, reopening, or reordering a tab between page requests shifts every later position, so paging can skip or repeat chats; a chat also leaves the open sequence once it is closed. Order by the stable created_at/session_id pair and use position only for display order.
apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx 157 The reveal/focus effect (line 220) keys on visibleChatSessions.length, which stays pinned at 50 while tabs overflow. Closing a visible, non-active tab therefore skips the effect, so revealActiveTab() does not run and the restoreTabFocusRef set by the close handler is never consumed - focus falls to document.body and the stale flag can steal focus on a later run.
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts 72 currentInOpen is undefined until the open page resolves, and !undefined is true, so the single-chat lookup fires in parallel with the open page on every cold mount. While it is unknown, openChats contains only the active chat, so the strip briefly renders a single tab before the page arrives. Gate on the open query having settled rather than treating "unknown" as "not open".
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts 81 An injected active chat that is closed is pushed into closedChats but never into closedHistoryIds. CloudSidebarLayout admits a closed chat only when `closedHistoryIds.has(id)
Files Reviewed (27 files)
  • .specs/cloud-agent-session.md - no issues
  • apps/web/src/components/cloud-agent-next/ChatSidebar.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx - 1 issue
  • apps/web/src/components/cloud-agent-next/CloudChatPage.tsx - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.tsx - covered by active inline comment
  • apps/web/src/components/cloud-agent-next/hooks/sidebar-workspace-model.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.ts - covered by active inline comments
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.live.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/workspace-summary-test-fixtures.ts - no issues
  • apps/web/src/components/cloud-agent-next/server/PrefetchedCloudSidebar.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/workspace-session-cache.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/workspace-session-cache.ts - no issues
  • apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts - 1 issue
  • apps/web/src/lib/cloud-agent/workspace-read-model.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-list-workspaces.test.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-router.ts - 1 issue
  • services/kilo-mcp/catalog.json - generated, no issues

Fix these issues in Kilo Cloud

Previous review (commit 0a9d718)

Status: 8 Issues Found | Recommendation: Address before merge

Executive Summary

The paginated tab read model is tenant-scoped and internally consistent, but a tab-page cursor that omits position silently replays page 1, and the narrowed workspaceHasNavigationSession matcher can no longer resolve workspace refreshes for chats outside a workspace's navigation set.

Assumptions: [INFERENCE] the live-update gap depends on short-form session.status.updated root events broadcast by UserConnectionDO in services/session-ingest, which carry no worktree id and are not paired with workspace.updated. No in-repo reader of the removed openChats/closedChats summary fields was found, so external tRPC or MCP consumers remain unverified. Inline review comments could not be published in this session because the sandbox rejected every write payload form; all findings are recorded here instead.

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 6
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/routers/cli-sessions-v2-router.ts 599 cursor.position is optional, but every tabState row has position >= 1, so (position, created_at, session_id) > (cursor.position ?? 0, …) matches every row. A cursor carrying only createdAt/sessionId (the shape the generated MCP schema still requires) silently returns page 1 again with a fresh nextCursor. Make position required when tabState is set, or fall back to comparing only created_at/session_id when it is absent.
apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts 273 workspaceHasNavigationSession now only matches latestSessionId, latestOpenSessionId, rootSessionId, or status.sessionId. Short-form session.status.updated events carry no worktree id (and session.deleted's worktreeId is optional), so both resolve the workspace through this matcher. For any other root chat in the worktree the lookup finds nothing and no summary refresh is scheduled - and those short-form root status events are exactly the ones without a workspace.updated companion, so a workspace can keep a stale status until something else refetches.

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts 390 refreshTabs invalidates the tab queries on every workspace.updated with no debounce. Invalidating an active infinite query refetches all of its loaded pages, so one root session event costs several workspaceChats round trips on top of the already debounced summary refresh scheduled just above.
apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts 442 Keyset paging uses the mutable tab_order/closed_session_ids index as its leading sort key. Closing or reordering a tab between page requests shifts every later position, so paging can skip or repeat chats. Order by the stable created_at/session_id pair and use position only for display order.
apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx 225 The reveal/focus effect keys on visibleChatSessions.length, which stays pinned at 50 while tabs overflow. Closing a visible, non-active tab therefore skips the effect, so revealActiveTab() does not run and restoreTabFocusRef is never consumed - focus falls to document.body instead of a neighbouring tab.
apps/web/src/components/cloud-agent-next/CloudSidebarLayout.tsx 1129 The context memo now depends on openChatPages, closedChatPages, and requestClosedHistory, which useWorkspaceChats rebuilds on every render (inline object literals and an inline arrow). The provider value is therefore new on every parent render, re-rendering CloudChatPage and MobileSidebarToggle even when nothing changed.
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts 72 currentInOpen is undefined until the open page resolves, and !undefined is true, so the single-chat lookup fires in parallel with the open page on every cold mount. While it is unknown, openChats contains only the active chat, so the strip briefly renders a single tab before the page arrives. Gate on the open query having settled rather than treating "unknown" as "not open".
apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts 78 An injected active chat that is closed is pushed into closedChats but never into closedHistoryIds. CloudSidebarLayout admits a closed chat only when `closedHistoryIds.has(id)
Files Reviewed (27 files)
  • .specs/cloud-agent-session.md - no issues
  • apps/web/src/components/cloud-agent-next/ChatSidebar.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx - 1 issue
  • apps/web/src/components/cloud-agent-next/CloudChatPage.tsx - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/CloudSidebarLayout.tsx - 1 issue
  • apps/web/src/components/cloud-agent-next/hooks/sidebar-workspace-model.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useClosedWorktreeChatTabs.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarLiveUpdates.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.live.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceChats.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/useWorkspaceSummaries.ts - no issues
  • apps/web/src/components/cloud-agent-next/hooks/workspace-summary-test-fixtures.ts - no issues
  • apps/web/src/components/cloud-agent-next/server/PrefetchedCloudSidebar.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/workspace-session-cache.test.ts - no issues
  • apps/web/src/components/cloud-agent-next/workspace-session-cache.ts - no issues
  • apps/web/src/lib/cloud-agent/workspace-read-model-queries.ts - 1 issue
  • apps/web/src/lib/cloud-agent/workspace-read-model.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-list-workspaces.test.ts - no issues
  • apps/web/src/routers/cli-sessions-v2-router.ts - 1 issue
  • services/kilo-mcp/catalog.json - generated, no issues

Reviewed by deepseek-flash-latest · Input: 36.1K · Output: 4.2K · Cached: 243.7K

Review guidance: REVIEW.md from base branch kilo/long-crest-fno

eshurakov and others added 2 commits November 18, 2026 14:29
…odel optimization

This change refactors how workspace chat tabs are loaded and displayed, moving from a monolithic hydration model to a paginated, on-demand approach. This improves initial load performance and scalability for worktrees with many sessions.

Key changes:
- Refactored `workspace-read-model` to return summary counts (open/closed) instead of full chat lists, significantly reducing payload size for the workspace list.
- Implemented paginated fetching for open and closed chat tabs using `useInfiniteQuery`.
- Introduced a "More tabs" dropdown in the sidebar to handle overflow when the number of open chats exceeds the visible limit (50).
- Optimized the sidebar workspace navigation to use a lightweight representation of the latest session.
- Updated the synchronization logic to invalidate specific workspace chat queries when session events occur, ensuring real-time updates without full workspace refreshes.
- Updated API schemas to support `tabState` filtering and improved cursor-based pagination.
@eshurakov
eshurakov force-pushed the kilo/lean-canvas-mwa branch from 0a9d718 to 7dfe48c Compare November 18, 2026 14:29
@eshurakov

Copy link
Copy Markdown
Contributor Author

Follow-up to the automated review in #issuecomment-6979883349 (206b708250): tab paging rejects cursors without position; short root status events can look up off-page chats; deletions use the worktree ID or scoped cached membership. The follow-up also stabilizes paging controls, avoids redundant cold-load lookups, includes the active closed chat in Sessions, and restores focus when the visible tab IDs change at the cap. Focused web and PostgreSQL tests passed. I kept positional sorting because the spec requires saved open-tab order and newest closure first; concurrent order changes can still shift a cursor. I left extra invalidation debouncing as a performance follow-up: in-flight refetches already coalesce, but separate events can still refetch loaded pages.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants