Skip to content

cronjob: script path resolution silently doubles scripts/ prefix and skips missing-file validation #26595

@aoife-brennan-bf

Description

@aoife-brennan-bf

Problem

When creating a cron job with action="create" and a relative script path like "scripts/ai-newsletter-aggregator.py", the cronjob tool resolves it by prepending ~/.hermes/profiles/<name>/scripts/, resulting in the path:

~/.hermes/profiles/<name>/scripts/ + scripts/ai-newsletter-aggregator.py
= ~/.hermes/profiles/<name>/scripts/scripts/ai-newsletter-aggregator.py

This causes two issues:

1. Silent double-directory trap

The user-provided path scripts/foo.py becomes scripts/scripts/foo.py with no warning. The correct relative path should be just foo.py, but this is non-obvious from the tool documentation.

2. No create-time validation

The cronjob tool accepts any string for script without checking the resolved path exists. No warning at create or update time. The failure only appears at runtime when the cron fires and the script is silently skipped, with only a late error message in the agent delivery.

Impact

  • Scripts appear to "vanish" or get lost between setup and execution
  • No feedback loop at configuration time to catch the mistake
  • Agent falls back to processing stale data when the data-collection script fails, masking the underlying issue

Proposed fixes

  1. Validate at create/update time: Check the resolved script path exists before accepting the cron job configuration. Fail or warn if the file is missing.

  2. Strip leading scripts/ prefix: If the user provides scripts/foo.py, normalize it to foo.py to prevent the double-directory trap. Or document clearly that the base dir is already scripts/.

  3. Support skill-based script references: Allow script to reference a skill-managed script (e.g., "skill:ai-newsletter-youtube-aggregator/scripts/ai-newsletter-aggregator.py"), eliminating the dual-directory drift problem. Currently scripts live in both ~/.hermes/profiles/<name>/scripts/ (for cronjob) and ~/.hermes/profiles/<name>/skills/<name>/scripts/ (for skills) with no sync.

Reproduction

cronjob(action="create", script="scripts/ai-newsletter-aggregator.py", ...)
# resolves to ~/.hermes/profiles/aoife/scripts/scripts/ai-newsletter-aggregator.py
# file does not exist, no error at create time
# cron fires, script silently skipped, agent reports "script not found" in delivery

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cronCron scheduler and job managementtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions