fix(channels): support display cards (send_card) in Chat SDK bridge#2265
Merged
glifocat merged 4 commits intoqwibitai:mainfrom May 5, 2026
Merged
fix(channels): support display cards (send_card) in Chat SDK bridge#2265glifocat merged 4 commits intoqwibitai:mainfrom
glifocat merged 4 commits intoqwibitai:mainfrom
Conversation
The send_card MCP tool wrote outbound rows with type='card' but the
chat-sdk-bridge deliver() had no branch for them, so the payload fell
through to the text fallback (where text is undefined) and silently
returned without calling the adapter. delivery.ts then marked the
message delivered with platformMsgId=undefined and the user saw nothing.
Add a dedicated card branch mirroring the ask_question structure:
- Build Card from title, description, and string-or-{text} children
- Render only URL actions as LinkButtons (send_card is fire-and-forget
per its docstring, so callback buttons would have nowhere to land)
- Drop empty cards with a warn log instead of posting blank
- Fall back text: content.fallbackText > description > title
Affects every Chat SDK adapter that goes through the bridge: Discord,
Telegram, Slack, Teams, GChat, GitHub, Linear, WhatsApp Cloud, iMessage,
Matrix, Webex, Resend.
Tests: adds five cases covering normal render, action filtering,
link-button rendering, empty-card skip, and a regression check that
non-card chat-sdk payloads still flow through the text branch.
Closes qwibitai#2263
Collaborator
Author
|
Format check now passes after This PR's own tests pass: |
This was referenced May 5, 2026
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.
Type of Change
Description
send_card(the MCP tool exposed bycontainer/agent-runner/src/mcp-tools/interactive.ts) was a silent no-op on every Chat SDK channel becausechat-sdk-bridge.ts:deliver()had no branch forcontent.type === 'card'. The payload fell through to the text fallback, wheretextwas undefined and the function returned without calling the adapter.delivery.tsthen marked the message delivered withplatformMsgId=undefinedand the user saw nothing.This PR adds the missing branch, mirroring the structure of the existing
ask_questionbranch.How it works
When a
chat-sdkoutbound row hascontent.type === 'card':Cardfromcard.title,card.description, andcard.children(string or{ text }shapes both supported)card.actions, render only entries with aurlasLinkButtons inside anActionsrow. Non-URL actions are dropped becausesend_cardis fire-and-forget per its tool docstring ("renders a structured card and returns immediately — it does not pause your turn or collect a response"); a callback button would have nowhere to landcontent.fallbackText→card.description→card.title→ emptyHow it was tested
pnpm exec vitest run src/channels/chat-sdk-bridge.test.ts→ 12/12 passing (5 new + 7 existing)pnpm run typecheck→ cleanBackward compatibility
No risk. Pre-fix card payloads in existing outbound DBs were already marked
delivered(the bridge returnedundefined, whichdelivery.tstreats as success). They will not be re-delivered after the fix.Scope
Affects every Chat SDK adapter that goes through the bridge: Discord, Telegram, Slack, Teams, GChat, GitHub, Linear, WhatsApp Cloud, iMessage, Matrix, Webex, Resend.
Closes #2263