ductor icon indicating copy to clipboard operation
ductor copied to clipboard

[Feature]: Add --chat-id / --topic-id / --transport flags to cron_edit

Open Aut0-Mat opened this issue 6 months ago • 1 comments

Problem or motivation

The destination of a cron job's output (chat_id, topic_id, transport) is fixed at creation time, derived from the DUCTOR_CHAT_ID / DUCTOR_TOPIC_ID / DUCTOR_TRANSPORT env vars read by cron_add.py. There's no flag on cron_edit.py to redirect an existing cron to a different chat or topic.

Concrete use cases where this is painful:

  • I created a cron from topic A by mistake and want to redirect it to topic B
  • I'm reorganizing my Telegram topics and want to move several crons to new topics
  • I want to test a cron in a sandbox topic, then promote to production topic

Proposed solution

Add optional --chat-id, --topic-id, --transport flags to cron_edit.py (plus a --clear-topic-id for routing to the chat's main thread instead of a specific topic). Backward compatible: existing cron_edit invocations without these flags work exactly as before.

Validation idea: ensure the new chat_id / topic_id are accessible to the bot before writing, fail with a clear error rather than silently writing a broken config.

Alternatives considered

  • Direct JSON edit of ~/.ductor/cron_jobs.json (works thanks to hot-reload, but invisible to the tooling layer and no validation)
  • cron_remove + cron_add from the target topic (loses last_run_status history and forces re-writing TASK_DESCRIPTION.md)

Why this matters beyond my use case

Anyone reorganizing their Telegram topics or splitting/merging chats hits this. It's also a natural ergonomic gap in the CLI — every other relevant field is editable (schedule, model, provider, cli_parameters, quiet_start/end, dependency...), only the destination is stuck.

Before submitting

  • [x] I have searched existing issues and feature requests for duplicates.

Aut0-Mat avatar May 18 '26 16:05 Aut0-Mat

Shipped in v0.18.1. cron_edit now takes --chat-id, --topic-id, --transport, and --clear-topic-id to redirect an existing job to a different chat/topic/transport without recreating it (keeps run history). Thanks for flagging the gap.

Release: https://github.com/PleasePrompto/ductor/releases/tag/v0.18.1

PleasePrompto avatar Jun 13 '26 05:06 PleasePrompto