NousResearch/hermes-agent

Cron origin misidentified as live gateway sender

Cluster 22351. Data as of

Nothing open on GitHub. Fix merged in #22382 on 9 May 2026. Check it covers your case.

The short answer

0open issues
0open PRs
3items grouped
Known?
Yes. 3 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #22382. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this resolved, deciding PR #22382. That is separate from the fix event.
Still open
Nothing open on GitHub.

These items address a bug where cron delivery origin was incorrectly seeding or being treated as a live gateway sender identity, affecting tool access-control and session context variables.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #22382 fix(cron): do not seed HERMES_SESSION_* contextvars from cron origin (salvage of #22356)

    merged to main

    files: cron/scheduler.py, scripts/release.py

    Show the diff
    • cron/scheduler.py
      @@ -1204,10 +1204,31 @@ def run_job(job: dict) -> tuple[bool, str, str, Optional[str]]:
           # don't clobber each other's targets (os.environ is process-global).
           from gateway.session_context import set_session_vars, clear_session_vars, _VAR_MAP
       
      +    # Cron execution is an internal scheduler context, not a live inbound
      +    # gateway message. Do not seed HERMES_SESSION_* contextvars from the
      +    # stored ``origin`` (which is delivery routing metadata, not a sender
      +    # identity). Several tool consumers branch on these vars during job
      +    # execution and would otherwise behave as if a real user from the
      +    # origin chat was driving the agent:
      +    #   - tools/terminal_tool.py: background-process notification routing
      +    #     (notify_on_complete / watch_patterns) reads HERMES_SESSION_PLATFORM
      +    #     and HERMES_SESSION_CHAT_ID to populate watcher_platform / chat_id,
      +    #     which would route completion notifications to the origin chat
      +    #     instead of via HERMES_CRON_AUTO_DELIVER_* below.
      +    #   - tools/tts_tool.py: picks Opus vs MP3 based on
      +    #     HERMES_SESSION_PLATFORM == "telegram".
      +    #   - tools/skills_tool.py + agent/prompt_builder.py: per-platform
      +    #     skill-disable lists and the system-prompt cache key both consume
      +    #     HERMES_SESSION_PLATFORM.
      +    #   - tools/send_message_tool.py: mirror source labelling and the
      +    #     send_message gate read HERMES_SESSION_PLATFORM.
      +    # Cron output delivery itself reads job["origin"] directly via
      +    # _resolve_origin(job) and the HERMES_CRON_AUTO_DELIVER_* vars set
      +    # below, so clearing HERMES_SESSION_* here does not affect delivery.
           _ctx_tokens = set_session_vars(
      -        platform=origin["platform"] if origin else "",
      -        chat_id=str(origin["chat_id"]) if origin else "",
      -        chat_name=origin.get("chat_name", "") if origin else "",
      +        platform="",
      +        chat_id="",
      +        chat_name="",
           )
           _cron_delivery_vars = (
               "HERMES_CRON_AUTO_DELIVER_PLATFORM",
    • scripts/release.py
      @@ -909,6 +909,7 @@
           "[redacted:email]": "firefly",  # PR #18123 salvage of #16660 (ContextVars)
           "[redacted:email]": "WuTianyi123",  # PR #20275 salvage of #13723 (feishu markdown)
           "[redacted:email]": "hanzckernel",  # PR #20311 (api-server approval events)
      +    "[redacted:email]": "oferlaor",  # PR #22356 salvage (cron origin sender identity)
           # pander: empty email, salvaged via PR #19665 from #16126 by @ms-alan
       }
       

1 PR closed without merging

From the close comments: merged via another change 1

  • #22356 fix(cron): do not treat delivery origin as live gateway sender identity · merged via another change → dbafa08, #22382, #22351
Closed issues · 1
  • Closed#22351Cron delivery origin should not seed live gateway sender identity for tool access-control
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.67: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Merged PRs
#22382
Closed issues
1
Attempts
1 PR closed without merging
Fix link checked
9 May 2026

For your agent

The same facts, typed.