Skip to content

fix(msteams): forward messageBack card actions (Action.Submit) to agent (#60952)#2279

Open
BingqingLyu wants to merge 2 commits intomainfrom
fork-pr-64503-fix-msteams-messageback-card-action-60952
Open

fix(msteams): forward messageBack card actions (Action.Submit) to agent (#60952)#2279
BingqingLyu wants to merge 2 commits intomainfrom
fork-pr-64503-fix-msteams-messageback-card-action-60952

Conversation

@BingqingLyu
Copy link
Copy Markdown
Owner

@BingqingLyu BingqingLyu commented Apr 28, 2026

Summary

Forward Action.Submit messageBack activities to the agent instead of dropping them as empty messages. Closes openclaw#60952.

When a user clicks an Action.Submit button on an Adaptive Card in Teams, the click is sent as a messageBack activity (type="message" with empty text and a value object). The message handler strips mentions, finds empty text, and drops the message with "skipping empty message after stripping mentions." The value payload is never forwarded to the agent.

This change adds a check for activity.value before the empty-text drop at line 452 of message-handler.ts. If the value payload is a non-empty object, it serializes it as [CARD_ACTION] {json} so the agent receives the button payload. This is consistent with:

The detection pattern: activity.type === "message" && !text && activity.value && typeof activity.value === "object"

Test plan

Context

This is the companion fix to openclaw#55384/openclaw#60431 (Action.Execute). Together they cover both invoke formats Teams uses for Adaptive Card interactions. We've been running a sidecar HTTP proxy workaround for this since March 2026 — this fix eliminates the need for that sidecar for card actions.

🤖 Generated with Claude Code

ndholakia and others added 2 commits April 10, 2026 16:45
…nt (openclaw#60952)

When a user clicks an Action.Submit button on an Adaptive Card in Teams,
the click arrives as a messageBack activity (type="message" with empty
text and a value object). The message handler strips mentions, finds
empty text, and drops the message as "skipping empty message."

This change checks for activity.value before the empty-text drop. If
the value payload is a non-empty object, it serializes it as
`[CARD_ACTION] {json}` so the agent receives the button payload.

The detection pattern matches the existing invoke-proxy sidecar
workaround and is consistent with the adaptiveCard/action invoke
handling added in openclaw#60431.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…essageBack tests

The original adaptiveCard/action invoke test uses registered.run() which
requires the variable name. The three new messageBack tests call the mock
run() directly and only need registerMSTeamsHandlers for its side effect.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

[Feature]: MS Teams plugin should forward messageBack card actions (Action.Submit) to the agent

2 participants