Repository navigation
/schedule … pin (keeping the last two pinned), and a catch-all for unknown /words (/AAPL) - #51
Merged
Merged
Conversation
- 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
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/schedulecan pin what a run posts, so a monthly report stays at the top of the chat:Schedule
pingoes after the time and how often, or at the very end. It is saved (pininschedules.json), listed (, pinned) and confirmed; where the chat's network can't pin, the confirmation says so ("unpinned: Signal can't pin posts").pintaken off (pin Team Pinpins into Team Pin).Core
feature.Message.Pinon a delivered message becomesfeature.Markup.Pinon 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.Pinsays which networks can pin.Networks
Each pins the first message it sent, after sending, and only logs a refusal (the post is there anyway):
pinChatMessagewithdisable_notification(the bot must be an administrator allowed to pin).PUT /channels/{id}/messages/pins/{msg}, the older/pins/{msg}where that route is unknown (Pin Messages permission; README's invite list mentions it).pins.add;pins:writeadded to the manifest, and amissing_scopeis logged with what to do.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).
pinnedinschedules.json, at most 10). A run passes all but the newest asMessage.Unpin, which the core puts inMarkup.UnpinwithMarkup.Pinned.unpinChatMessage, DiscordDELETEon the pins endpoint, Slackpins.remove), then callPinnedwith 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./AAPL: a catch-all for unknown/wordsHost.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)."fallback": true(a plain server's direct command; one across all servers, else a config error naming both) makes it the catch-all:/AAPL 1yruns as/profile aapl 1y, typed or scheduled (withpintoo), with the command's timeout and the server'ssilentandlink_texts. The call's_metahasio.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.. - ^ =, up to 32), a network's own (/start,/stop,/help,/settings,/menu,/cancel), or someone the command'sallowedrefuses.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 vetand the toolchain'sgofmtclean.https://claude.ai/code/session_01RsqJny87LfkxT9UwQbuAsH
Generated by Claude Code