Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cron/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,18 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option

from tools.send_message_tool import _send_to_platform
from gateway.config import load_gateway_config, Platform
from gateway.mirror import mirror_to_session

# Optionally wrap the content with a header/footer so the user knows this
# is a cron delivery. Wrapping is on by default; set cron.wrap_response: false
# in config.yaml for clean output.
wrap_response = True
mirror_to_session_enabled = False
try:
user_cfg = load_config()
wrap_response = user_cfg.get("cron", {}).get("wrap_response", True)
cron_cfg = user_cfg.get("cron", {})
wrap_response = cron_cfg.get("wrap_response", True)
mirror_to_session_enabled = cron_cfg.get("mirror_to_session", False)
except Exception:
pass

Expand Down Expand Up @@ -723,6 +727,10 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option

if adapter_ok:
logger.info("Job '%s': delivered to %s:%s via live adapter", job["id"], platform_name, chat_id)
# Mirror cron output to target session so the main agent
# sees it in conversation history on next user message.
if mirror_to_session_enabled:
mirror_to_session(platform_name, chat_id, content, source_label="cron", thread_id=thread_id)
delivered = True
except Exception as e:
logger.warning(
Expand Down Expand Up @@ -757,6 +765,10 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option
continue

logger.info("Job '%s': delivered to %s:%s", job["id"], platform_name, chat_id)
# Mirror cron output to target session so the main agent
# sees it in conversation history on next user message.
if mirror_to_session_enabled:
mirror_to_session(platform_name, chat_id, content, source_label="cron", thread_id=thread_id)

if delivery_errors:
return "; ".join(delivery_errors)
Expand Down
6 changes: 6 additions & 0 deletions hermes_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,12 @@ def _ensure_hermes_home_managed(home: Path):
# 1 = serial (pre-v0.9 behaviour).
# Also overridable via HERMES_CRON_MAX_PARALLEL env var.
"max_parallel_jobs": None,
# Mirror cron delivery output to the target session's SQLite transcript.
# When true, the main agent sees cron messages (prefixed with
# "[Delivered from cron]") in conversation history on the next user
# message, enabling cross-session awareness without manual lookup.
# Default: false (no mirror, original behaviour).
"mirror_to_session": False,
},

# Kanban multi-agent coordination — controls the dispatcher loop that
Expand Down