Skip to content

fix(slack): render agent replies with native Markdown - #2932

Merged
Parker J. Rule (pjrule) merged 4 commits into
mainfrom
open-swe/slack-native-markdown
Sep 18, 2026
Merged

Parker J. Rule (pjrule) merged 4 commits into
mainfrom
open-swe/slack-native-markdown

Conversation

@pjrule

@pjrule Parker J. Rule (pjrule) commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Uses native Slack Markdown blocks for agent replies up to 12,000 characters, including language-tagged code fences, ephemeral answers, and option prompts. (Long ordinary replies fall back to mrkdwn.)

Motivated by a bug I saw when using Open SWE with Slack: code blocks in mrkdwn mode are rendered with non-breaking space characters, which generally produce code blocks that cannot be copy-and-pasted.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Comment thread agent/slack/markdown.py
Comment on lines +9 to +15
def markdown_to_mrkdwn(markdown: str) -> str:
"""Convert standard Markdown to Slack mrkdwn."""
output: list[str] = []
list_stack: list[tuple[bool, int]] = []
quote_depth = 0
item_prefix = ""
in_heading = False

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi I am not reading or testing this carefully, since this is just rough fallback handling for a pretty extreme edge case. if we actually encounter rendering issues on this path, we can revisit

@pjrule
Parker J. Rule (pjrule) marked this pull request as ready for review September 18, 2026 01:35

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Open SWE Review: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in Web • View Open SWE trace

@pjrule
Parker J. Rule (pjrule) merged commit d9a96c6 into main Sep 18, 2026
25 checks passed
@pjrule
Parker J. Rule (pjrule) deleted the open-swe/slack-native-markdown branch September 18, 2026 01:38
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.

2 participants