Skip to content

fix(kilo-vscode): surface managed overlay fields in Indexing settings UI - #15453

Open
PeterHodges15 wants to merge 2 commits into
Kilo-Org:mainfrom
PeterHodges15:fix/managed-indexing-ui
Open

PeterHodges15 wants to merge 2 commits into
Kilo-Org:mainfrom
PeterHodges15:fix/managed-indexing-ui

Conversation

@PeterHodges15

Copy link
Copy Markdown

Issue

No existing issue - this is a newly reported bug found while regression-testing managed-config behavior on Kilo 7.8.17.

Related: #15451 (request to extend this pattern to all settings sections; this PR implements the Indexing tab as the reference implementation) and #15450 (unrelated embedding-batcher defect observed during the same test session).

Context

When a managed/enterprise config (e.g. C:\ProgramData\kilo\kilo.jsonc on Windows) supplies the indexing values, the Indexing settings tab rendered blank for every managed field: provider, model, dimensions, base URL, API key, file extensions, and tuning.

Root cause: the extension fetched the server's config overlay but discarded its per-field provenance (fields), and the tab computed display values from the raw global/project config layers only - so the managed/system layer was structurally unreachable in the UI. The overlay endpoint already returns fields (path, source: project|global|system|default, editable, resolved value); this PR plumbs it through to the settings UI.

Implementation

  • config-snapshot.ts - return fields from the overlay response alongside targets/collections.
  • KiloProvider.ts - add fields to the config snapshot type and to both the config-load and config-refresh message payloads.
  • Webview - fields added to ConfigLoadedMessage/ConfigUpdatedMessage; the config context stores them in a configFields signal; the Indexing tab now resolves each field as raw-scope value with the overlay-resolved value as fallback, maps source: "system" to a "Managed" tag plus an "Inherited from managed config" note, and disables inputs when editable === false.
  • Save semantics unchanged: saves still write only to the raw scope layers, so a project can shadow a managed value.
  • indexing-tab-state.ts - new indexingFieldDisplay() helper plus "managed" inheritance/source entries.
  • Behavior-preserving refactor: the configUpdated message branch in context/config.tsx was extracted into applyConfigUpdated() to stay under the eslint complexity limit.

Screenshots / Video

before after
(to be attached) (to be attached)

How to Test

Manual/local verification

  • (agent-executed) bun test tests/unit/indexing-tab-state.test.ts tests/unit/kilo-provider-indexing-refresh.test.ts -> 28 pass / 0 fail (92 expect calls). The same tests were red before the fix (14 pass / 2 fail / 1 error).
  • (agent-executed) check-types, check-types:webview, lint, and bundle in packages/kilo-vscode -> clean.
  • (agent-executed) Full unit suite: 6837 pass / 105 fail; all 105 failures are environmental on the locked-down Windows test box (symlink EPERM, drive-letter casing, cmd.exe quoting in spawned tests, esbuild CSS/SVG loader) and none reference indexing/overlay/config.
  • (human-executed) Loaded the local dev build in the VS Code Extension Development Host with the managed config active; Settings -> Kilo -> Indexing now shows the managed provider/model/dimensions/base URL with "Managed" tags, read-only in the global scope.

Reviewer test steps

  • Clone a fresh main, apply this diff, run bun install at the root, then in packages/kilo-vscode:
    • bun test tests/unit/indexing-tab-state.test.ts tests/unit/kilo-provider-indexing-refresh.test.ts
    • bun run build:check
  • Optional manual check: point a managed/enterprise config at an embedding provider and open Settings -> Indexing in the dev extension (F5, "VS Code Extension Development").

Blocked checks and substitute verification

  • bun run compile (full) could not complete on the author's machine: its prepare:cli-binary step fetches https://models.dev/api.json and outbound egress is restricted. Substitute: the stock 7.8.17 CLI binary shipped with the installed extension was used alongside the dev tree (this change is client-side only; no CLI/server changes), plus all per-package checks above.
  • test:visual / test:a11y not run (no browser available in this environment); substitute: targeted unit tests and the manual dev-host verification above.
  • The husky pre-push hook (bun turbo typecheck) could not run on the author's machine: the turbo Windows binary crashes with 0xC00000FD even on --version (environmental). Substitute: per-package check-types / check-types:webview in the only affected package, as above.

