#6084

Slack: compaction notices post as two permanent messages; add showCompactionNotices (or edit in place)

Openccaryotakisopened 24d ago

On nanobot v0.3.5 with the Slack channel (Socket Mode), every context compaction posts two separate messages into the conversation: "Compressing context…" and then "Context compacted." With idleCompactAfterMinutes set, this happens in every DM that goes idle, so users regularly see these system messages between their real conversations.

Telegram and Discord edit the first notice in place (#5720), and QQ drops the notices by default with showCompactionNotices to turn them back on (#5784). The Slack channel has neither, so each ContextCompactionEvent is posted as a new message by the Slack send.

Request (either or both):

  1. Add showCompactionNotices to SlackConfig (default false, like QQ) and skip ContextCompactionEvent messages in the Slack send when it is off.
  2. When notices are shown, update the first message with chat.update instead of posting a second one, matching the Discord behavior from #5720.

We'd like to keep compaction running at its current frequency and only stop the messages; option 1 alone would cover our case.

Environment: nanobot v0.3.5 (Docker), Slack Socket Mode, DMs only.

Activity

3
maxmilian22d ago

This looks already handled on main (not yet released): #5780 (merged 2026-09-30) made show_compaction_notices default to false for every built-in channel, and the Slack sender now skips automatic ContextCompactionEvent notices unless they're enabled. v0.3.5 (2026-09-15) predates that change, which is why you still see both messages. After the next release the default gives you option 1; channels.showCompactionNotices: true in config.json (or a per-channel showCompactionNotices) turns them back on — see docs/configuration.md. Option 2 (editing one message in place via chat.update) isn't implemented for Slack yet.

akushonkamen21d ago

Happy to pick this up. As noted above, option 1 (skip compaction notices by default) already landed on main via #5780 but hasn't been released yet, so I'll leave that behavior as is. I'll implement option 2 — when notices are shown (event.notify or show_compaction_notices), update the original started message in place with chat.update instead of posting a second one, matching the Discord behavior from #5720 — and open a PR shortly.

akushonkamen21d ago

I've opened #6110 implementing option 2 only (the compaction outcome notice now edits the start notice in place via chat.update, mirroring the Discord channel), so please confirm this covers the intent before closing.