Skip to content

fix: handle oversized Slack message edits - #9462

Closed
cong91 wants to merge 1 commit into
NousResearch:mainfrom
cong91:fix/slack-edit-msg-too-long
Closed

fix: handle oversized Slack message edits#9462
cong91 wants to merge 1 commit into
NousResearch:mainfrom
cong91:fix/slack-edit-msg-too-long

Conversation

@cong91

@cong91 cong91 commented Apr 14, 2026

Copy link
Copy Markdown

Summary

  • chunk oversized Slack edits before calling chat.update
  • reuse or delete overflow thread replies across repeated edits to avoid stale duplicates
  • keep overflow replies in the correct parent thread and bound in-memory tracking caches
  • add regression tests covering overflow splitting, repeated edits, thread-root handling, and cache pruning

Test Plan

  • . .venv/bin/activate && pytest tests/gateway/test_slack.py -q -o 'addopts='

- chunk long Slack edits before chat.update
- reconcile overflow reply chunks across repeated edits
- keep overflow replies in the correct thread
- add regression coverage for overflow edit behavior
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/slack Slack app adapter labels Apr 27, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the missing Slack chat.update length handling. The defect remains on current main: plugins/platforms/slack/adapter.py:1487-1501 passes formatted content directly to chat_update despite the 39,000-character limit at :421.

Problems

  • The patch targets gateway/platforms/slack.py, but 5600105478ffde29d7566b45421b100eaa29c4ef moved the live adapter to plugins/platforms/slack/adapter.py; this requires a port rather than a clean application.
  • A port must honor the current finalize contract. gateway/stream_consumer.py:1630-1661 passes it through, while Telegram and Discord keep one bounded preview during streaming and split only on final delivery (plugins/platforms/telegram/adapter.py:3946-3978, plugins/platforms/discord/adapter.py:2257-2279).
  • Preserve Slack's current final Block Kit behavior for single-chunk edits (plugins/platforms/slack/adapter.py:1493-1501) and disable it when overflow chunks are used, as send() already does at :1389-1403.

Suggested changes

  • Port the implementation/tests to the bundled Slack plugin and cover both finalize=False and finalize=True overflow behavior.
  • Return/track continuation IDs consistently with the stream consumer if final overflow changes the editable target.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #69317 (merged): targeted the pre-plugin-migration file; oversized-edit handling landed via #33224's reapply + block fallback.

Thanks for digging into this — the consolidated fix stands on the cluster's collective analysis, and your work is credited in #69317's summary.

@teknium1 teknium1 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/slack Slack app adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants