Skip to content

msteams: implement Teams AI agent UX best practices #51806

@SidU

Description

@SidU

Summary

Microsoft has published mandatory requirements and best practices for bots that use AI in Teams. The OpenClaw Teams extension should implement these to provide a first-class agent experience.

What needs to change

Mandatory (per MS guidelines)

  • AI-generated label: Add AIGeneratedContent entity and channelData.feedbackLoopEnabled to all outbound messages so Teams renders the "AI generated" badge
  • Streaming responses (1:1 only): Use the Teams streaminfo entity protocol to progressively update messages as the LLM generates tokens, instead of waiting for the full response
  • Welcome card / prompt starters: Send an Adaptive Card with example prompts when the bot is added to a conversation
  • App manifest: Add copilotAgents.customEngineAgents node and set manifestVersion to devPreview

Best practices

  • Feedback buttons with reflective learning: Enable Teams' native thumbs up/down UI. On negative feedback, run a background reflection where the agent reviews its response and derives learnings for future context injection
  • Feedback persistence: Log feedback events to session JSONL (type: "custom", event: "feedback") for offline mining and quality analysis

Infrastructure

  • Add updateActivity REST helper to the custom adapter for streaming support
  • Add from field to outbound activities from the process handler context
  • New config fields: welcomeCard, promptStarters, groupWelcomeCard, feedbackEnabled, feedbackReflection, feedbackReflectionCooldownMs

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerMaintainer-authored PR

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions