Skip to content

fix(cron): mirror delivered job replies into chat sessions - #21441

Closed
huangrichao2020 wants to merge 1 commit into
NousResearch:mainfrom
huangrichao2020:fix/cron-delivery-session-mirror
Closed

fix(cron): mirror delivered job replies into chat sessions#21441
huangrichao2020 wants to merge 1 commit into
NousResearch:mainfrom
huangrichao2020:fix/cron-delivery-session-mirror

Conversation

@huangrichao2020

Copy link
Copy Markdown

Summary

Mirror successfully delivered cron job replies back into the target chat session.

On a long-running gateway, a scheduled job can deliver a message into Telegram/Matrix/Slack/etc., but the next normal message in that same chat may not have that cron reply in its session transcript. In practice that makes the agent look like it forgot the cronjob it just sent.

This keeps the fix small: after a delivery succeeds, reuse gateway.mirror.mirror_to_session() with source_label="cron". Failed deliveries do not write fake history. Media-only deliveries get a compact transcript placeholder so the chat at least remembers that the cronjob sent an attachment.

There is a larger draft in the same area (#10650). This PR is intentionally narrower and ready to review: it only covers the production footgun where delivered cron replies are invisible to follow-up chat context.

Validation

  • uv run --extra dev pytest tests/cron/test_scheduler.py::TestDeliverResultWrapping::test_successful_delivery_mirrors_to_target_session tests/cron/test_scheduler.py::TestDeliverResultWrapping::test_failed_delivery_does_not_mirror_to_target_session tests/cron/test_scheduler.py::TestDeliverResultWrapping::test_origin_delivery_preserves_thread_id -q
  • uv run --extra dev python -m py_compile cron/scheduler.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists labels May 7, 2026
@huangrichao2020 huangrichao2020 closed this by deleting the head repository Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants