fix(mrkdwn): strip Slack angle-bracket URL syntax from model output#502
Closed
sentry-junior[bot] wants to merge 1 commit into
Closed
fix(mrkdwn): strip Slack angle-bracket URL syntax from model output#502sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
617fe45 to
25dc36b
Compare
25dc36b to
0ffa437
Compare
…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>
0ffa437 to
8392501
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ashttps://url**.Observed in production: this thread.
Fix
Strip
<URL>syntax inrenderSlackMrkdwnbefore 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.