Skip to content

Cron Job Identification

There is no cron_job_id kwarg in any hook.

The extraction strategy: when platform == "cron", the session_id follows the format cron_{job_id}_{YYYYMMDD_HHMMSS} (confirmed in cron/scheduler.py:1392).

Anchored regex (R4): ^cron_(?P<job_id>.+)_\d{8}_\d{6}$

A naive split("_")[1] would break on job IDs that contain underscores (e.g., cron_my_job_2_20260101_120000 → job_id would be my instead of my_job_2). The regex captures everything between the leading cron_ and the trailing _{8digits}_{6digits}.

On mismatch, a WARNING is logged and cron_job_id is set to NULL — surfaced loudly rather than silently wrong. The comment # If this test breaks... is an intentional canary.

hermes-telemetry is an independent community plugin for Hermes Agent. It is not affiliated with or endorsed by Nous Research.