fix(cron): keep SOUL.md identity when workdir is unset (#16756) - #17509
Merged
Conversation
Contributor
🚨 CRITICAL Supply Chain Risk DetectedThis PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging. 🚨 CRITICAL: Install-hook file added or modifiedThese files can execute code during package installation or interpreter startup. Files: Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting. |
This was referenced Apr 29, 2026
This was referenced May 10, 2026
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.
Salvages #16947 by @liuhao1024.
Summary
Cron jobs now keep the user's
~/.hermes/SOUL.mdidentity even when the job has noworkdir. Closes #16756.Root cause
cron/scheduler.pypassesskip_context_files=not bool(_job_workdir). In_build_system_prompt, a singleif not self.skip_context_files:gated BOTH SOUL.md (HERMES_HOME-scoped) AND AGENTS.md/.cursorrules (cwd-scoped). Workdir-less cron jobs lost SOUL.md as collateral damage of the #7958 cwd-pollution guard, even though SOUL.md is never cwd-scanned.Changes
run_agent.py: addload_soul_identity: bool = Falsekwarg; decouple SOUL.md loading fromskip_context_filescron/scheduler.py: passload_soul_identity=Truefor all cron runs (keptskip_context_files=not bool(_job_workdir)unchanged)scripts/release.py: AUTHOR_MAP entry for @liuhao1024_build_system_promptand cron wiring (with/without workdir)Validation
load_soul_identity=False)E2E verified: built real
AIAgentwith cron kwargs against a temp HERMES_HOME containing a marker SOUL.md, confirmed marker text in_build_system_prompt()output; negative control withload_soul_identity=Falsecorrectly falls back to default identity.Targeted tests pass:
tests/run_agent/test_run_agent.py::TestBuildSystemPrompt tests/cron/test_cron_workdir.py::TestRunJobTerminalCwd(10/10).Closes #16756. Supersedes #16981.