Skip to content

fix(cron): keep SOUL.md identity when workdir is unset (#16756) - #17509

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-d6134f06
Apr 29, 2026
Merged

fix(cron): keep SOUL.md identity when workdir is unset (#16756)#17509
teknium1 merged 2 commits into
mainfrom
hermes/hermes-d6134f06

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvages #16947 by @liuhao1024.

Summary

Cron jobs now keep the user's ~/.hermes/SOUL.md identity even when the job has no workdir. Closes #16756.

Root cause

cron/scheduler.py passes skip_context_files=not bool(_job_workdir). In _build_system_prompt, a single if 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: add load_soul_identity: bool = False kwarg; decouple SOUL.md loading from skip_context_files
  • cron/scheduler.py: pass load_soul_identity=True for all cron runs (kept skip_context_files=not bool(_job_workdir) unchanged)
  • scripts/release.py: AUTHOR_MAP entry for @liuhao1024
  • tests: regression coverage for both _build_system_prompt and cron wiring (with/without workdir)

Validation

Before After
Cron, no workdir, SOUL.md set falls back to DEFAULT_AGENT_IDENTITY uses SOUL.md
Cron, with workdir unchanged unchanged
batch_runner (load_soul_identity=False) SOUL.md skipped SOUL.md skipped

E2E verified: built real AIAgent with cron kwargs against a temp HERMES_HOME containing a marker SOUL.md, confirmed marker text in _build_system_prompt() output; negative control with load_soul_identity=False correctly 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.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 CRITICAL Supply Chain Risk Detected

This 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 modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

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.

@teknium1
teknium1 merged commit fd7188a into main Apr 29, 2026
10 of 12 checks passed
@teknium1
teknium1 deleted the hermes/hermes-d6134f06 branch April 29, 2026 15:10
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CRON tasks do not apply prompts defined in SOUL.md

3 participants