Skip to content

feat: don't reply to commands queued while the bot was offline (per-command opt-in) - #39

Merged
sg merged 1 commit into
mainfrom
fix/queued-command-backlog
Jul 6, 2026
Merged

feat: don't reply to commands queued while the bot was offline (per-command opt-in)#39
sg merged 1 commit into
mainfrom
fix/queued-command-backlog

Conversation

@sg

@sg sg commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What changed

  • Detection: messages the radio queued while the bot was down are exactly those drained between start_auto_message_fetching() and the first NO_MORE_MSGS event. The bot now marks that window; CommandContext.from_queue flags each message. Failsafe: window force-closes after 60s if the end marker never arrives.
  • Per-command flag: new process_queued column in command_config (NULL = script default) + PROCESS_QUEUED module attr (default False = ignore backlog). Editable via web Manage→Commands (queued checkbox) and the existing PATCH API; shown as queued-ok in !adm command list.
  • Skipped commands are still ingested/stored — only the reply is suppressed; skips are logged and counted in the drain-complete log line.
  • First DB migration hook (DB._migrate): adds the column to existing databases.
  • Docs (Bot_Usage, example-bot-command) + 9 new tests (suite: 104 passing).

Why

On startup the bot rapid-fire replied to hours-old queued commands; !path answered 'direct (no path)' since queued messages carry no routing path.

Breaking changes

Behavior: backlog commands are now ignored by default (opt back in per command).

🤖 Generated with Claude Code

@sg
sg merged commit d2a6cbb into main Jul 6, 2026
1 check passed
@sg
sg deleted the fix/queued-command-backlog branch July 6, 2026 04:17
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