Teams adapter: support native feedback buttons + textual feedback on outgoing messages

Open
#1,163 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@domoniccassidy is already working on this.

Since Nov 14, 2026.

  • #1164 by @domoniccassidy — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
40/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start with the aiGenerated handling added in #1028 and follow it through postMessage, postChannelMessage, editMessage, postEphemeral and stream in packages/adapter-teams/src/index.ts, then look at registerEventHandlers for the event subscriptions. Add a feedbackButtons option that calls addFeedback() on those send paths, and register the message.submit.feedback route to dispatch message_feedback through chat.processAction. Done means a flagged message shows thumbs buttons in Teams and a click reaches bot.onAction, which needs confirming against Teams SDK behaviour.

Written by the indexing model from the issue text.

Description

enhancement
Problem Statement

Microsoft Teams shows thumbs up and thumbs down buttons on a bot message when the activity's channelData includes feedbackLoop: { type: "default" }. The Teams SDK sets this with addFeedback() on MessageActivity and MessageActivityInput. After a click, Teams asks the user for an optional comment, then sends the bot an invoke activity named message/submitAction, with value.actionValue.reaction set to "like" or "dislike" and the comment in value.actionValue.feedback as a JSON string ({"feedbackText":"..."}).

The Teams adapter supports neither half. Outgoing activities are built in postMessage, postChannelMessage, editMessage, postEphemeral, and stream in packages/adapter-teams/src/index.ts, and no postable field reaches channelData. For incoming activities, registerEventHandlers subscribes to message, messageUpdate, messageReaction, card.action, dialog.open, dialog.submit, conversationUpdate, and installationUpdate, so a feedback click never reaches chat.

The Slack adapter already has native feedback buttons through its feedbackButtons option, with clicks dispatched through bot.onAction("message_feedback"). Teams bots have no equivalent, so we can't collect ratings on model-written replies in Teams the way we do in Slack.

Proposed Solution

Follow the aiGenerated field added in #1028. Add an optional feedbackButtons field to PostableRaw, PostableMarkdown, PostableAst, PostableCard, StreamingPlanOptions, and StreamOptions, documented as shown by adapters that support feedback buttons per message (currently Teams):

export interface PostableMarkdown {
  /** Mark the message as AI-generated. Adapters with a native AI label (currently Teams) show it; others ignore it. */
  aiGenerated?: boolean;
  /** File/image attachments */
  attachments?: Attachment[];
  /** Show native thumbs up/down feedback buttons. Adapters that support them per message (currently Teams) show them; others ignore it. */
  feedbackButtons?: boolean;
  /** Files to upload */
  files?: FileUpload[];
  /** Markdown text, converted to platform format */
  markdown: string;
}

When feedbackButtons is true, the Teams adapter calls addFeedback() on every send path that already applies the AI label, including raw Adaptive Cards, the buffered stream, and each chunk emitted to the native streamer. The streamer merges every chunk's channelData into the final message, so the buttons appear once the stream finishes. As with aiGenerated, an edit replaces the whole activity, so it has to set the flag again.

For clicks, register the Teams SDK's message.submit.feedback route and dispatch through chat.processAction with the same defaults as the Slack adapter: the action ID "message_feedback" and the value "positive" or "negative". Put the comment in ActionEvent.values.feedback when the user typed one, and the rated message's ID in messageId (from replyToId). Returning nothing from the route makes the SDK answer the invoke with the empty 200 that Teams expects. Because the route is registered on the SDK App, Bot Framework token verification still runs before the handler.

Sharing Slack's action ID and values means one handler serves both platforms.

Alternatives Considered

No response

Use Case
// A model-written answer with feedback buttons
await thread.post({ markdown: answer, aiGenerated: true, feedbackButtons: true });

// A streamed answer
await thread.post(
  new StreamingPlan(result.fullStream, { aiGenerated: true, feedbackButtons: true })
);

// One handler for Teams and Slack feedback
bot.onAction("message_feedback", async (event) => {
  await recordFeedback(event.messageId, event.value, event.values?.feedback);
});

// Static messages such as help or errors get no buttons
await thread.post("Sorry, something went wrong. Please try again.");
Priority

Nice to have

Contribution
  • I am willing to help implement this feature
Additional Context

No response

Dominant language
TypeScript
Stars
2.5k
Forks
355
Avg merge
2d 15h
Merged PRs (30d)
42

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.