hermes-agent/tests/cron
Ben Barclay 76d832d385
fix(cron): deliver to relay-fronted platforms via canonical home_channel (#84300)
Cron jobs targeting a relay-fronted logical platform (e.g. Discord behind
the relay connector) failed twice over:

1. Target resolution read only the legacy <PLATFORM>_HOME_CHANNEL env
   mirror. The canonical home_channel block that /sethome persists to
   config.yaml — the only store that exists in a relay-fronted deployment,
   where no native env var is exported — was never consulted, so
   deliver='discord' silently resolved to nothing and the job fell back
   to local-only.

2. Even with a resolved target, the delivery loop's native
   configured/enabled gate rejected the platform ('not configured/enabled')
   although resolve_delivery_transport had already produced a live relay
   transport fronting it. A relay-fronted platform is deliberately NOT
   natively enabled (its credential lives in the connector), so the native
   gate must not apply to a relay transport.

Resolution now falls back from the env mirror to
config.get_home_channel(platform) for both chat_id and thread_id (thread
affinity only when the chat id came from the same config block), which
also makes the 'all' routing token pick up relay-fronted platforms. The
delivery gate honours a resolved relay transport, mirroring the
enablement rule resolve_delivery_transport already applied; the standalone
(no-relay) path keeps the historical gate byte-identical.
2026-08-12 14:48:54 +10:00
..
__init__.py
conftest.py
test_blueprint_catalog.py
test_claim_job_for_fire.py
test_codex_execution_paths.py
test_compute_next_run_last_run_at.py
test_cron_context_from.py
test_cron_direct_api_call_62151.py
test_cron_direct_api_call_watchdog.py
test_cron_inactivity_timeout.py
test_cron_kanban_env_isolation.py
test_cron_no_agent.py
test_cron_profile_isolation.py
test_cron_prompt_injection_skill.py
test_cron_provider_pin.py
test_cron_script.py
test_cron_workdir.py
test_cronjob_schema.py
test_execution_ledger.py
test_file_permissions.py
test_idle_tick_config_skip.py
test_jobs.py
test_jobs_changed_notify.py
test_jobs_crossprocess_lock.py
test_jobs_file_ownership.py
test_jobs_shrink_merge_80624.py
test_monitor_kind.py
test_notepad.py
test_parallel_pool.py
test_preflight_config.py
test_reasoning_config_per_model.py
test_relay_fronted_delivery.py
test_rewrite_skill_refs.py
test_run_one_job.py
test_scheduler.py
test_scheduler_cron_session_isolation.py
test_scheduler_mcp_init.py
test_scheduler_provider.py
test_scheduler_shutdown_guard.py
test_script_claim_heartbeat.py
test_sessiondb_init_hang.py
test_shutdown_interrupt.py
test_suggestions.py
test_terminal_cwd_lock.py
test_ticker_stall_60703.py
test_usage_audit_logger.py