Checklist

  • Issue linked above, or exception explained - exception: new bug, no pre-existing issue (related enhancement: [FEATURE]: Surface managed/enterprise config state in the settings UI (read-only indicators + save pre-validation) #15451)
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A - screenshots to be attached by the author
  • Changeset considered for user-facing changes - changeset fix-managed-indexing-ui.md included
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work. - AI-assisted development; the author reviewed the full diff.

Get in Touch

Kilo Code Discord: PeterH (GitHub: PeterHodges15)

Plumb the config overlay's per-field provenance (fields) from the
server snapshot through KiloProvider into the webview config context,
and use it in the Indexing tab so managed/enterprise values are shown
(with source tag and editability) instead of rendering blank.
@github-actions github-actions Bot added area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look priority:p1 High: fixes and regressions. Set from the title. Change by hand. labels Oct 24, 2026
indexingDescription(value, inheritance(paths))
/** Display value + provenance for a field: editable scopes first, then managed/runtime resolution. */
const fieldInfo = (path: readonly string[]) =>
indexingFieldDisplay(scope(), globalCfg(), projectCfg(), configFields(), path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: configFields() always comes from an overlay resolved with scope: "project" (see fetchSnapshot at packages/kilo-vscode/src/kilo-provider/config-snapshot.ts:19), but it is reused here for both scope views. Two consequences:

  1. In the default global view, when the global layer does not define a field, indexingFieldDisplay falls through to this project-scoped map, so project-local values leak into the global editor. For example the model field (line 485) and dimension field (line 504) now display the project's value with a Local tag while the user believes they are editing global config; selectedProvider() and saveEnabled() also see the project provider, which suppresses the auto-select-kilo branch in saveEnabled.
  2. editable from a project-scope overlay is always true for managed fields (packages/opencode/src/kilocode/config/overlay.ts:418 computes editable: source !== "system" || input.scope === "project"), so disabled={!fieldInfo(...).editable} never disables a managed field in the global view. The new test's editable: false case in indexing-tab-state.test.ts is not reachable with real overlay data, so the changeset claim that inputs which cannot be saved are disabled does not hold.

Consider resolving/fetching overlay fields for both scopes (or computing the scope-appropriate value and editability client-side) instead of sharing the project-scoped snapshot across both scope views.

inherited={inherited()}
t={language.t}
tag={() => tag(scope(), [["enabled"]])}
tag={() => tag(scope(), ["enabled"])}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: The switch state is still derived from raw layers only (enabled()/inherited() use indexingEnabled/indexingEnabledInherited), while this tag now resolves through fieldInfo, which includes the overlay/managed value. With a managed indexing.enabled: true, the row renders a Managed tag next to a switch that reads off, and the description still says Inherited from global config (off) until a project value is saved. — so the user cannot tell the effective state and cannot trust the toggle. The switch is also not disabled for non-editable fields. Either make the switch/description use the overlay-resolved value for the displayed scope, or keep this tag raw-only.

@kilo-code-bot

kilo-code-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx 200 Overlay fields are always fetched with scope: "project" (config-snapshot.ts:19) yet reused for both scope views, so project-local values and Local tags leak into the global editor, and editable is always true for managed fields at project scope (overlay.ts:418). The new editable === false early return in indexing-tab-state.ts:116 therefore does not trigger on the normal project-scoped snapshot, so the changeset's "locked managed value now wins" behavior still does not apply on initial load — it can only surface when the last overlayUpdate happened to be a global save.
packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx 419 The enable switch still reads raw layers only (enabled()/indexingEnabled), while its tag now resolves managed values via fieldInfo. A managed indexing.enabled renders a Managed tag next to an off switch, with the switch left enabled and the description "Inherited from global config (off) until a project value is saved."
Files Reviewed (3 files in incremental diff)
  • .changeset/fix-managed-indexing-ui.md - claimed locked-managed behavior not reachable on the normal snapshot (see IndexingTab.tsx:200)
  • packages/kilo-vscode/tests/unit/indexing-tab-state.test.ts - new editable: false cases assert a state the project-scoped overlay cannot produce
  • packages/kilo-vscode/webview-ui/src/components/settings/indexing-tab-state.ts - new non-editable override is unreachable on the project-scoped snapshot used by normal loads

Fix these issues in Kilo Cloud

Previous Review Summary (commit df06a0d)

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

Previous review (commit df06a0d)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx 200 Project-scoped overlay fields are reused for the global scope view: project-local values and Local tags leak into the global editor, and managed fields are never disabled because editable is always true for source: "system" at project scope.
packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx 419 The enable switch still reads raw layers only while its tag now resolves managed values, so a managed indexing.enabled shows a Managed tag next to an off switch (and the switch is not disabled).
Files Reviewed (11 files)
  • .changeset/fix-managed-indexing-ui.md - no issues
  • packages/kilo-vscode/src/KiloProvider.ts - no issues
  • packages/kilo-vscode/src/kilo-provider/config-snapshot.ts - no issues (root of the scope mismatch noted above)
  • packages/kilo-vscode/tests/unit/indexing-tab-state.test.ts - no issues (the editable: false case is not reachable from real overlay data)
  • packages/kilo-vscode/tests/unit/kilo-provider-indexing-refresh.test.ts - no issues
  • packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx - 2 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/indexing-tab-state.ts - no issues
  • packages/kilo-vscode/webview-ui/src/context/config.tsx - no issues (extraction verified behavior-preserving; no TDZ/stale-closure risk)
  • packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx - no issues
  • packages/kilo-vscode/webview-ui/src/types/messages/config.ts - no issues
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts - no issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-flash-latest · Input: 70.9K · Output: 17.6K · Cached: 845.1K

Review guidance: REVIEW.md from base branch main

…es in Indexing UI

When the config overlay reports an indexing field as non-editable, its effective value now wins over a same-named value in the global or project scope, so a managed field renders disabled with the effective value instead of a stale value that would be rejected on save. Also unify the duplicated webview provenance type by aliasing IndexingFieldInfo to ConfigField.

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

area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look priority:p1 High: fixes and regressions. Set from the title. Change by hand.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant