Skip to content

fix: escape mentions and HTML-ish chars in outbound message text#85

Merged
AmethystLiang merged 1 commit intomainfrom
fix/slack-mention-escape
Apr 29, 2026
Merged

fix: escape mentions and HTML-ish chars in outbound message text#85
AmethystLiang merged 1 commit intomainfrom
fix/slack-mention-escape

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

@AmethystLiang AmethystLiang commented Apr 29, 2026

Summary

  • agent-slack message send / edit previously forwarded user text raw to chat.postMessage, so @U05BRPTKL6A arrived as literal text (no ping) and bare </>/& were dropped/mangled by Slack.
  • Added formatOutboundSlackText to promote bare user IDs (@U…/@W…/@B…) and broadcasts (@here/@channel/@everyone) to real Slack tokens and HTML-escape literal &/</>, leaving already-formed <@…>, <#…>, <!…>, and <https://…> tokens intact.
  • Extended the rich_text inline parser to emit user/broadcast elements so list-style messages mention correctly too.
  • Skill note updated so downstream agents don't need to hand-wrap IDs.

Test plan

  • bun test (193 pass)
  • bun run typecheck
  • Manual send: agent-slack message send "#ci-alerts" "@U05BRPTKL6A heads up <fix> & go" renders as a real mention with escaped <fix> & &

Made with Orca 🐋

Slack's chat.postMessage expects user mentions as `<@u123>`, broadcasts
as `<!here>`, and literal `&`/`<`/`>` escaped as entities. Callers
(including LLMs piping CI output) routinely supply the raw forms, so
messages render with bare `@U...` instead of a real ping and with
unescaped `<fix>` swallowed by Slack.

Normalize outbound text in one place at the send/edit boundary, and
teach the rich_text inline parser to emit user/broadcast elements so
list-style messages mention correctly too.

Co-authored-by: Orca <help@stably.ai>
@AmethystLiang AmethystLiang merged commit 9705082 into main Apr 29, 2026
1 check passed
@AmethystLiang AmethystLiang deleted the fix/slack-mention-escape branch April 29, 2026 00:10
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