fix(memory): configurable SA timeout, tier promotion retry, orphan cleanup#2519
Merged
fix(memory): configurable SA timeout, tier promotion retry, orphan cleanup#2519
Conversation
…eanup - #2514: add recall_timeout_ms to SpreadingActivationConfig (default 1000ms, clamped from 500ms hardcoded); zero-value guard clamps to 100ms with warn - #2511: switch promote_to_semantic to BEGIN IMMEDIATE (begin_write) to eliminate DEFERRED lock-upgrade race; add 3-attempt exponential backoff (50/100/200ms) for transient SQLITE_BUSY in merge_cluster_and_promote - #2507: sanitize_tool_pairs and strip_mid_history_orphans now return (count, Vec<i64>) of removed message db_ids; load_history soft-deletes orphaned rows so startup warnings do not repeat across sessions
112314c to
8d1e687
Compare
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.
Summary
Fixes three SQLite/memory bugs found during CI-350 live testing session.
Changes
#2514 — configurable spreading activation recall timeout
recall_timeout_ms: u64toSpreadingActivationConfig(default1000, up from hardcoded500)100mswith a warn log (prevents silent recall breakage)fetch_graph_factsto use config value; log message now includes actual timeout#2511 — tier promotion SQLite lock contention
promote_to_semanticnow usesbegin_write(BEGIN IMMEDIATE) instead ofbegin(DEFERRED), eliminating the read→write lock-upgrade racemerge_cluster_and_promoteretries the DB write up to 3 times with exponential backoff (50/100/200ms) on SQLITE_BUSY#2507 — orphaned tool-pair messages not deleted from DB
sanitize_tool_pairsandstrip_mid_history_orphansnow return(count, Vec<i64>)with db_ids of fully-removed messagesload_historysoft-deletes those rows non-fatally; startup warnings no longer repeat across sessionsTest plan
cargo nextest run --workspace --exclude zeph-candle --lib --bins)SpreadingActivationConfigdefaults/round-trip, 4 foreffective_recall_timeout_ms(including zero-clamp)cargo clippy --workspace --features full -- -D warningscleancargo +nightly fmt --checkclean