Skip to content

feat(slack): format replies as mrkdwn - #161

Merged
owainlewis merged 3 commits into
mainfrom
codex/159-slack-mrkdwn
Jul 27, 2026
Merged

feat(slack): format replies as mrkdwn#161
owainlewis merged 3 commits into
mainfrom
codex/159-slack-mrkdwn

Conversation

@owainlewis

Copy link
Copy Markdown
Owner

Summary

  • convert model-generated Markdown to Slack mrkdwn with pulldown-cmark
  • preserve code contents, escape Slack control characters, and convert headings, links, quotes, and lists
  • format before chunking while keeping each long chunk bounded and independently valid
  • leave Telegram and other channel formatting unchanged

Closes #159

Verification

  • cargo fmt --all --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo build --locked
  • cargo test --locked (348 unit tests, 1 docs test, 12 CLI tests, 3 crash/recovery tests)
  • focused formatter, chunk-boundary, long-link, literal-marker, and Slack channel tests rerun after review fixes
  • git diff --check

Review

Independent subagent review covered Slack mrkdwn semantics, escaping, code delimiters, link delimiters, 4,000-character chunk boundaries, and channel isolation. All actionable findings were addressed. Final re-review: approved with no remaining actionable findings.

Risk

Live Slack rendering was not available locally. The conversion follows Slack developer documentation and is covered at the outbound payload boundary.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e16e3ca4f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/slack.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddf33292b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/slack.rs
@owainlewis
owainlewis merged commit a0c87df into main Jul 27, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b61d6f9697

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/slack.rs
Comment on lines +745 to +746
for character in readable_link(&rendered).chars().rev() {
tokens.push_front(character.to_string());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retokenize oversized link fallbacks before splitting

When an oversized Markdown link is converted by readable_link, this loop queues its escaped URL one character at a time, bypassing the atomic &/</> tokenization performed earlier. If an escaped control character in that fallback crosses the 4,000-character boundary—for example, a long URL placing & at the boundary—the messages end in & and begin with amp;, corrupting the displayed URL. The fresh evidence beyond the previously fixed entity case is this post-tokenization oversized-link fallback path; retokenize the readable text rather than enqueueing individual characters.

Useful? React with 👍 / 👎.

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.

Add a Slack-specific mrkdwn formatter

1 participant