mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
Add an experimental multi-project mode to the Agent Manager sidebar behind kilo-code.new.experimental.multiProject (default off). A persistent project registry catalogs additional git repositories across restarts, while the workspace repository stays the pinned default project. Extension: - Immutable per-project contexts own all repository-bound services (state, worktrees, setup scripts, stale tracking, pollers) with generation-based invalidation and fail-closed trust checks. - ProjectContexts manage activation, expansion, and fast switching; session routes resolve directories exactly per project via a shared route service. - pushProjectSessions caches each project's session list and re-posts it on fresh skips; session.created/updated/deleted SSE events upsert into the owning project's cache so externally created sessions appear immediately. - Selection restore persists the active target per project and falls back to the local context silently when the remembered target is gone. - Worktree lifecycle handlers extracted into provider-lifecycle.ts with an explicit deps object instead of ambient project scope. - initializeState and onRequestState always refresh sessions: with zero managed sessions the listing never ran and the sidebar skeletons forever. - Log instead of dropping silently when a state-gated message is not ready. Webview: - ProjectList accordion with per-project sidebar body, search, actions, and default-branch dialog; selecting a project header restores its target. - Local session tabs and terminal contexts are bucketed per project so open tabs never leak across projects sharing the LOCAL context. - The active project's session list overlays the live session store so new sessions show without waiting for a backend re-list. - SectionHeader requires a DragDropProvider ancestor; the multi-project body now provides one (its absence crashed the whole webview render). - SidebarBody and TabBar extracted out of AgentManagerApp (3215 to 2748 lines); AgentManagerProvider down to 1887 with caps lowered accordingly. Also includes the config write revision bindings and per-project indexing consent groundwork that rode along on this branch.