Skip to content

/schedule … pin (keeping the last two pinned), and a catch-all for unknown /words (/AAPL) - #51

Merged
robdevops merged 6 commits into
mainfrom
claude/schedule-pin
Dec 1, 2026
Merged

robdevops merged 6 commits into
mainfrom
claude/schedule-pin

Conversation

@robdevops

@robdevops robdevops commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

/schedule can pin what a run posts, so a monthly report stays at the top of the chat:

/schedule "/earnings" 2030-02-01 09:00 every month pin Family

Schedule

  • pin goes after the time and how often, or at the very end. It is saved (pin in schedules.json), listed (, pinned) and confirmed; where the chat's network can't pin, the confirmation says so ("unpinned: Signal can't pin posts").
  • A group whose name is or starts or ends with Pin ("Pin", "Team Pin") is still that group, unpinned: the words are tried as a whole group name first, then with one pin taken off (pin Team Pin pins into Team Pin).

Core

  • feature.Message.Pin on a delivered message becomes feature.Markup.Pin on whatever the core sends for it: a command's answer (respond), the model's reply, or the text posted as written (sendKept). A typed message never has it.
  • feature.Caps.Pin says which networks can pin.

Networks

Each pins the first message it sent, after sending, and only logs a refusal (the post is there anyway):

  • Telegram: pinChatMessage with disable_notification (the bot must be an administrator allowed to pin).
  • Discord: PUT /channels/{id}/messages/pins/{msg}, the older /pins/{msg} where that route is unknown (Pin Messages permission; README's invite list mentions it).
  • Slack: pins.add; pins:write added to the manifest, and a missing_scope is logged with what to do.
  • Signal: no pinning (no Caps.Pin).

Keeping two pinned

A schedule keeps its last two posts pinned: once a run's post is pinned, older ones it pinned are unpinned (this month's and last month's reports stay on top).

  • The schedule remembers the posts it pinned and hasn't unpinned (pinned in schedules.json, at most 10). A run passes all but the newest as Message.Unpin, which the core puts in Markup.Unpin with Markup.Pinned.
  • Only once the new post is pinned does the network unpin them (Telegram unpinChatMessage, Discord DELETE on the pins endpoint, Slack pins.remove), then call Pinned with the new post and those unpinned. A failed pin calls nothing, so nothing is forgotten; an earlier post already unpinned or deleted counts as unpinned; one that failed is asked again at the next run.
  • Pins the schedule didn't make are never touched.

/AAPL: a catch-all for unknown /words

  • A core port, Host.Fallback: once every hook has passed an addressed /word … whose word no command takes (feature.Commands.Has), the catch-all gets it, the word lowercased; a zero Action leaves the message as before (to the model, or a scheduled reminder posted as written).
  • A chat command's "fallback": true (a plain server's direct command; one across all servers, else a config error naming both) makes it the catch-all: /AAPL 1y runs as /profile aapl 1y, typed or scheduled (with pin too), with the command's timeout and the server's silent and link_texts. The call's _meta has io.github.robdevops.signalbot/fallback, so the server answers only words it knows; an empty result, an error or a busy server leaves the message as unknown, so typos still reach the model.
  • Never for a word that can't be a ticker (only letters, digits, . - ^ =, up to 32), a network's own (/start, /stop, /help, /settings, /menu, /cancel), or someone the command's allowed refuses.
  • docs/FILES_LINKS_TOOLS_MCP.md (the key), TECHNICAL.md (the port).

Docs

docs/SCHEDULING.md (usage and a bullet), README's Telegram, Discord and Slack setup, TECHNICAL.md, PRIVACY.md.

Review

Independent reviews found that the catch-all first took scheduled reminders starting with an unknown word, Telegram's /start, and words the server had nothing for, and named the fallback command in refusals (all fixed: such words now go on as unknown); and before that, that a group named Pin, Pin Club or Team Pin could no longer be scheduled into (one named just Pin silently went to the DM), that the confirmation said "signal" in lowercase, and that a failed pin or unpin made the schedule forget a still-pinned post (also when two runs were in flight); all fixed.

