fix(slack): route HITL input-request prompts through GFM → mrkdwn conversion - #1528
Open
iroiro147 wants to merge 1 commit into
Open
fix(slack): route HITL input-request prompts through GFM → mrkdwn conversion#1528iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…version
Model-authored prompts in Slack HITL input-request widgets were being placed
into `{ type: "mrkdwn" }` blocks verbatim — `**bold**`, `__bold__`,
`~~strike~~`, and `[label](url)` rendered as literal punctuation instead of
formatting. The asymmetry with `thread.post(string)` (which converts via
eve's `gfmToSlackMrkdwn`) made every eve+Slack app rediscover the same
workaround.
`renderInputRequestBlocks` and `buildFreeformModalView` now both pass the
prompt through `gfmToSlackMrkdwn` before truncating, matching the behavior
of the rest of the Slack surface. Code fences and inline code are preserved
untouched by the fence-aware splitter already used elsewhere.
Includes regression coverage in `hitl.test.ts` for both the block-renderer
path and the modal path:
- `**bold**` and `*italic*` collapse to Slack's single-asterisk bold.
- `[label](url)` becomes Slack's `<url|label>` form.
- Backtick fences pass through untouched (no `**` inside ```` ``` ```` is
rewritten).
- Each path still declares `type: "mrkdwn"` on the resulting section.
Verified:
- `pnpm exec vitest run --config vitest.unit.config.ts src/public/channels/slack` — 15 files / 291 tests green
- `pnpm exec tsc -p tsconfig.json --noEmit` — clean
Closes vercel#1293
Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
Contributor
|
@iroiro147 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
What
Model-authored prompts in Slack HITL input-request widgets were being placed into
{ type: "mrkdwn" }blocks verbatim —**bold**,__bold__,~~strike~~, and[label](url)rendered as literal punctuation instead of formatting. The asymmetry withthread.post(string)(which converts via eve'sgfmToSlackMrkdwn) made every eve+Slack app rediscover the workaround.renderInputRequestBlocksandbuildFreeformModalViewnow both pass the prompt throughgfmToSlackMrkdwnbefore truncating, matching the rest of the Slack surface. Code fences and inline code are preserved untouched by the fence-aware splitter already used elsewhere.Why this approach
Eve already owns the right primitive —
gfmToSlackMrkdwninpackages/eve/src/public/channels/slack/mrkdwn.ts. It's used on the thread/post path and handles:**bold**and__bold__→*bold*~~strike~~→~strike~[label](url)→<url|label>(viaformatSlackLink)```code fences and single-backtick inline code are passed through untouchedRouting both HITL input-request surfaces through the same function removes the asymmetry the issue describes. Truncation stays after conversion so the limit applies to the rendered text, not the source markdown.
Tests
Adds two regression tests in
hitl.test.ts:renderInputRequestBlocks— asserts a mixed-GFM prompt produces a section block whose text collapses**bold**→*bold*, rewrites[label](url)→<url|label>, and leaves**...**inside a code fence untouched.buildFreeformModalView— same assertions against the modal prompt header.Both paths still declare
type: "mrkdwn"on the resulting section (verified).Full Slack surface suite:
pnpm exec tsc -p tsconfig.json --noEmitis clean.Linked issue
Closes #1293