fix(msteams): forward messageBack card actions (Action.Submit) to agent (#60952)#2279
Open
BingqingLyu wants to merge 2 commits intomainfrom
Open
fix(msteams): forward messageBack card actions (Action.Submit) to agent (#60952)#2279BingqingLyu wants to merge 2 commits intomainfrom
BingqingLyu wants to merge 2 commits intomainfrom
Conversation
…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>
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
Forward
Action.SubmitmessageBack activities to the agent instead of dropping them as empty messages. Closes openclaw#60952.When a user clicks an
Action.Submitbutton on an Adaptive Card in Teams, the click is sent as a messageBack activity (type="message"with empty text and avalueobject). 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.valuebefore the empty-text drop at line 452 ofmessage-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:adaptiveCard/actioninvoke handling added in fix(msteams): handle Adaptive Card Action.Submit invoke activities openclaw/openclaw#60431 (which handlesAction.Execute)fileConsent/invokehandling added in fix(msteams): handle fileConsent/invoke callback for bot-to-user file upload (#55386) openclaw/openclaw#64087The detection pattern:
activity.type === "message" && !text && activity.value && typeof activity.value === "object"Test plan
Action.Submitbuttons to a Teams DM[CARD_ACTION] {"key":"value"}as the message bodyAction.Executeinvoke path (fix(msteams): handle Adaptive Card Action.Submit invoke activities openclaw/openclaw#60431) is unaffectedContext
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