Skip to content

fix(mrkdwn): strip Slack angle-bracket URL syntax from model output#502

Closed
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/bold-markers-in-slack-url-brackets
Closed

fix(mrkdwn): strip Slack angle-bracket URL syntax from model output#502
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/bold-markers-in-slack-url-brackets

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The model sometimes outputs Slack mrkdwn <URL> syntax instead of bare URLs or Markdown links. This collides with bold markers — **<https://url**> gets the closing ** absorbed inside the angle brackets, so Slack parses the URL as https://url**.

Observed in production: this thread.

Fix

Strip <URL> syntax in renderSlackMrkdwn before delivery:

  • <https://url>https://url
  • <https://url|label>[label](https://url)

Bare URLs auto-link in the Slack markdown block. Removing the angle-bracket syntax eliminates the collision surface entirely.

Verification

27 unit tests pass. Typecheck clean.


View Session in Sentry

Action taken on behalf of Nick Meisenheimer.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 3, 2026 2:58pm

Request Review

@sentry-junior sentry-junior Bot force-pushed the fix/bold-markers-in-slack-url-brackets branch from 617fe45 to 25dc36b Compare June 3, 2026 14:48
@sentry-junior sentry-junior Bot force-pushed the fix/bold-markers-in-slack-url-brackets branch from 25dc36b to 0ffa437 Compare June 3, 2026 14:57
@sentry-junior sentry-junior Bot changed the title fix(mrkdwn): repair bold markers absorbed inside Slack URL angle brackets fix(mrkdwn): strip Slack angle-bracket URL syntax from model output Jun 3, 2026
…kets

When the model formats a bold PR link, it sometimes generates
`**<https://url**>` instead of `**<https://url>**`, absorbing the
closing bold marker inside the angle brackets. Slack then parses the
URL as `https://url**` — a broken link.

Add a post-processing regex in `renderSlackMrkdwn` that detects and
repairs this pattern before the message is sent. Also add a prompt
rule to explicitly tell the model not to place bold markers inside
Slack angle-bracket URLs.

Refs: https://sentry.slack.com/archives/C03USURCFBJ/p1780496988280239

Co-authored-by: Nick Meisenheimer <nicholas.meisenheimer@sentry.io>

Co-authored-by: David Cramer <david@sentry.io>
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.

0 participants