Repository navigation
fix: recognize transient DB errors and reuse KB embeddings across retries - #39
Open
KeyCOrigin wants to merge 3 commits into
Open
KeyCOrigin wants to merge 3 commits into
KeyCOrigin wants to merge 3 commits into
Conversation
This branch has not been deployed
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.
Problem
Read recovery primarily recognizes generic Python exceptions and follows
__cause__. It misses database-specific transient errors, including SQLite BUSY, MySQL deadlocks, and PostgreSQL serialization failures, as well as exceptions stored only in SQLAlchemy’s.orig.KB vector-search retries also recompute an already successful query embedding, adding latency and embedding calls.
Changes
__cause__and SQLAlchemy DBAPIError.orig, with cycle protection.Validation
201 tests passed across database, read-recovery, runtime-reliability, and workspace regression suites.
Coverage includes:
.orig-only exceptions.MySQL and PostgreSQL tests simulate driver exception contracts; no live-server integration tests were performed.
Scope
This change does not add a PostgreSQL adapter or write retries. Direct calls to
DBService.query_sql()remain single-attempt; automatic retries use the existingrecover_readwrapper.