-
Notifications
You must be signed in to change notification settings - Fork 52.4k
fix: make cron skip_memory configurable via config.yaml #9825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
nightq
wants to merge
1
commit into
NousResearch:main
from
nightq:fix/issue-9763-cron-skip-memory-configurable
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| """Tests for cron scheduler skip_memory configuration. | ||
|
|
||
| Regression for issue #9763: skip_memory was hardcoded to True in | ||
| cron/scheduler.py, making external memory providers (e.g. mem0) unusable | ||
| in cron jobs. | ||
| """ | ||
| import textwrap | ||
|
|
||
|
|
||
| class TestCronSkipMemoryConfig: | ||
| """Verify cron reads skip_memory from config.yaml.""" | ||
|
|
||
| def test_skip_memory_defaults_to_true(self): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests only evaluate a locally copied dict expression, so they pass on the base revision where |
||
| """When no cron.skip_memory is configured, default to True.""" | ||
| config = {} | ||
| result = config.get("cron", {}).get("skip_memory", True) | ||
| assert result is True | ||
|
|
||
| def test_skip_memory_false_when_configured(self): | ||
| """When cron.skip_memory is set to false, use False.""" | ||
| config = {"cron": {"skip_memory": False}} | ||
| result = config.get("cron", {}).get("skip_memory", True) | ||
| assert result is False | ||
|
|
||
| def test_skip_memory_true_when_explicitly_set(self): | ||
| """When cron.skip_memory is explicitly true, use True.""" | ||
| config = {"cron": {"skip_memory": True}} | ||
| result = config.get("cron", {}).get("skip_memory", True) | ||
| assert result is True | ||
|
|
||
| def test_empty_cron_section_defaults_to_true(self): | ||
| """When cron section exists but skip_memory is missing, default to True.""" | ||
| config = {"cron": {}} | ||
| result = config.get("cron", {}).get("skip_memory", True) | ||
| assert result is True | ||
|
|
||
| def test_other_cron_settings_preserved(self): | ||
| """Other cron config settings don't affect skip_memory default.""" | ||
| config = {"cron": {"timeout": 300}} | ||
| result = config.get("cron", {}).get("skip_memory", True) | ||
| assert result is True | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skip_memoryis also the built-in MEMORY.md/USER.md gate:agent/agent_init.py:1333-1345initializes that store and1353-1417initializes providers under the same condition. Setting this false therefore enables local-memory reads and writes as well as provider tools, rather than preserving the cron isolation described by the replaced comment. Please separate the provider-only behavior or guard the built-in memory effects explicitly.