Skip to content

feat(cron): native action buttons on Telegram deliveries - #89359

Open
srosenlund wants to merge 1 commit into
NousResearch:mainfrom
srosenlund:feat/cron-delivery-choices
Open

feat(cron): native action buttons on Telegram deliveries#89359
srosenlund wants to merge 1 commit into
NousResearch:mainfrom
srosenlund:feat/cron-delivery-choices

Conversation

@srosenlund

Copy link
Copy Markdown

What does this PR do?

Cron workers never receive the clarify toolset, so scheduled jobs cannot render approval-style buttons today. This implements the preferred form of #78999: structured choices at delivery time, no wait in run_job, tap becomes a user turn in the continuable session.

A last-line envelope:

{"delivery_choices": ["vis bilag", "lav konteringspreview", "spring over"]}

is stripped from the visible message. A per-job delivery_choices list is the fallback when the model omits the envelope. Telegram attaches one inline button per label (cd: callbacks, no "Other"). Stale taps (superseded by a newer delivery for the same job, or older than 6 hours) fail visibly.

This is not cron.allow_clarify (mid-run block) and not journal buttons written to button_responses.jsonl.

Related Issue

Fixes #78999

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Changes Made

  • cron/delivery_choices.py — envelope parse, job fallback, pending store
  • cron/scheduler.py — strip envelope; send buttons via adapter.send_delivery_choices without waiting for a tap
  • cron/jobs.py, tools/cronjob_tools.py, hermes_cli/web_models.py, hermes_cli/web_server.py — optional delivery_choices field
  • plugins/platforms/telegram/adapter.pysend_delivery_choices + cd: callback injects MessageEvent
  • website/docs/user-guide/features/cron.md — Action buttons section
  • Tests: tests/cron/test_delivery_choices.py, tests/gateway/test_telegram_cron_delivery_choices.py, envelope-strip case in tests/cron/test_scheduler.py

How to Test

  1. PYTHONPATH=. python3.11 -m pytest tests/cron/test_delivery_choices.py tests/cron/test_scheduler.py::TestCronDeliveryMirror tests/gateway/test_telegram_cron_delivery_choices.py -q — 25 passed
  2. Create a Telegram-delivered continuable cron job with delivery_choices: ["Approve", "Skip"] (or have the agent end with the JSON envelope)
  3. Confirm the cron message has buttons, a tap continues the session with that label, and a second delivery expires the first job's buttons

Checklist

Code

Documentation & Housekeeping

  • I've updated relevant documentation (website/docs/user-guide/features/cron.md)
  • cli-config.yaml.example — N/A (job field, not a config key)
  • CONTRIBUTING.md / AGENTS.md — N/A
  • Cross-platform: pure Python, Telegram adapter only for native buttons; other platforms keep plain text
  • cronjob tool schema updated

Made with Cursor

Parse a last-line delivery_choices envelope (or a per-job fallback) at
send time, attach Telegram buttons without blocking the cron worker, and
inject the tap as a user turn in the continuable session. Closes NousResearch#78999.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management comp/plugins Plugin system and bundled plugins platform/telegram Telegram bot adapter labels Aug 18, 2026
@Balestrino

Copy link
Copy Markdown

+1 from a user with exactly this need: interactive reminders. My assistant schedules reminder crons and the delivered message should carry Done / Snooze / Stop choices; the fact that a tap becomes a normal user turn in the continuable session means my existing reminder-handling flow (a profile skill that maps choices to reschedule/delete via the cronjob tool) would pick it up unchanged.
Happy to test on a real multi-profile install

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/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron deliveries: native action buttons (Telegram inline keyboards / Discord components) for approval flows

3 participants