fix(cron): allow per-job memory_enabled so cron jobs can opt into the memory system - #34098
fix(cron): allow per-job memory_enabled so cron jobs can opt into the memory system#34098liuhao1024 wants to merge 1 commit into
Conversation
… memory system Closes NousResearch#34094 The cron scheduler previously hardcoded skip_memory=True for all jobs, blocking legitimate use cases like nightly fact-mining or preference reads. This change adds a memory_enabled field (default False) to the job config so individual jobs can opt in. - cron/jobs.py: add memory_enabled param to create_job(), store in dict - cron/scheduler.py: read memory_enabled from job config - tools/cronjob_tools.py: expose memory_enabled in cronjob tool create/update
|
Hi @liuhao1024 — opened #45769 which provides the default safe behavior (memory reads ON by default, writes blocked at dispatch sites). It explicitly complements your per-job |
|
Thanks for the review on #45769! Updated the guard to check This keeps automated protection while allowing interactive memory cleanup — complements your per-job |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the hard-coded cron memory exclusion; current main still passes skip_memory=True at cron/scheduler.py:3073.
Problems
- The changed
cronjob()parameter is not usable by the model tool as submitted:CRONJOB_SCHEMAhas nomemory_enabledproperty (tools/cronjob_tools.py:989-1088), and the registered handler does not forward it (tools/cronjob_tools.py:1119-1144). - The PR changes no tests.
tests/cron/test_scheduler.py:960-1004already captures AIAgent kwargs and is the natural place to cover absent/false/true job values. - The user-facing statement that cron uses
skip_memory=Trueremains inwebsite/docs/user-guide/features/spotify.md:218.
Suggested changes
- Add schema and handler forwarding for
memory_enabled, then test creation, update, and the scheduler's resultingskip_memoryvalue. - Document the default-disabled per-job opt-in.
This is an automated hermes-sweeper review.
| workdir: Optional[str] = None, | ||
| profile: Optional[str] = None, | ||
| no_agent: Optional[bool] = None, | ||
| memory_enabled: Optional[bool] = None, |
There was a problem hiding this comment.
Adding this Python parameter alone does not expose it to the model: CRONJOB_SCHEMA currently has no memory_enabled property and the registered handler does not forward it to cronjob (tools/cronjob_tools.py:989-1144). Please add both wiring points and a regression test.
|
Thanks @liuhao1024 — per-job memory_enabled was a solid design. We went with the simpler global flip in PR #91447 (merged as ef04d84): cron agents get memory unconditionally like every other agent, with the user-level |
What does this PR do?
The cron scheduler hardcoded
skip_memory=Truefor all cron jobs, disabling the entire memory system (holographic memory, fact_store, memory tool). This blocked legitimate use cases:Solution
Add a
memory_enabledfield (defaultFalse) to the cron job config. The scheduler reads it at runtime:Users opt in per job:
Backward compatible — existing jobs continue to run with memory disabled by default.
Related Issue
Fixes #34094
Type of Change
Changes Made
cron/jobs.pymemory_enabledparam tocreate_job(), store in job dictcron/scheduler.pymemory_enabledfrom job config instead of hardcodingTruetools/cronjob_tools.pymemory_enabledincronjob()create/update actionsHow to Test
pytest tests/ -q— all tests should passChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture and workflows — or N/ACode Intelligence
cron/scheduler.py:_run_job_impl(single call site forskip_memory),cron/jobs.py:create_job(job schema),tools/cronjob_tools.py:cronjob(user-facing tool)skip_context_filesalready follows the same per-job opt-in pattern (not bool(_job_workdir))Changes
cron/jobs.pymemory_enabledparam tocreate_job(), store in job dictcron/scheduler.pymemory_enabledfrom job config instead of hardcodingTruetools/cronjob_tools.pymemory_enabledincronjob()create/update actionsTesting
tests/cron/test_scheduler.py— 128 passed ✅tests/cron/test_jobs.py— 87 passed ✅tests/tools/test_cronjob_tools.py— 56 passed ✅