Repository navigation
fix(retrieval): configure database deadline and narrow entity hydration - #537
Merged
Merged
Conversation
fazpu
force-pushed
the
fix/configurable-retrieval-timeout
branch
from
November 6, 2026 18:18
c3b7b24 to
7200a4a
Compare
fazpu
marked this pull request as ready for review
November 6, 2026 18:58
This was referenced Nov 6, 2026
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.
Retrieval could spend most of its hard-coded 25-second database deadline calculating entity statistics the caller never requested, then return an empty boundary. The saved conv-47 run recorded 24 wholly empty deadline results in 69 calls.
This change makes the database budget explicit per QueryEngine/deployment: REMEMBERSTACK_SELFHOST_RETRIEVAL_DATABASE_BUDGET_S, default 120 seconds, maximum 3600. Nested reads retain one absolute deadline and the private bounded pool. Python/TypeScript/CLI requests default to 300 seconds, and CLI --timeout / REMEMBER_TIMEOUT are configurable. LoCoMo freezes both budgets, accounting for the two independently bounded combined-context children.
The view-only p9_42_0063 migration attaches the one-row entity count aggregate with LEFT JOIN LATERAL, allowing identity-only readers to skip unused statistics. Provenance, merge/forget visibility and requested counts are preserved. Alias candidates are materialized before per-candidate authority hydration; exact homonyms remain uncapped and fuzzy/phonetic ordering is unchanged.
The new view AST is registered in the query-space manifest and advances its hash to 9f02973aa7ccf1484b4e4c50cf5318a1065f1a2efe7bccdc0c1776949ae6440f. Ordinary setup therefore moves active saved-query versions to pending_revalidation before publishing the hash; shipped examples follow the existing reseeding policy. The current LoCoMo pin advances. Only the three manifest-identity fields in the D143 default-surface capture advance; every other capture member is unchanged. The separate D143 operation-response fixture and PostgreSQL byte-equality check are retained. This is a surface metadata change, not ingestion reprocessing.
Validation/evidence:
Sources: QueryEngine, bounded read admission, SelfHostSettings/EngineSettings, current-entity view and migrations, D89/D97/D142, saved conv-47 traces, copied-store wait events/EXPLAIN and PR #505's chunk-search measurement scope. Rationale: plan/analysis/retrieval_database_deadline_20261106.md.
No stored ingestion products, paid-product reuse keys/generations, model bindings, answer/judge prompts, gold labels or scores change. The original 17/20 run and GCS archives remain immutable. Full scoring remains paused. Old v39 runs remain readable as recorded runs; changed-current-pin execution requires a new prepared identity. Longer budgets hold a slot/snapshot longer and require appropriate client/proxy timeouts. Disconnect-driven SQL cancellation is outside scope. Doctor's short health probe and the remote MCP bridge have documented timeout exceptions. Autoboard status is unavailable without BOARD_API_KEY.