P2 no_agent Cron Jobs Ignore Profile — Multi-Gateway HERMES_HOME Mismatch (#53077)
Executive Summary
For cron jobs with no_agent: true, the per-job profile field is never applied before the script runs. The no_agent short-circuit in cron/scheduler.py::run_job (~line 1633) executes the script and returns before reaching the profile→HERMES_HOME scoping block (~line 1735). In a multi-gateway setup, this means _run_job_script() resolves the script under whichever gateway process won the tick, not under the job's configured profile — making execution silently non-deterministic. This is the 7th distinct P0/P1/P2 cron subsystem bug we've tracked.
Root Cause Analysis
The no_agent Short-Circuit Gap
In cron/scheduler.py::run_job(), the execution flow is:
- ~line 1633:
if no_agent: _run_job_script(); return— script runs and function returns immediately - ~line 1735: Profile→HERMES_HOME override block — never reached for no_agent jobs
The profile scoping sits below the no_agent early-return. The comment above line 1730 explicitly warns the override must happen "BEFORE any prompt/skill loading or pre-run script execution" — and the no_agent short-circuit hits exactly the failure the comment warns about.
Multi-Gateway Failure Mode
Two gateways (profile A and B) share a root cron store. A no_agent job scoped to profile B's scripts/ dir fails non-deterministically:
- Gateway A wins the tick:
Script not found: <HERMES_ROOT>/profiles/A/scripts/my_script.py - The job's
profile: Bis silently ignored
Agent-backed jobs (no_agent: false) are unaffected — their path reaches the HERMES_HOME override block correctly.
Evidence
Impact Assessment
| Dimension | Severity | Detail |
|---|---|---|
| Multi-Gateway Reliability | HIGH | Silently non-deterministic — job succeeds or fails based on which gateway wins the tick |
| Profile Isolation | HIGH | Profile field is completely ignored for no_agent jobs — fundamental isolation gap |
| Fix Complexity | LOW | Hoist profile scoping above no_agent short-circuit; add finally to restore on early return |
| Cron Subsystem Health | CRITICAL | 7th distinct cron subsystem bug — scheduling, caching, security, plugin management, state isolation, and now profile scoping |
Proposed Fix
- Hoist profile scoping above the
no_agentshort-circuit inrun_job() - Add
finallyblock to restore original HERMES_HOME on the early-return path
PR: #53104 already open | Reporter willing to submit PR.
Cron Subsystem Bug History (7 Distinct Issues)
| Issue | Severity | Description |
|---|---|---|
| #41037 | P1 | Cron never fires — scheduling failure |
| #42197 | P2 | PluginManager crash during cron execution |
| #20586 | P2 | State leak between cron jobs |
| #44585 | P2 | Provider-state inheritance corruption |
| #51395 | P0 | Prompt-cache-cold on cron execution |
| #51976 | P2 | Gateway restart loop bypass via cron |
| #53077 | P2 | no_agent cron jobs ignore profile — multi-gateway HERMES_HOME mismatch |
⚠️ Pattern: The cron subsystem now has bugs in scheduling, caching, security, plugin management, state isolation, gateway restarts, and profile scoping. Seven distinct vectors across seven issues — suggesting the cron scheduler needs a fundamental architectural review rather than point fixes.
Source Evidence
- GitHub Issue: #53077 — no_agent Cron Jobs Ignore Profile
- Opened: June 26, 2026
- Reporter: @Anilkumar-Shrestha
- Labels: P2, bug, comp/cron, type/bug
- Hermes: v0.17.0 | OS: macOS
- PR: #53104 already open
📋 https://hermes-agent.reviews/hermes-no-agent-cron-profile-ignored-53077.html
Tracked by hermes-agent.reviews — June 26, 2026