Skip to content

feat: implement codebase indexing#6966

Merged
marius-kilocode merged 15 commits into
Kilo-Org:mainfrom
shssoichiro:codebase-indexing
Apr 27, 2026
Merged

feat: implement codebase indexing#6966
marius-kilocode merged 15 commits into
Kilo-Org:mainfrom
shssoichiro:codebase-indexing

Conversation

@shssoichiro
Copy link
Copy Markdown
Contributor

@shssoichiro shssoichiro commented Mar 12, 2026

Context

Closes #6144

Related indexing/search issues: #7986, #8385, #7352, #8311, #6391, #6453, #6490, #6936, #6482, #6047, #1105, #912, #4080, #4635.

Implementation

For the backend, migrates the legacy codebase indexing backend into the new codebase, locating as much code as possible in a kilo-indexing package as an opencode plugin, which currently is automatically enabled, but allows the indexing backend to be easier to maintain. This preserves support for the embedding and storage backends that previously existed. It maintains the previous tree-sitter-based chunking approach. The embedders, storage providers, and chunking implementation are copied directly with minor adaptations for the new codebase. The file watcher was rewritten, as the legacy file watcher depended on VSCode's file watcher infrastructure.

Migrates the codebase_search tool, adapted for the tool definition format preferred by OpenCode, and renamed to semantic_search as to not collide with Warpgrep.

Indexing can be configured in any of the following ways:

  • New indexing section in the kilo.json config file
  "indexing": {
    "enabled": true,
    "provider": "voyage",
    "model": "voyage-code-3",
    "vectorStore": "qdrant",
    "voyage": {
      "apiKey": "pa-redacted"
    },
    "qdrant": {}
  }
  • New /indexing command in the CLI
  • New Indexing settings interface in the VSCode extension

Adds an indexing status indicator to the bottom of the CLI, and to the prompt input panel in the VSCode extension.

Screenshots

image image image image

How to Test

To enable indexing, utilize any of the available configuration methods and then set indexing to enabled.

This should trigger indexing to start on the current codebase. Tasks should have access to the semantic_search tool, which they will use in appropriate situations as defined by the tool description.

Get in Touch

ExpedientFalcon on Discord

@shssoichiro shssoichiro marked this pull request as ready for review March 12, 2026 03:38
Comment thread packages/opencode/src/indexing/search-service.ts Outdated
Comment thread packages/opencode/src/indexing/processors/scanner.ts Outdated
Comment thread packages/opencode/src/indexing/vector-store/qdrant-client.ts
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 12, 2026

Code Review Summary

Status: 15 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 15
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/kilo-provider/open-config.ts 70 Config-open errors still render a function body instead of the real message
packages/opencode/src/session/compaction.ts 299 Compaction pruning is still disabled when compaction.prune is omitted
packages/desktop-electron/src/main/index.ts 164 SQLite migration progress still jumps straight from 0 to 100
packages/desktop-electron/src/main/windows.ts 103 Per-window CORS hooks are installed on the shared session and never removed
packages/desktop-electron/src/main/windows.ts 105 Renderer requests still inject invalid CORS response headers into outbound requests
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
packages/app/src/context/global-sync/child-store.ts 161 Child stores create loadPathQuery(directory) without a query function, so path data never loads on cold cache
packages/app/src/context/global-sync/child-store.ts 164 Persisted project metadata no longer hydrates on startup
packages/app/src/context/layout.tsx 394 Project enrichment dropped local metadata overrides for global/unsynced projects
packages/app/src/context/layout.tsx 489 URL-only project avatars no longer get fallback auto-colors
packages/desktop-electron/src/main/index.ts 191 Sidecar health-check failures are swallowed and initialization still succeeds
packages/desktop-electron/src/main/windows.ts 159 registerRendererProtocol() returns before the oc:// handler is registered
packages/opencode/src/file/ripgrep.ts 364 Aborted file listings can leave the ripgrep subprocess running
packages/opencode/src/file/ripgrep.ts 417 Aborted ripgrep searches can leave the subprocess running
packages/opencode/src/server/routes/instance/httpapi/provider.ts 96 Empty-model providers are not filtered in the new HttpApi route
packages/app/src/components/dialog-connect-provider.tsx 538 OAuth auto-connect still does not open the provider authorization page before polling the callback
Files Reviewed (21 files)
  • packages/kilo-vscode/src/KiloProvider.ts - latest indexing auth change reviewed; prior git-state finding appears fixed in this increment
  • packages/opencode/src/worktree/index.ts - latest Windows retry change reviewed; no additional issues found
  • packages/kilo-vscode/tests/unit/kilo-provider-indexing-refresh.test.ts - latest test-only change reviewed
  • packages/kilo-vscode/src/kilo-provider/open-config.ts - previous error-formatting issue still present
  • packages/kilo-vscode/src/provider-actions.ts - previous missing-features config message issue fixed
  • packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx - reviewed; no new high-confidence issue carried forward
  • packages/app/src/context/global-sync/child-store.ts - path-query and metadata hydration issues remain
  • packages/app/src/context/layout.tsx - metadata and avatar color regressions remain
  • packages/app/src/components/dialog-edit-project.tsx - no additional issues found
  • packages/app/src/context/global-sync/bootstrap.ts - no additional issues found
  • packages/app/src/context/global-sync.tsx - no additional issues found
  • packages/app/src/pages/layout/sidebar-items.tsx - previous child-session render issue fixed
  • packages/kilo-docs/pages/code-with-ai/agents/context-mentions.md - no markdown image issue found
  • packages/kilo-docs/pages/code-with-ai/features/autocomplete/index.md - no markdown image issue found
  • packages/desktop-electron/src/main/index.ts - 2 issues remain
  • packages/desktop-electron/src/main/windows.ts - 3 issues remain, including one memory/resource leak
  • packages/opencode/src/file/ripgrep.ts - 2 subprocess leak issues remain
  • packages/opencode/src/session/compaction.ts - prune-default issue still present
  • packages/opencode/src/server/routes/instance/httpapi/config.ts - previous empty-model crash issue fixed
  • packages/opencode/src/server/routes/instance/httpapi/provider.ts - unchanged issue carried forward
  • packages/app/src/components/dialog-connect-provider.tsx - unchanged issue carried forward

