Skip to content

feat(messages): cancel, edit and send now a scheduled message - #3139

Merged
leemour merged 2 commits into
mainfrom
feat/scheduled-actions
Nov 19, 2026
Merged

leemour merged 2 commits into
mainfrom
feat/scheduled-actions

Conversation

@leemour

@leemour leemour commented Nov 19, 2026

Copy link
Copy Markdown
Member

Task

Owner's decision NEED-2692 A (2026-11-19): add cancel, edit (text and/or time) and send now for scheduled messages, released on npm.

Why

The owner had to cancel a scheduled group post by hand in the Telegram app. tg could schedule (messages send --at-time) and list (messages scheduled <chat>), nothing else. A scheduled message has ids of its own: messages edit <chat> 3 on one failed with MESSAGE_ID_INVALID, and messages delete <chat> 3 would have deleted the real, old group message #3.

What

  • messages scheduled cancel <chat> <scheduled-id...>, messages scheduled edit <chat> <scheduled-id> [text] [--at-time <time>] [--md], messages scheduled send <chat> <scheduled-id...>, under the existing messages scheduled <chat> (which still lists). The argument is named <scheduled-id>, and the help says the same number in the history is another message. messages delete and messages edit help point to the scheduled commands.
  • Every id is checked against the chat's scheduled list before any write. An unknown id is not_found and names messages scheduled <chat>.
  • An edit always passes the time to the adapter (the current one when only the text changes); Telegram needs schedule_date to read the id as scheduled. --at-time alone moves it and reads no stdin; it is parsed by the same sendTime as messages send --at-time.
  • Guard: keys messages.scheduled.cancel (journaled as delete, in the --allow-dangerous set), messages.scheduled.edit (edit), messages.scheduled.send (message, counted per id). At most 10 ids at once, like delete.
  • Port: optional group ScheduledChanges (cancelScheduled, editScheduled, sendScheduled); the kit fake implements it. max and wa get "this messenger cannot …" (wa has no scheduled group at all; lacks refuses before connecting).
  • Entities: scheduled_cancellation, scheduled_send; edit answers message_write with scheduled_for.
  • MCP search breaks a tie by the shorter command name, so "send message" still finds messages send before messages scheduled send.
  • cli-base 0.122.0 (dev), which registers scheduled as a resource word (feat(standards): scheduled is a resource as well as a view cli-base#659), so cli-dev lint passes the group.

Deviations from the brief

  • send-now is send: cli-dev lint allows only vocabulary verbs (unknown-verb).
  • Cancel mirrors messages delete as the code has it today, not "ask + --yes": messages.delete defaults to allow (owner, 2026-11-14) and its yes flag is --allow-dangerous. Cancel has the same: no question at the default level, --allow-dangerous at ask. Agents may cancel (nobody else has seen the message); the profile levels govern.

Testing

  • src/cli/messenger/messages-scheduled.test.ts: list still works; cancel by scheduled id, refusal of a sent message's id before any write, journal entry; ask level with --allow-dangerous, read-only refusal; edit keeps the time; --at-time only reads no stdin; empty edit refused; send now answers the new ids; refusal without the capability, and before connecting with lacks.
  • lacks, entities, MCP exposure snapshot, MCP search, command lint; typecheck, docs:check, schema:check locally.

🤖 Generated with Claude Code

leemour and others added 2 commits November 19, 2026 05:16
messages scheduled cancel <chat> <scheduled-id...>, messages scheduled edit
<chat> <scheduled-id> [text] [--at-time] and messages scheduled send <chat>
<scheduled-id...> (owner's NEED-2692 A). A scheduled message has ids of its
own: messages edit on one failed with MESSAGE_ID_INVALID, and messages
delete with the same number would have deleted an old, sent message. Each
command checks every id against the chat's scheduled list before it writes.

Cancel is journaled and asked as a delete (--allow-dangerous at ask), send
as a send, edit as an edit, under messages.scheduled.cancel/.edit/.send. An
edit always passes the time, the current one when only the text changes.
The adapter side is the optional port group ScheduledChanges; the fake
adapter implements it. The MCP search breaks a tie by the shorter command
name, so "send message" still finds messages send first. cli-base 0.122.0
registers scheduled as a resource for cli-dev lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour force-pushed the feat/scheduled-actions branch from 3ee4e09 to ea6cf22 Compare November 19, 2026 04:18
@leemour
leemour merged commit be24bc2 into main Nov 19, 2026
103 of 107 checks passed
@leemour
leemour deleted the feat/scheduled-actions branch November 19, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant