Reconcile TagThread.post(): convertMarkdown opt-out + Block Kit blocks/unfurl suppression - #6
Merged
TheGreatAxios merged 1 commit intoAug 2, 2026
Conversation
…s/unfurl suppression Upstream added TagThreadPostOptions.convertMarkdown as an opt-out for the automatic mdToMrkdwn conversion on TagThread.post(). A downstream fork independently restructured the same method around Block Kit blocks and unfurlLinks/unfurlMedia suppression, dropping convertMarkdown entirely. Reconciles both into one TagThreadPostOptions carrying all four fields. The converted text (or the raw text, when convertMarkdown: false) now flows into both the plain thread.post() path and the Block Kit fallback text, so the opt-out protects a caller's already-native text whichever path it takes. Adds postBlockKitMessage + splitSlackThreadId to tag-slack, and a botToken WireOptions field to authenticate the direct chat.postMessage path the Chat SDK's own text-only thread.post() can't carry blocks through.
This was referenced Aug 2, 2026
TheGreatAxios
deleted the
cl-5066-corbits-tag-reconcile-tagthreadpost-convertmarkdown-opt-out
branch
August 2, 2026 20:41
This was referenced Aug 2, 2026
TheGreatAxios
added a commit
that referenced
this pull request
Aug 2, 2026
…lly work (#10) wireBot's WireOptions.botToken (added in #6 for the Block Kit reply path) was never threaded through from mountSlackTag, the package's actual entry point — a host using the mount, rather than calling wireBot directly, never saw the Block Kit / unfurl-suppression path activate at all; TagThread.post(text, { blocks }) silently degraded to plain text. Forward the same token the Slack adapter itself authenticates with, same pattern as the existing userLookup auto-wire.
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.
Summary
TagThreadPostOptions(added in Add mdToMrkdwn: convert outgoing markdown to Slack mrkdwn #5) carried onlyconvertMarkdown. A downstream fork independently restructuredTagThread.post()'s options around Block Kitblocks+unfurlLinks/unfurlMediasuppression, droppingconvertMarkdownin the process. This reconciles both into one options type carrying all four fields, rather than picking a side.tag-slack'stoTagThread().post()now computes the mrkdwn text once (convertMarkdown === false ? text : mdToMrkdwn(text)) and threads that same value into both the plainthread.post()path and the Block Kit fallbacktext— protecting only the plain path would leave the opt-out half-working, corrupting a caller's already-native text the moment it shipped inside a card instead of a plain reply.postBlockKitMessage(directchat.postMessagevia@chat-adapter/slack/api, since the Chat SDK's ownBotThread.post()is text-only and can't carryblocksthrough) and asplitSlackThreadIdhelper that parses the Chat SDK's${channelId}:${ts}thread id.botTokentoWireOptions, used only to authenticate the Block Kit reply path. Without a token,blocks/unfurl requests degrade to a plainthread.post(text)— a missing token must never block answering.Test plan
bun run typecheck && bun run testpackages/tag-slack/src/wire.test.ts: newwireBot Block Kit repliessuite covers blocks + bot token →chat.postMessage, unfurl suppression through the same Web API path, unfurl riding alongside blocks, both degrading gracefully without a bot token, an emptyblocks: []behaving as a plain post, and — the subtle case —convertMarkdown: falseprotecting the Block Kit fallbacktextfield, not just the plain-post path.