fix: make cron skip_memory configurable via config.yaml - #9825
Conversation
Fixes NousResearch#9763 Root cause: cron/scheduler.py hardcoded skip_memory=True, preventing external memory providers (mem0, etc.) from being initialized in cron jobs. Fix: Read skip_memory from config.yaml under cron.skip_memory, defaulting to True for backward compatibility. Users can set cron.skip_memory: false to enable memory in cron jobs.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused configuration proposal. The current hard-coded gate does leave external providers unavailable to cron, but this needs a narrower implementation before salvage.
Problems
cron/scheduler.py:753changes the sameskip_memoryswitch that initializes both the built-in store (agent/agent_init.py:1333-1345) and external providers (agent/agent_init.py:1353-1417). Withfalse, cron gains local memory loading and write capability throughagent/tool_executor.py:1226; it does not retain the safety intent of the existing cron comment.tests/cron/test_scheduler_skip_memory.py:13-41tests a copied dictionary expression rather thancron.scheduler. Those tests pass without the production change, so they do not protect the behavior.- The behavior needs documentation:
website/docs/user-guide/features/spotify.md:218currently says cron usesskip_memory=Trueto avoid memory-store writes.
Suggested changes
- Separate external-provider tools from built-in memory read/write, or add explicit guards for the intended cron behavior.
- Test the real
run_job→AIAgentkwargs path and document the supported configuration.
Automated hermes-sweeper review.
| quiet_mode=True, | ||
| skip_context_files=True, # Don't inject SOUL.md/AGENTS.md from scheduler cwd | ||
| skip_memory=True, # Cron system prompts would corrupt user representations | ||
| skip_memory=_cfg.get("cron", {}).get("skip_memory", True), # Configurable; default True for backward compat |
There was a problem hiding this comment.
skip_memory is also the built-in MEMORY.md/USER.md gate: agent/agent_init.py:1333-1345 initializes that store and 1353-1417 initializes 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.
| class TestCronSkipMemoryConfig: | ||
| """Verify cron reads skip_memory from config.yaml.""" | ||
|
|
||
| def test_skip_memory_defaults_to_true(self): |
There was a problem hiding this comment.
These tests only evaluate a locally copied dict expression, so they pass on the base revision where cron/scheduler.py still hard-codes skip_memory=True. Please exercise run_job with a mocked AIAgent (or an imported production resolver) and assert the actual constructor kwarg.
…ousResearch#9825 by @nightq) Rebuilt on latest main (Bartok9 hygiene 2026-08-01). Original: NousResearch#52897
|
Thanks @nightq — you were the earliest to tackle this (Apr 14), and your PR correctly identified the hardcoded skip_memory=True as the problem. We ended up going further than a config toggle: PR #91447 (merged as ef04d84) enables memory for cron agents unconditionally, matching every other agent surface (MEMORY.md/USER.md load, memory tool on the schema), with |
Summary
Makes
skip_memoryconfigurable for cron jobs viaconfig.yaml, allowing external memory providers (mem0, etc.) to be used in scheduled tasks.Root Cause
cron/scheduler.pyhardcodedskip_memory=True, which prevented_memory_managerfrom being initialized. This meant external memory provider tools (mem0_search,mem0_conclude, etc.) were always unavailable in cron sessions.Fix
Changed line 753 to read
skip_memoryfromconfig.yamlundercron.skip_memory$, defaulting toTrue` for backward compatibility.Users can now add to their config:
Test Plan
Closes #9763