Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-qdrant-warnings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/cli": patch
---

Stabilize code indexing workers, retry Kilo model catalog downloads, reduce progress log noise, and show indexing failures as TUI notifications instead of writing over the terminal interface.
6 changes: 6 additions & 0 deletions .changeset/scoped-indexing-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kilocode/cli": patch
"kilo-code": patch
---

Support configuring code indexing separately for global and project settings in Kilo Console, the CLI TUI, and VS Code.
12 changes: 11 additions & 1 deletion packages/kilo-console/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,26 @@ test("config writes include the selected directory", async () => {

await client.saveConfig(query, { permission: { edit: { "*": "allow" } } })
await client.unsetConfig(query, [["permission", "edit"]])
await client.patchConfig(query, { indexing: { provider: "ollama" } }, [["indexing", "model"]])

expect(calls).toHaveLength(2)
expect(calls).toHaveLength(3)

const save = calls[0]
const unset = calls[1]
const patch = calls[2]
expect(save.method).toBe("PATCH")
expect(new URL(save.url).searchParams.get("directory")).toBe("/tmp/project")
expect(save.body).toEqual({ scope: "project", set: { permission: { edit: { "*": "allow" } } } })

expect(unset.method).toBe("PATCH")
expect(new URL(unset.url).searchParams.get("directory")).toBe("/tmp/project")
expect(unset.body).toEqual({ scope: "project", unset: [["permission", "edit"]] })

expect(patch.method).toBe("PATCH")
expect(new URL(patch.url).searchParams.get("directory")).toBe("/tmp/project")
expect(patch.body).toEqual({
scope: "project",
set: { indexing: { provider: "ollama" } },
unset: [["indexing", "model"]],
})
})
23 changes: 18 additions & 5 deletions packages/kilo-console/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
FormatterStatusResponse,
GlobalHealthResponse,
GlobalEvent,
KiloEmbeddingModelCatalog,
LspStatusResponse,
McpStatusResponse,
Pty as PtyInfo,
Expand Down Expand Up @@ -400,6 +401,10 @@ export async function load(input: Query): Promise<Snapshot> {
}
}

export async function loadEmbeddingModels(input: Query): Promise<KiloEmbeddingModelCatalog> {
return demand("Kilo embedding models", await client(input).indexing.models())
}

