Open
Conversation
Extract Kilo-specific codebase search utilities into a dedicated module to improve code organization and minimize merge conflicts with upstream. Changes: - Add types.ts with Zod schemas for configuration validation - Add config.ts for configuration loading with defaults - Add collection.ts for SHA-256 hash-based collection naming - Add embeddings.ts with OpenAI, Mistral, Ollama provider support - Refactor codebase-search.ts to use extracted modules - Conditionally register tool only when configured - Add comprehensive unit tests
Rename tool definition and permission identifiers from kebab-case (codebase-search) to snake_case (codebase_search) for naming consistency.
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Add a new codebase search tool with support for semantic search using Qdrant or LanceDB vector databases. Includes: - Documentation in AGENTS.md - Codebase search configuration dialog (dialog-tool-codebase-search.tsx) - Tool selection dialog (dialog-tool.tsx) - Integration with prompt menu in prompt/index.tsx The tool allows configuring: - Embedding model (e.g., codestral-embed-2505, text-embedding-3-small) - Vector database type (Qdrant or LanceDB) - Database connection settings (URL for Qdrant, path for LanceDB) - Similarity threshold for search results - Maximum number of results to return Configuration is saved to opencode.jsonc file in the project or global config directory.
89d65ca to
708f008
Compare
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Export formatResults function to enable direct testing. Add comprehensive test coverage for edge cases including empty results, threshold filtering, max results limiting, and output formatting.
a6c7dcb to
d319a33
Compare
d319a33 to
cc7e1be
Compare
packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx
Outdated
Show resolved
Hide resolved
Contributor
Code Review SummaryStatus: 15 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Other Observations (not in diff)Several issues from the initial review appear to have been addressed in subsequent commits:
The Files Reviewed (26 files)
|
16f25ab to
4d564b9
Compare
…ol name - Rename codebase-search tool to codebase_search for consistency - Add Config.clearCache() to clear config cache without disposing entire instance - Add State.clearEntry() and State.clearAll() for granular state management - Improve embeddings error handling with null check for embedding data - Change Zod parse to safeParse in codebase-search config for better error handling
Add consistent error handling across all embedding providers (OpenAI, Mistral, Ollama) to properly validate response data and throw meaningful errors when embedding data is missing. Also removes unused SIGHUP handler from index.ts.
…ng logic Move similarity threshold filtering and result limiting to the caller. Also refactor config file existence check to use Bun.file().exists() and improve error logging.
Removes the unused `clearAll` function from State namespace and cleans up the unused Config import in the config route handler. Also updates AGENTS.md to use jsonc code block for better syntax highlighting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Added cloud based codebase_search tool to CLI. closes #409
Implementation
This tool implementation reuses VSCode codebase indexing. As I am using Mistral embedded model with Qdrant cloud vector DB, I tested only that type of index search. Added tools menu to the CLI (can be invoked by
/toolscommand or Ctrl+P) to setup tool. API keys for Mistral and Qdrant must be added via /connect or manual editing of auth.json.Screenshots
How to Test
Picture tells more than thousend words:

Get in Touch
Discord user id: 861519093852012544