Skip to content

fix(slack): broaden bold-text zero-width-space guard to all non-word chars - #35144

Closed
gonzalofrancoceballos wants to merge 1 commit into
NousResearch:mainfrom
gonzalofrancoceballos:fix/slack-bold-truncation-v2
Closed

fix(slack): broaden bold-text zero-width-space guard to all non-word chars#35144
gonzalofrancoceballos wants to merge 1 commit into
NousResearch:mainfrom
gonzalofrancoceballos:fix/slack-bold-truncation-v2

Conversation

@gonzalofrancoceballos

Copy link
Copy Markdown

Slack's mrkdwn parser silently truncates messages when a closing * follows a non-word character — not just )]} but also ., :, —, etc.

Previously only guarded against )]}. Now guards against any character that isn't alphanumeric or underscore by inserting a zero-width space (U+200B) before the closing *.

…chars

Slack's mrkdwn parser silently truncates messages when a closing *
follows a non-word character — not just )]} but also ., :, —, etc.
Previously only handled )]}. Now guards against any character that
isn't alphanumeric or underscore.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/gateway Gateway runner, session dispatch, delivery labels May 30, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for tracking the Slack formatting edge case. The corresponding formatter is still present on current main, but this patch no longer targets the active code.

Problems

  • gateway/platforms/slack.py was renamed to plugins/platforms/slack/adapter.py by 5600105478ffde29d7566b45421b100eaa29c4ef; the active unguarded bold conversion is now at plugins/platforms/slack/adapter.py:1982-1987. GitHub currently reports this PR as conflicting.
  • No regression test covers punctuation-ending bold text or the expected U+200B insertion. Existing coverage at tests/gateway/test_slack.py:2172-2173 only checks **hello**.
  • Headers also emit *{inner}* at plugins/platforms/slack/adapter.py:1967-1973; a punctuation-ending heading would retain the same delimiter pattern.

Suggested changes

  • Salvage the change into the plugin formatter and add focused formatter tests for punctuation, word-character controls, and—if intended—headers.

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 13, 2026
teknium1 pushed a commit that referenced this pull request Jul 23, 2026
…d chars

Slack's mrkdwn parser can fail to recognize the closing * of a bold span
when it is immediately preceded by a non-word character (), ], }, ., :,
em-dash, ...), mis-rendering the span and in reported cases truncating
the rest of the message.  Insert a zero-width space (U+200B) between the
last character and the closing * whenever the last character is not
alphanumeric or underscore.

Reapplied from #35144 by @gonzalofrancoceballos — the original patched
gateway/platforms/slack.py, which was migrated to
plugins/platforms/slack/adapter.py in the plugin migration.
teknium1 pushed a commit that referenced this pull request Jul 23, 2026
…d chars

Slack's mrkdwn parser can fail to recognize the closing * of a bold span
when it is immediately preceded by a non-word character (), ], }, ., :,
em-dash, ...), mis-rendering the span and in reported cases truncating
the rest of the message.  Insert a zero-width space (U+200B) between the
last character and the closing * whenever the last character is not
alphanumeric or underscore.

Reapplied from #35144 by @gonzalofrancoceballos — the original patched
gateway/platforms/slack.py, which was migrated to
plugins/platforms/slack/adapter.py in the plugin migration.
teknium1 pushed a commit that referenced this pull request Jul 23, 2026
…d chars

Slack's mrkdwn parser can fail to recognize the closing * of a bold span
when it is immediately preceded by a non-word character (), ], }, ., :,
em-dash, ...), mis-rendering the span and in reported cases truncating
the rest of the message.  Insert a zero-width space (U+200B) between the
last character and the closing * whenever the last character is not
alphanumeric or underscore.

Reapplied from #35144 by @gonzalofrancoceballos — the original patched
gateway/platforms/slack.py, which was migrated to
plugins/platforms/slack/adapter.py in the plugin migration.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #70191 — your commit was cherry-picked/reapplied onto current main with your authorship preserved in git history: your ZWSP bold guard was reapplied — premise note: no prior guard existed, yours ADDS it.

Thanks for the contribution!

@teknium1 teknium1 closed this Jul 23, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…d chars

Slack's mrkdwn parser can fail to recognize the closing * of a bold span
when it is immediately preceded by a non-word character (), ], }, ., :,
em-dash, ...), mis-rendering the span and in reported cases truncating
the rest of the message.  Insert a zero-width space (U+200B) between the
last character and the closing * whenever the last character is not
alphanumeric or underscore.

Reapplied from NousResearch#35144 by @gonzalofrancoceballos — the original patched
gateway/platforms/slack.py, which was migrated to
plugins/platforms/slack/adapter.py in the plugin migration.
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