Repository navigation
Conversation
iscekic
left a comment
There was a problem hiding this comment.
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.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe 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: Files Reviewed (1 file)
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 SummaryThe 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 Assumptions: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Previous review (commit 0b046de)Status: 1 Issue Found | Recommendation: Merge after confirming the client paging restart Executive SummaryThe 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: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (7 files)
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 SummaryThe new Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (16 files)
Fix these issues in Kilo Cloud Previous review (commit 7dfe48c)Status: 7 Issues Found | Recommendation: Address before merge Executive SummaryA tab-page cursor without Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (27 files)
Fix these issues in Kilo Cloud Previous review (commit 0a9d718)Status: 8 Issues Found | Recommendation: Address before merge Executive SummaryThe paginated tab read model is tenant-scoped and internally consistent, but a tab-page cursor that omits Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (27 files)
Reviewed by deepseek-flash-latest · Input: 36.1K · Output: 4.2K · Cached: 243.7K Review guidance: REVIEW.md from base branch |
…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.
0a9d718 to
7dfe48c
Compare
|
Follow-up to the automated review in #issuecomment-6979883349 ( |
Summary
Verification
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.