Skip to content

Reconcile TagThread.post(): convertMarkdown opt-out + Block Kit blocks/unfurl suppression - #6

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5066-corbits-tag-reconcile-tagthreadpost-convertmarkdown-opt-out
Aug 2, 2026
Merged

Reconcile TagThread.post(): convertMarkdown opt-out + Block Kit blocks/unfurl suppression#6
TheGreatAxios merged 1 commit into
mainfrom
cl-5066-corbits-tag-reconcile-tagthreadpost-convertmarkdown-opt-out

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • TagThreadPostOptions (added in Add mdToMrkdwn: convert outgoing markdown to Slack mrkdwn #5) carried only convertMarkdown. A downstream fork independently restructured TagThread.post()'s options around Block Kit blocks + unfurlLinks/unfurlMedia suppression, dropping convertMarkdown in the process. This reconciles both into one options type carrying all four fields, rather than picking a side.
  • tag-slack's toTagThread().post() now computes the mrkdwn text once (convertMarkdown === false ? text : mdToMrkdwn(text)) and threads that same value into both the plain thread.post() path and the Block Kit fallback text — 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.
  • Adds postBlockKitMessage (direct chat.postMessage via @chat-adapter/slack/api, since the Chat SDK's own BotThread.post() is text-only and can't carry blocks through) and a splitSlackThreadId helper that parses the Chat SDK's ${channelId}:${ts} thread id.
  • Adds botToken to WireOptions, used only to authenticate the Block Kit reply path. Without a token, blocks/unfurl requests degrade to a plain thread.post(text) — a missing token must never block answering.

Test plan

  • CI: bun run typecheck && bun run test
  • packages/tag-slack/src/wire.test.ts: new wireBot Block Kit replies suite 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 empty blocks: [] behaving as a plain post, and — the subtle case — convertMarkdown: false protecting the Block Kit fallback text field, not just the plain-post path.
  • Not run locally (sandboxed dev machine); tests will run in this repo's CI.

…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.
@TheGreatAxios
TheGreatAxios merged commit ac42906 into main Aug 2, 2026
1 check passed
@TheGreatAxios
TheGreatAxios deleted the cl-5066-corbits-tag-reconcile-tagthreadpost-convertmarkdown-opt-out branch August 2, 2026 20:41
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.
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.

1 participant