fix(memory): pass through unknown config keys in _wrap_configuration#322
Merged
Merged
Conversation
_wrap_configuration only copies extraction, consolidation, and reflection keys into the wrapped config dict. Any other top-level keys like selfManagedConfiguration are silently dropped, making it impossible to modify SELF_MANAGED strategies through modify_strategy or update_memory_strategies. Add a pass-through loop at the end of _wrap_configuration that copies any config keys not already handled by the wrapping logic. This allows selfManagedConfiguration (and any future unknown config keys) to reach the API intact. Relates to #212
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
_wrap_configurationonly copiesextraction,consolidation, andreflectionkeys into the wrapped config dict. Any other top-level key — likeselfManagedConfiguration— is silently dropped. This makes it impossible to modify SELF_MANAGED strategies throughmodify_strategy()orupdate_memory_strategies().Root Cause
_wrap_configurationbuilds a newwrapped_configdict and only populates it with keys it explicitly handles (extraction, consolidation, reflection). It never copies unknown keys, so they disappear before reaching the API.Fix
Add a pass-through loop at the end of
_wrap_configurationthat copies any config keys not already inwrapped_config. This preservesselfManagedConfiguration(and any future unknown config keys) so they reach the API intact.Why this approach
_wrap_configurationis called once per strategy in the modify loop, so there's no cross-contamination between strategieswrapped_configby the time the loop runs, so they're skippedselfManagedConfiguration) fails silent — future unknown keys get dropped with no errorExample
Test plan
_wrap_configurationtests pass (known override types still wrap correctly)selfManagedConfigurationkey preserved in outputRelates to #212