Files
kilocode/packages/kilo-vscode/tests/unit/config-scope.test.ts
T
marius-kilocode 46b7e55f8d feat(vscode): multi-project Agent Manager with per-project state, sessions, and lifecycle
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.
2026-07-27 16:44:57 +02:00

43 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "bun:test"
import { splitConfigByScope } from "../../webview-ui/src/utils/config-scope"
describe("splitConfigByScope", () => {
it("keeps indexing configuration out of project config", () => {
const split = splitConfigByScope({
indexing: {
enabled: true,
provider: "ollama",
},
})
expect(split.global).toEqual({ indexing: { enabled: true, provider: "ollama" } })
expect(split.project).toEqual({})
})
it("writes indexing provider settings to global config", () => {
const split = splitConfigByScope({
indexing: {
provider: "ollama",
},
})
expect(split.global).toEqual({ indexing: { provider: "ollama" } })
expect(split.project).toEqual({})
})
it("writes the speech-to-text model setting to global config", () => {
const split = splitConfigByScope({
experimental: {
speech_to_text_model: "openai/gpt-4o-mini-transcribe",
},
})
expect(split.global).toEqual({
experimental: {
speech_to_text_model: "openai/gpt-4o-mini-transcribe",
},
})
expect(split.project).toEqual({})
})
})