Repository navigation
fix(memory): reject non-finite external_prefetch_timeout - #131448
Open
RaviTharuma wants to merge 5 commits into
Open
RaviTharuma wants to merge 5 commits into
RaviTharuma wants to merge 5 commits into
Conversation
Salvage rebase of NousResearch#130788 (itself a recovery of NousResearch#104562) onto current main. The original branch conflicted on agent/agent_init.py and the surrounding memory manager has since evolved (recall dedupe, provider telemetry, spill config); all main-side behavior is preserved here. - memory.external_prefetch_timeout (config.yaml, default 8s) bounds an external provider's synchronous prefetch; resolved through memory_manager_from_config at agent init - a timed-out prefetch's late result is cached bound to its originating session and query, generation-invalidated on turn start, session rotation, rewind and compression, and reused on the next turn instead of the provider being parked for the session - late values are spill-capped before they are stored or returned Fixes NousResearch#104405
Open
13 tasks done
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.
What does this PR do?
Follow-up to #131357 addressing @JoaoMarcos44 P2: non-finite
memory.external_prefetch_timeoutvalues (.nan/.inf/ stringnan/inf) bypassedvalue <= 0and later crashedthreading.Thread.join.This branch is based on #131357 tip
fd164da238plus one additional commit that requiresmath.isfinite(value) and value > 0inresolve_external_prefetch_timeout(soft fallback) andMemoryManager.__init__(strict). If #131357 is preferred as the landing vehicle, please cherry-pick commit281808ae84onto that branch and this PR can be closed as redundant.Related Issue
Fixes #131446
Follow-up to #131357 (addresses #131357 (comment))
Salvage lineage: #130788 / #104405
Type of Change
Changes Made
agent/memory_manager.py—import math;resolve_external_prefetch_timeoutrejects non-finite/non-positive values;MemoryManager.__init__requires a finite positive timeout.tests/agent/test_memory_provider.py— regressions for.nan/.inf/-.inf/nan/inf/None/0/negative/junk → default; finite2.5still overrides;memory_manager_from_config({nan})never stores a non-finite join timeout.How to Test
python -m pytest tests/agent/test_memory_provider.py -q— Observed: 65 passed.resolve_external_prefetch_timeout({"external_prefetch_timeout": float("nan")}) == _EXTERNAL_PREFETCH_TIMEOUT_S.Checklist
Code
281808ae84is the minimal surface)tests/agent/test_memory_provider.pypassesDocumentation & Housekeeping
cli-config.yaml.example— N/ACONTRIBUTING.md/AGENTS.md— N/A