fix(cron): resolve profile-scoped jobs storage dynamically - #60882
Draft
rerdi92 wants to merge 5 commits into
Draft
fix(cron): resolve profile-scoped jobs storage dynamically#60882rerdi92 wants to merge 5 commits into
rerdi92 wants to merge 5 commits into
Conversation
3 tasks
tonydwb
reviewed
Jul 8, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (token read-only)
PR 60882 resolves profile-scoped jobs storage dynamically in cron. Fixes a profile isolation issue. Well-scoped (1 file, 125 additions, 17 deletions). No security issues or debug artifacts detected.
LGTM - awaiting maintainer approval.
Contributor
|
Thanks for the focused profile-storage investigation. The cron premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
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
cron.jobsstorage follows the activeHERMES_HOMEoverride without requiringimportlib.reload().JOBS_FILE/CRON_DIRprofile-scoping leak by routing runtime cron IO through dynamic path helpers.cron.scheduler._build_job_prompt()socontext_fromreads upstream job output from the active profile's output directory.Root cause
cron/jobs.pycapturedHERMES_DIR,CRON_DIR,JOBS_FILE,OUTPUT_DIR, and ticker marker paths at module import time. In a long-lived process, later profile-scoped work usingset_hermes_home_override()could continue writing to the first profile's cron paths.A follow-up review found one adjacent stale-path use in
cron/scheduler.py:context_fromprompt injection imported the publicOUTPUT_DIRconstant directly, so chained cron jobs could skip upstream output stored under the active profile after a runtime home override.Test plan
tests/cron/test_jobs.py::TestProfileScopedJobStorage::test_job_store_follows_active_hermes_home_without_module_reloadfailed because profile B'scron/jobs.jsonwas not created.tests/cron/test_cron_context_from.py::TestBuildJobPromptContextFrom::test_context_from_follows_runtime_home_override_after_importfailed because_build_job_prompt()did not inject profile-scoped upstream output.Notes
While testing on Windows, two unrelated portability issues were observed outside this patch scope and split to #60888:
tests/cron/test_file_permissions.pyexpects strict POSIX mode bits on Windows/NTFS.tests/cron/test_cron_workdir.py::test_tilde_expandsassumes patchedHOMEcontrolsPath("~").expanduser()on Windows.