export async function loadProjects(input: ProjectQuery): Promise<ProjectItem[]> {
const sdk = client(input)
const dir = value(input.dir)
Expand Down Expand Up @@ -611,16 +616,24 @@ export function ptyWsUrl(input: Query, pty: string, cursor = 0) {
return url.toString()
}

export async function saveConfig(input: Query, patch: Partial<ConfigPatch>) {
export async function patchConfig(input: Query, patch: Partial<ConfigPatch>, unset?: ConfigUnset) {
const sdk = client(input)
const result = await sdk.config.overlayUpdate({ directory: value(input.dir), scope: input.scope, set: patch })
const set = Object.keys(patch).length ? patch : undefined
const result = await sdk.config.overlayUpdate({
directory: value(input.dir),
scope: input.scope,
set,
unset,
})
return demand("Update config", result)
}

export async function saveConfig(input: Query, patch: Partial<ConfigPatch>) {
return patchConfig(input, patch)
}

export async function unsetConfig(input: Query, unset: ConfigUnset) {
const sdk = client(input)
const result = await sdk.config.overlayUpdate({ directory: value(input.dir), scope: input.scope, unset })
return demand("Update config", result)
return patchConfig(input, {}, unset)
}

export async function saveModelState(input: Query, favorite: ModelRef[]) {
Expand Down
6 changes: 6 additions & 0 deletions packages/kilo-console/src/context/ConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
load,
loadCached,
loadProjects,
patchConfig,
resolveServer,
saveCached,
saveConfig,
Expand Down Expand Up @@ -133,6 +134,10 @@ export function ConfigProvider(props: { children?: JSX.Element }) {
run("Saving config", () => saveConfig(target(), patch))
}

function patch(update: Partial<ConfigPatch>, unset?: ConfigUnset) {
run("Saving config", () => patchConfig(target(), update, unset))
}

function unset(paths: ConfigUnset) {
run("Saving config", () => unsetConfig(target(), paths))
}
Expand All @@ -150,6 +155,7 @@ export function ConfigProvider(props: { children?: JSX.Element }) {
fail,
run,
save,
patch,
unset,
tui,
}
Expand Down
1 change: 1 addition & 0 deletions packages/kilo-console/src/context/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type Ctx = {
fail: (message: string) => void
run: (label: string, job: () => Promise<unknown>, task?: Task) => void
save: (patch: Partial<ConfigPatch>) => void
patch: (patch: Partial<ConfigPatch>, unset?: ConfigUnset) => void
unset: (paths: ConfigUnset) => void
tui: (patch: TuiPatch) => void
}
Expand Down
3 changes: 1 addition & 2 deletions packages/kilo-console/src/routes/config/AgentsRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import { Button } from "@kilocode/kilo-web-ui/button"
import { Card } from "@kilocode/kilo-web-ui/card"
import { ConfigRow, SectionTitle } from "@kilocode/kilo-web-ui/console"
import { IconButton } from "@kilocode/kilo-web-ui/icon-button"
import { CountTag, Tag } from "@kilocode/kilo-web-ui/tag"
import { CustomSelect, type SelectOption } from "../../components/CustomSelect"
import { SearchField } from "../../components/SearchField"
import { useConfig } from "../../context/config"
import { settings } from "../../shared/navigation"
import { toolCapabilities, toolName } from "../../shared/utils"
import { ConfigPage, SourceBadge } from "./ConfigPage"
import { ConfigCountTag as CountTag, ConfigPage, ConfigTag as Tag, SourceBadge } from "./ConfigPage"
import { ActionSelect, label as actionLabel, tone as actionTone } from "./PermissionsRoute"
import { agentEditable, agentTitle, snippets, useAgentBuilder, type AgentEntry, type AgentItem } from "./state/agents"
import type { PermissionAction } from "./state/permissions"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button } from "@kilocode/kilo-web-ui/button"
import { Card } from "@kilocode/kilo-web-ui/card"
import { Tag } from "@kilocode/kilo-web-ui/tag"
import { ConfigPage } from "./ConfigPage"
import { ConfigPage, ConfigTag as Tag } from "./ConfigPage"
import { useTuiNotificationSettings } from "./state/ui"

function Toggle(props: {
Expand Down
3 changes: 1 addition & 2 deletions packages/kilo-console/src/routes/config/CliUiRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { For, Show } from "solid-js"
import { Button } from "@kilocode/kilo-web-ui/button"
import { Card } from "@kilocode/kilo-web-ui/card"
import { Tag } from "@kilocode/kilo-web-ui/tag"
import { CustomSelect, type SelectOption } from "../../components/CustomSelect"
import { SearchField } from "../../components/SearchField"
import { ConfigPage } from "./ConfigPage"
import { ConfigPage, ConfigTag as Tag } from "./ConfigPage"
import { type Theme, themeTitle, useTuiUiSettings } from "./state/ui"

const diffs = [
Expand Down
4 changes: 3 additions & 1 deletion packages/kilo-console/src/routes/config/ConfigPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { JSX } from "solid-js"
import { Show } from "solid-js"
import { SourceBadge as UiSourceBadge } from "@kilocode/kilo-web-ui/console"
import { ConfigCountTag, ConfigTag, SourceBadge as UiSourceBadge } from "@kilocode/kilo-web-ui/console"

export { ConfigCountTag, ConfigTag }

export function ConfigPage(props: {
title: JSX.Element
Expand Down
3 changes: 1 addition & 2 deletions packages/kilo-console/src/routes/config/FormattersRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { For, Show } from "solid-js"
import { Button } from "@kilocode/kilo-web-ui/button"
import { ConfigRow, SectionTitle } from "@kilocode/kilo-web-ui/console"
import { IconButton } from "@kilocode/kilo-web-ui/icon-button"
import { CountTag, Tag } from "@kilocode/kilo-web-ui/tag"
import { ConfigPage, SourceBadge } from "./ConfigPage"
import { ConfigCountTag as CountTag, ConfigPage, ConfigTag as Tag, SourceBadge } from "./ConfigPage"
import { useFormatterSettings, type ToolRow } from "./state/formatters"

type Kind = "formatter" | "lsp"
Expand Down
Loading
Loading