Skip to content

fix: Hermes cron jobs with deliver: yui reach her wherever they were made - #2194

Merged
yw0nam merged 3 commits into
mainfrom
fix/2187-hermes-cron-deliver
Nov 30, 2026
Merged

yw0nam merged 3 commits into
mainfrom
fix/2187-hermes-cron-deliver

Conversation

@yw0nam

@yw0nam yw0nam commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

The YUI platform plugin now registers cron_deliver_env_var="YUI_HOME_CHANNEL" with Hermes, so Hermes treats yui as a cron delivery platform.

integrations/hermes/platform/yui/__init__.py   ctx.register_platform(..., cron_deliver_env_var="YUI_HOME_CHANNEL")
  └─ Hermes cron/scheduler_delivery.py         _is_known_delivery_platform("yui") → True
                                               _get_home_target_chat_id("yui") → $YUI_HOME_CHANNEL, else config.yaml platforms.yui.home_channel

Before, Hermes resolved a deliver: yui job made outside a YUI chat to no target, and its preflight (cron/scheduler_preflight.py:351) blocked every deliver: yui job as "not a known cron delivery target". Why YUI_HOME_CHANNEL: it is the name Hermes already derives for the platform (gateway/run.py:1532-1541, f"{NAME}_HOME_CHANNEL"), so /sethome and profile cloning see no change.

Behaviour for existing users (measured on Hermes v0.23.2 by the reviewer with a throwaway HERMES_HOME):

  • deliver: yui: reaches her from any surface; preflight passes.
  • deliver: all: now includes her when a home channel exists.
  • deliver: origin with no origin: may fall back to her, after the 16 built-in home-target platforms and other plugin platforms.
  • deliver: origin for a job made inside a YUI chat: unchanged (resolves to the origin before any home lookup).
  • Hermes's dashboard Cron page lists yui as a delivery target.

Related issues

Closes #2187

Part of #2188

Related decisions / docs

  • integrations/hermes/platform/yui/docs/behaviour.md: the home-channel bullet states deliver: yui, deliver: all, and the variable's cron-only override.
  • integrations/hermes/platform/yui/docs/map.js: the register-platform edge carries the new field.

Runtime evidence (required for UI / DOM / runtime behavior)

Red test: bash scripts/red-run.sh d0c910b4 → red test_the_platform_registers_a_cron_home_channel_so_deliver_yui_reaches_her … AssertionError: assert None == 'YUI_HOME_CHANNEL'.

Hermes resolution with this branch's plugin registered through its own register(ctx) (installed Hermes Agent v0.23.2, commit ae2a81ccc00, throwaway HERMES_HOME, home channel written by persist_home_channel, no env var):

Telegram job, deliver yui -> [{'platform': 'yui', 'chat_id': 'yui-chat-1', 'thread_id': None, '_resolved_from': 'home'}]
CLI job, deliver yui      -> [{'platform': 'yui', 'chat_id': 'yui-chat-1', 'thread_id': None, '_resolved_from': 'home'}]

On main the same two jobs resolve to [] (issue #2187, table under "Actual behavior").

A cron result sent while the client is away goes through send → _deliver → _send_render, which holds it until the client connects (src/transport/adapter.py:615-623). A live gateway run with a connected client was not made for this PR.

Merge danger

Door: two-way (a revert removes the field; no stored key or contract changes).
Blast radius: Hermes cron delivery to the yui platform only; deliver: all jobs start speaking through her.

Verification

  • pnpm build passes (includes tsc typecheck)
  • pnpm test passes
  • pnpm lint passes (biome format + lint)
  • cargo test / cargo clippy pass (Rust changes) — no Rust change; gates skipped them
  • Runtime evidence attached above, or N/A justified
  • uv run pytest in integrations/hermes/platform/yui: 389 passed

Checklist (YUI principles)

  • Schema changes update docs/reference/client-context.md alongside the code — no schema change
  • docs/agent-guide/architecture/map.js carries every module, part, and exchange this PR adds, removes, or changes (or none changed) — app map unchanged; the plugin map edge updated
  • No unverified assumptions (docs first; web/context7 cross-check)
  • No brain in the client — judgment and mode live in the backend; persona text is client configuration (firing ≠ judgment)
  • No inline control tags — emotion/motion only via generate_express tool-call arguments
  • No hardcoding — endpoints/models/paths live in configs/
  • New/changed behavior ships a test in this PR (or skip-tests label justified)

Review: one independent reviewer (single tier). Its five checks passed; two wording findings were applied (cron-only override, deliver: all). Rejected: "the adapter drops the cron result when no client is connected" — _send_frame drops only frames sent directly (tool_status); a cron result goes through _send_render, which holds it (src/transport/adapter.py:615-623).

@yw0nam
yw0nam marked this pull request as ready for review November 30, 2026 07:55
@yw0nam
yw0nam merged commit a9e8f53 into main Nov 30, 2026
12 checks passed
@yw0nam
yw0nam deleted the fix/2187-hermes-cron-deliver branch November 30, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Hermes cron jobs made outside a YUI conversation never reach her

1 participant