Reviewed by gpt-5.5-2026-04-23 · 3,236,054 tokens

Comment thread packages/opencode/src/indexing/vector-store/lancedb-vector-store.ts Outdated
Comment thread packages/opencode/src/indexing/orchestrator.ts Outdated
Comment thread packages/opencode/src/indexing/processors/parser.ts
Comment thread packages/opencode/src/indexing/processors/file-watcher.ts
Comment thread packages/opencode/src/indexing/processors/file-watcher.ts Outdated
@kevinvandijk kevinvandijk requested a review from jrf0110 March 13, 2026 14:42
@shssoichiro shssoichiro force-pushed the codebase-indexing branch 2 times, most recently from c4f3628 to ce53de9 Compare March 15, 2026 01:20
Comment thread packages/opencode/src/indexing/embedders/bedrock.ts Outdated
Comment thread packages/opencode/src/indexing/embedders/gemini.ts Outdated
Comment thread packages/opencode/src/indexing/embedders/mistral.ts Outdated
Comment thread packages/opencode/src/indexing/service-factory.ts Outdated
Comment thread packages/opencode/src/indexing/vector-store/qdrant-client.ts
Comment thread packages/kilo-vscode/webview-ui/src/components/settings/IndexingTab.tsx Outdated
Comment thread packages/opencode/src/tool/registry.ts Outdated
@shssoichiro shssoichiro force-pushed the codebase-indexing branch 2 times, most recently from 3e77793 to 6eb59de Compare March 19, 2026 12:57
Comment thread packages/opencode/src/tool/registry.ts Outdated
@shssoichiro shssoichiro force-pushed the codebase-indexing branch 3 times, most recently from 2d73fcf to 232dc09 Compare March 19, 2026 14:23
Comment thread packages/kilo-vscode/tests/indexing-provider-blur-race.spec.ts Outdated
@shssoichiro shssoichiro force-pushed the codebase-indexing branch 4 times, most recently from 5214dc0 to d585b58 Compare March 19, 2026 16:27
Comment thread .kilocode/skills/add-translations/SKILL.md Outdated
Comment thread .kilocode/skills/add-translations/SKILL.md Outdated
@shssoichiro
Copy link
Copy Markdown
Contributor Author

@marius-kilocode per the discussion on Discord, added an experimental flag to gate the indexing feature. This can be enabled in the VSCode Experimental Settings tab, or in the config file via "experimental": { "semantic_indexing": true }. With this disabled (the default), all indexing features and UI elements are completely disabled.

The test failures seem to be occurring on main.

@GreatSUN
Copy link
Copy Markdown

@shssoichiro , @marius-kilocode -> Are we going to get at least OpenAI compatible provider as possible Embedding provider as well? Reason I am asking is that we need to make use of our own proxy to run through...

@shssoichiro
Copy link
Copy Markdown
Contributor Author

shssoichiro commented Apr 25, 2026

Yes, this PR contains all the providers that were present in the 5.x extension, which includes OpenAI-Compatible.

image

@marius-kilocode
Copy link
Copy Markdown
Collaborator

@shssoichiro retested this. This seems to work now. Feature flag also works. I will look into the test failures and check how we can reduce conflicts with upstream for this PR.

Comment thread packages/kilo-vscode/src/KiloProvider.ts Outdated
@marius-kilocode
Copy link
Copy Markdown
Collaborator

@shssoichiro I merged the feature. There are some issues with startup time (that I could reproduce in large repositories). #9573 We probably want to re-enable those and find the fix for it. I will look into it already, but it looks tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codebase Indexing Settings button missing in chat header Add codebase indexing to new extension and CLI

6 participants