Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an OpenAI-compatible “generic-http” provider alongside Gemini, plus automatic embedding vector-size detection to configure Qdrant collections correctly. It also refactors retry logic into a shared helper and updates logging to support both human-friendly console output and JSON trace logs.
Changes:
- Introduces
GenericHTTPProvider(chat completions + embeddings) and sharedretryOnRateLimitlogic. - Adds embedding
vector_sizeconfig with auto-detection viaEmbeddingProvider.DetectVectorSize()and wires it into Qdrant collection creation. - Updates CLI/indexer logging and trace logger to better separate console output from trace output.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/trace/trace.go | Adds console + multi handler support and updates NewLogger signature/behavior. |
| cmd/vedcode/main.go | Wires new trace logger options and removes log.Fatalf usage. |
| internal/providers/retry.go | New shared retry/backoff helper for provider calls. |
| internal/providers/provider.go | Adds DetectVectorSize() to EmbeddingProvider and supports generic-http factories. |
| internal/providers/generic_http.go | New OpenAI-compatible HTTP provider implementation. |
| internal/providers/generic_http_test.go | Tests for generic-http generation/embedding + retry behavior. |
| internal/providers/providers_test.go | Centralizes noopLogger for providers tests. |
| internal/providers/gemini.go | Switches Gemini to shared retry helper and implements DetectVectorSize(). |
| internal/providers/gemini_test.go | Adjusts tests for retry refactor and shared noop logger. |
| internal/config/config.go | Adds vector_size, provider URL/api-key validation rules, and merge behavior. |
| internal/config/config_test.go | Updates config fixtures/validation tests for generic-http + vector size. |
| internal/store/qdrant.go | Makes Qdrant collection vector size configurable. |
| internal/store/qdrant_test.go | Updates constructor calls to include vector size. |
| internal/indexer/indexer.go | Switches operational output from log to slog and adds vector-size auto-detect. |
| internal/mcp/server.go | Adds vector-size auto-detect before initializing Qdrant store. |
| internal/mcp/server_test.go | Updates embedding provider mock to implement DetectVectorSize(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
29
| func NewQdrantStore(url, collectionPrefix, projectName string, vectorSize int, logger *slog.Logger) *QdrantStore { | ||
| return &QdrantStore{ | ||
| baseURL: url, | ||
| collection: collectionPrefix + projectName, | ||
| vectorSize: vectorSize, | ||
| client: &http.Client{Timeout: 30 * time.Second}, | ||
| logger: logger, |
Comment on lines
+170
to
+172
| if project.Embedding.VectorSize != 0 { | ||
| cfg.Embedding.VectorSize = project.Embedding.VectorSize | ||
| } |
Comment on lines
+71
to
+76
| func NewGenericHTTPProvider(baseURL, apiKey, model, embeddingModel string, logger *slog.Logger) *GenericHTTPProvider { | ||
| return &GenericHTTPProvider{ | ||
| client: &http.Client{Timeout: defaultTimeout}, | ||
| baseURL: baseURL, | ||
| apiKey: apiKey, | ||
| model: model, |
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.
No description provided.