Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Slack adapter: cardToBlockKit sends headers over 150 chars, so Slack rejects the message

Closed Beginner friendly
#1,016 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1018 by @armancharan — closed without merging
  • #1040 by @roboeve — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start in cardToBlockKit in the Slack adapter (the issue cites dist/index.js, so check whether the source file under src is the one to edit). It builds the header, section and button text fields without length limits. Run the repro with a 400-character title and a 5000-character text child, then confirm the header is cut to 150, section text to 3000 and button labels to 75. Done means the truncated blocks are accepted by Slack's limits, the cut ends in an ellipsis, and surrogate pairs are not split.

Written by the indexing model from the issue text.

Description

What happens

cardToBlockKit in @chat-adapter/slack (dist/index.js) puts card.title in a header block, a text child in a section, and button labels in button elements, without checking Slack's limits. A card whose title is over 150 characters, whose text is over 3000, or whose button label is over 75 fails as a whole message:

invalid_blocks: must be less than 151 characters [json-pointer:/blocks/0/text/text]

Checked on 4.39.0 and 4.41.1.

Repro
import { cardToBlockKit } from "@chat-adapter/slack";
const blocks = cardToBlockKit({ type: "card", title: "q".repeat(400), children: [{ type: "text", content: "b".repeat(5000) }] });
// blocks[0].text.text.length === 400; posting these blocks with chat.postMessage returns invalid_blocks
Suggested fix

Cut header text to 150, section text to 3000 and button text to 75, ending in "…", and back up one unit when the cut would split a surrogate pair (emoji). Callers that need the full text can still put it in the body. This came from Paperclip, which hit it with long agent questions: https://github.com/paperclipai/paperclip/issues/15647

Dominant language
TypeScript
Stars
2.4k
Forks
329
Avg merge
2d 1h
Merged PRs (30d)
61

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/chat

All issues in vercel/chat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.