-
Notifications
You must be signed in to change notification settings - Fork 1
fix: health endpoint uptime, sparse provider detection, exception handling, vector normalization #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…, vector normalization, and tests Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
✅ CLA Check PassedAll contributors to this PR are exempt from the CLA requirement:
Knitli organization members and recognized bots do not need to sign the CLA. Thanks for your contribution to codeweaver! 🧵 |
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
… comments Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses key issues in the embedding reconciliation feature including uptime calculation, provider detection, exception handling, and vector type handling. The changes improve reliability and maintainability of the reconciliation process.
- Uses monotonic time for health endpoint uptime to prevent clock drift/skew issues
- Replaces brittle string-based sparse provider detection with robust
isinstance()checks - Narrows exception handling from broad
Exceptionto specific types with enhanced logging context - Improves vector type normalization to handle Qdrant's
Mappingtypes (e.g.,NamedVectors)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/codeweaver/server/server.py | Updates health service initialization to pass startup_stopwatch instead of startup_time |
| src/codeweaver/server/health/health_service.py | Changes constructor to accept startup_stopwatch and uses monotonic time for uptime calculation |
| src/codeweaver/server/health/models.py | Removes computed field approach for uptime, replaces with explicit field passed to constructor |
| src/codeweaver/providers/embedding/providers/base.py | Replaces string-based class name checking with isinstance(self, SparseEmbeddingProvider) |
| src/codeweaver/engine/indexer/indexer.py | Narrows exception handling to specific types (ProviderError, IndexingError, ConnectionError, TimeoutError, OSError) with enhanced contextual logging; improves vector type detection to handle Mapping types correctly |
| tests/unit/test_indexer_reconciliation.py | Adds comprehensive edge case tests (list vectors, empty results, missing payload, single-provider configs) and exception handling tests; marks complex integration tests appropriately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses PR review feedback on the embedding reconciliation feature: broken uptime calculation, brittle sparse detection, overly broad exception handling, and incorrect vector type handling.
Changes
Health Endpoint Uptime
HealthServicenow acceptsstartup_stopwatch(fromtime.monotonic()) instead ofstartup_timeuptime_secondsis now passed explicitlySparse Provider Detection
isinstance(self, SparseEmbeddingProvider)Exception Handling
except Exceptionto specific types:ProviderError,IndexingError,ConnectionError,TimeoutError,OSErrorVector Type Normalization
Mappingtypes (e.g., Qdrant'sNamedVectors) correctlyTests
prime_indexintegration tests appropriately✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.