Tests

Schedule: both positions, saved, listed, delivered flag, Caps, groups named with Pin, four runs keeping two pinned, and a failed unpin asked again. Core: Unpin and Pinned passed on; the catch-all gets unknown /words only, not registered commands, a zero answer goes to the model, a scheduled one keeps Pin, a scheduled reminder it leaves is posted as written, a second catch-all refused. MCP: /AAPL 1y and BRK.B and ^GSPC through the fallback, its _meta, /start and non-tickers and empty results left alone, a refused user's word left alone, two fallbacks and a non-direct one config errors. Core: a command's answer, the text as written and the model's reply pinned for a delivered message with Pin; a typed command and one without, not. Telegram, Discord, Slack: the pin call on the first message, the unpin after it, Pinned told what was unpinned, nothing unasked, no unpin when the pin was refused, a refusal keeping the post. go vet and the toolchain's gofmt clean.

https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH


Generated by Claude Code

- A schedule may say pin, after the time and how often or after the group's name; it is saved, listed and
  confirmed (or the confirmation says the network can't pin).
- Message.Pin on a delivered message becomes Markup.Pin on whatever the core sends for it: a command's
  answer, the model's reply or the text as written. A typed message is never pinned.
- Telegram (pinChatMessage, no notice), Discord (the pins endpoint, the older one as a fallback) and Slack
  (pins.add; pins:write added to the manifest) pin the first message sent, and only log a refusal.
  Signal can't pin a bot's posts: Caps.Pin says which can.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
…s still that group; the network's name capitalised

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
… one before them

- A pinning schedule remembers the last two messages it pinned (pinned in schedules.json); a run passes the
  older as Message.Unpin once there are two, and the core puts it in Markup.Unpin.
- Telegram, Discord and Slack unpin it only after the new post was pinned.
- The core reports the pinned message to Message.Pinned, where the network can pin, and the schedule keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
@robdevops robdevops changed the title /schedule … pin: what a run posts is pinned where the network can /schedule … pin: a run's post is pinned, keeping the schedule's last two Dec 1, 2026
…ed unpin is tried again

- The network calls Markup.Pinned (from Message.Pinned) itself, only once the new post is pinned, with the
  earlier posts it unpinned; a failed pin calls nothing.
- A schedule remembers the posts it pinned and hasn't unpinned (at most 10), and each run asks to unpin all
  but the newest, so one that failed, or two runs in flight at once, catch up at the next run.
- An earlier post already unpinned or deleted counts as unpinned (Telegram not found, Discord 10008, Slack
  no_pin); another failure is a warning.
- TECHNICAL.md's saving note lists the pinned IDs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
… takes (/AAPL)

- A core port, Host.Fallback: once every hook has passed an addressed /word … whose word no command
  takes (Commands.Has), the catch-all gets it, the word lowercased; a zero answer leaves it to the model.
- A chat command's "fallback": true (direct only, one across all servers) makes it the catch-all:
  /AAPL 1y runs as /profile aapl 1y, typed or scheduled, with its allowed, timeout, silent and link_texts.
  Only a ticker-like word (letters, digits, . - ^ =, up to 32) goes to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
…unknown

- The fallback's call says so in its _meta (io.github.robdevops.signalbot/fallback); an empty result, an
  error or a busy server returns nothing, so the message goes to the model, or a scheduled reminder such
  as "/standup in 10" is posted as written, as before the catch-all.
- Never for a network's own words (/start, /stop, /help, /settings, /menu, /cancel), nor for someone the
  command's allowed refuses, whose word then goes on as unknown rather than naming the command.
- fallback is for a plain server's direct command (no addon block).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
@robdevops robdevops changed the title /schedule … pin: a run's post is pinned, keeping the schedule's last two /schedule … pin (keeping the last two pinned), and a catch-all for unknown /words (/AAPL) Dec 1, 2026
@robdevops
robdevops merged commit 46b802b into main Dec 1, 2026
1 check passed
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.

2 participants