Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
70d8e14
feat(frontend): add Microsoft Teams to the channel platform lists
mmabrouk Nov 9, 2026
6fa024e
feat(frontend): add the Microsoft Teams setup screen
mmabrouk Nov 9, 2026
bcd4124
docs(docs): add the Connect Microsoft Teams guide
mmabrouk Nov 9, 2026
bc5b390
fix(frontend): name Teams group chats apart from channels and reuse s…
mmabrouk Nov 9, 2026
b90bcd4
fix(frontend): say chats for Teams places in the read settings card
mmabrouk Nov 9, 2026
e9077fe
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 9, 2026
428834f
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 9, 2026
6cb4223
fix(docs): say the Teams app is uploaded once, and shorten three comm…
mmabrouk Nov 9, 2026
c10aa1a
fix(frontend): name a new Teams connection after its agent
mmabrouk Nov 17, 2026
7b80a92
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 17, 2026
d051269
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 17, 2026
ce15b1c
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 17, 2026
80ccb15
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 17, 2026
9536f31
feat(frontend): move the Teams setup strings into the i18n catalogs
mmabrouk Nov 17, 2026
7e98f2f
Merge remote-tracking branch 'origin/feat/teams-channel-adapter' into…
mmabrouk Nov 17, 2026
4e98701
fix(frontend): keep the plural key order in the catalogs and inline t…
mmabrouk Nov 17, 2026
3c3cc81
Merge branch 'feat/teams-channel-adapter' into feat/teams-channel-setup
mmabrouk Nov 17, 2026
f1fcca4
Merge branch 'feat/teams-channel-adapter' into feat/teams-channel-setup
mmabrouk Nov 17, 2026
96fee6f
style(frontend): format the merged channel files
mmabrouk Nov 17, 2026
244fb11
Merge branch 'feat/teams-channel-adapter' into feat/teams-channel-setup
mmabrouk Nov 17, 2026
c58548d
fix(frontend): tell unnamed Teams chats apart, and list Discord in th…
mmabrouk Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions docs/docs/guides/16-connect-microsoft-teams.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: "Connect an agent to Microsoft Teams"
sidebar_label: "Connect Microsoft Teams"
description: "Put an Agenta agent in Microsoft Teams, so people can chat with it in a personal chat, a group chat, or a team channel."
---

Connect a Teams bot to an agent, and the agent answers people in Microsoft Teams: in personal chats, in group chats, and in team channels. You set this up in three places: the Teams Developer Portal, where you register the bot; Agenta, where you connect it; and Teams, where you install the app.

The bot is your own. Agenta does not offer a shared Teams bot.

## Before you start

You need:

- **A Microsoft 365 work or school account** in the organization (tenant) where people will use the agent.
- **Permission to upload custom apps in Teams.** If your organization blocks this, see [Troubleshooting](#troubleshooting).

## 1. Register the bot

1. Open the [Teams Developer Portal](https://dev.teams.microsoft.com/bots).
2. Go to **Tools**, then **Bot management**, and select **New bot**. Give it a name, such as `Support agent`, and add it.
3. On the bot's **Client secrets** page, add a client secret. Copy the secret's value. The portal shows it only once.
4. Copy the bot's app ID. It is on the bot page.

To register the bot in the Azure portal instead, create an [Azure Bot resource](https://learn.microsoft.com/azure/bot-service/abs-quickstart) with the type **Single Tenant**, then [turn on the Microsoft Teams channel](https://learn.microsoft.com/azure/bot-service/channel-connect-teams) for it. The client secret and the app ID come from the bot's app registration.

## 2. Find your tenant ID

Open the [Microsoft Entra admin center](https://entra.microsoft.com). The **Overview** page shows the **Tenant ID**. Copy it.

## 3. Connect the bot in Agenta

1. Open the agent that should answer in Teams and go to its **Channels** section.
2. Choose **Microsoft Teams**.
3. Paste the three values:
- **Application (client) ID**: the bot's app ID.
- **Client secret value**: the secret's value, not its secret ID.
- **Directory (tenant) ID**: your tenant ID.
4. Click **Connect bot**.

Agenta checks the three values with Microsoft before it saves anything. If the check fails, nothing is stored. The secret stays masked after you save it.

## 4. Paste the messaging endpoint

After the bot connects, Agenta shows the **Messaging endpoint**. Teams sends every message for the bot to this address.

1. Click **Copy** next to the endpoint.
2. In the Teams Developer Portal, open your bot and go to **Configure**.
3. Paste the endpoint as the **Endpoint address** and save.

If you registered the bot in the Azure portal, paste the endpoint as the **Messaging endpoint** on the bot's **Configuration** page.

To find the endpoint later, open the Teams connection in the agent's **Channels** section.

## 5. Install the app in Teams

Agenta builds the Teams app for your bot. You do not need to create it yourself.

1. In Agenta, click **Download Teams app**. Your browser saves a `.zip` file.
2. In Teams, open **Apps**, then **Manage your apps**, then **Upload an app**.
3. Choose the downloaded file and add the app.

To add the agent to a team channel or a group chat, open the app in Teams and choose where to add it. You upload the app once. A new download gives the same app, so you do not need to upload it again.

## 6. Send a test message

Open a personal chat with the app and send a message, for example `what can you do?`. The agent replies in the chat.

## Troubleshooting

**"Microsoft rejected this client secret. Copy the secret's Value, not its Secret ID."** The secret is wrong, or you copied its ID. Add a new client secret, copy its value, and connect again.

**"Microsoft found no application with this ID in this tenant."** The app ID is wrong, or the bot belongs to another tenant. Check the app ID on the bot page and the tenant ID in the Microsoft Entra admin center.

**"Microsoft found no directory with this tenant ID."** The tenant ID is wrong. Copy it again from the **Overview** page of the Microsoft Entra admin center.

**"Could not check these values with Microsoft. Try again."** Agenta could not reach Microsoft. Wait a moment and connect again.

**There is no Upload an app option in Teams.** Your organization does not allow custom apps. Ask your Teams admin to allow custom app uploads. Microsoft describes the setting in [Manage custom app policies and settings](https://learn.microsoft.com/microsoftteams/teams-custom-app-policies-and-settings).

**The agent does not answer.** Check that the endpoint address on the bot is the **Messaging endpoint** that Agenta shows. In a team channel or a group chat, also check that you mentioned the bot.

## How conversations work

### Personal chats

In a personal chat, the agent answers every message. All messages in one personal chat are one conversation. To start a new conversation, send `!new`.

### Team channels

In a team channel, the agent answers only a message that mentions the bot. It replies in the thread of that post. Each new post that mentions the bot starts its own thread and its own conversation. To continue a conversation, mention the bot in its thread.

### Group chats

In a group chat, the agent answers only a message that mentions the bot. A group chat has no threads, so the whole chat is one conversation.

### Typing and long replies

While the agent works, the chat shows the typing indicator. If the reply takes more than 30 seconds, the agent posts one message: "Working on it, I'll reply here when I'm done."

Teams allows about 20,000 characters in one message, so a longer answer is split into several messages, sent in order.

### Approvals

When the agent needs approval before it runs a tool, it posts a card with **Approve** and **Deny** buttons. After someone clicks one, the buttons are removed.

## Limits

- The agent sees only messages that mention it in team channels and group chats. It does not read the rest of the conversation.
- The agent cannot send or receive files in Teams yet.
- The agent does not edit its messages while it works. The full answer arrives when it is done.
- Disconnecting the bot in Agenta stops the agent from answering, but the app stays installed in Teams. To remove it, remove the app in Teams.
2 changes: 1 addition & 1 deletion openspec/changes/teams-channel/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Runs in parallel with group 3.
Runs in parallel with group 2.

- [ ] 3.1 Add `"teams"` to `ChannelPlatform` (`web/packages/agenta-settings-ui/src/channels/types.ts`) and `CHANNEL_PLATFORMS` (`helpers.ts`), a Teams logo in `icons.tsx`, and the mapping in `actions.ts`.
- [ ] 3.2 Add a small `fetchChannelConnectionSetup` wrapper to `ChannelsActions` in `actions.ts`, in the same shape as the Discord setup branch, on top of the generated client call that main already has (`web/packages/agenta-api-client/src/generated/api/resources/channels/client/Client.ts`). If the Discord setup PR merges first, merging main keeps one copy. Keep `format` and `filename` of the setup document, and add one helper that decodes a `zip` document into a download.
- [ ] 3.2 Add a `teamsAppPackage(connectionId)` action to `ChannelsActions` in `actions.ts`, on top of the generated `fetchChannelConnectionSetup` client call (`web/packages/agenta-api-client/src/generated/api/resources/channels/client/Client.ts`). Each platform gets one named action, like `hostedSlackInstallUrl`, and every action reads the response with one shared parser, `setupDocumentOf`. When the Discord setup branch merges, its invite action uses `setupDocumentOf` too. Keep `format`, `content`, `filename` and `link` of the setup document, and add one helper that decodes a `zip` document into a download.
- [ ] 3.3 Add the Teams branch of `ChannelConnectFlow.tsx`: the setup steps, the three fields, then after connect the "Messaging endpoint" copy field (reuse `CopyField` from `WhatsAppWebhook.tsx`), the "Download Teams app" button and the install steps. Load the package from the per-connection setup call.
- [ ] 3.4 Add the Teams rows to the connection states in `helpers.ts`, and update the platform lists and labels in `web/mobile` (`src/lib/sharingCopy.ts`, `src/features/agents/useAgentChannels.ts`, `src/features/chat/useAgentPrivacyProps.ts`, `src/features/agents/AgentChannelsCard.tsx`).
- [ ] 3.5 Write the setup instructions in `teams/capabilities.py` after task 0.1. Quote every new user-facing string in the PR description.
Expand Down
2 changes: 2 additions & 0 deletions web/mobile/src/features/agents/useAgentChannels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ const withAgentNames = (
telegram: renameOrNull(connections.telegram),
whatsapp: renameOrNull(connections.whatsapp),
discord: renameOrNull(connections.discord),
teams: renameOrNull(connections.teams),
agentConnections: connections.agentConnections && {
slack: connections.agentConnections.slack.map(rename),
telegram: connections.agentConnections.telegram.map(rename),
whatsapp: connections.agentConnections.whatsapp.map(rename),
discord: connections.agentConnections.discord.map(rename),
teams: connections.agentConnections.teams.map(rename),
},
allConnections: connections.allConnections?.map(rename),
}
Expand Down
2 changes: 1 addition & 1 deletion web/mobile/src/features/chat/useAgentPrivacyProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {useCurrentProject} from "../context/useCurrentProject"

import {useDisclosureProviderLabel} from "./useDisclosureProviderLabel"

const PLATFORMS = ["slack", "telegram", "whatsapp", "discord"] as const
const PLATFORMS = ["slack", "telegram", "whatsapp", "discord", "teams"] as const

/** The platforms with a connection of this agent that is still off. */
const channelsOffOf = (connections: ChannelConnections): string[] =>
Expand Down
6 changes: 5 additions & 1 deletion web/mobile/src/lib/sharingCopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ export const sharingCopy = {
} as const

/** The display name of a channel platform, as the agent privacy dialog names it. */
export const channelPlatformLabel: Record<"slack" | "telegram" | "whatsapp" | "discord", string> = {
export const channelPlatformLabel: Record<
"slack" | "telegram" | "whatsapp" | "discord" | "teams",
string
> = {
slack: "Slack",
telegram: "Telegram",
whatsapp: "WhatsApp",
discord: "Discord",
teams: "Microsoft Teams",
}
5 changes: 3 additions & 2 deletions web/mobile/tests/unit/agentChannelSharing.render.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ vi.mock("../../src/features/agents/useAgentPublishPanel", () => ({
return {
openHub: vi.fn(),
reload: vi.fn().mockResolvedValue(undefined),
connections: {slack: null, telegram: null, whatsapp: null},
connections: {slack: null, telegram: null, whatsapp: null, teams: null},
panel: null,
}
},
Expand Down Expand Up @@ -153,7 +153,8 @@ describe("the privacy control's channel state", () => {
telegram: null,
whatsapp: null,
discord: null,
agentConnections: {slack: rows, telegram: [], whatsapp: [], discord: []},
teams: null,
agentConnections: {slack: rows, telegram: [], whatsapp: [], discord: [], teams: []},
allConnections: rows,
})
const render = (rows: ChannelConnection[]) =>
Expand Down
1 change: 1 addition & 0 deletions web/mobile/tests/unit/agentChannelsReload.render.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ vi.mock("@agenta/settings-ui", async (importOriginal) => {
telegram: null,
whatsapp: null,
discord: null,
teams: null,
}
},
}),
Expand Down
2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/de-DE.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/es-ES.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/fr-FR.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/ja-JP.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/pt-BR.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions web/packages/agenta-i18n/locales/.meta/zh-CN.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions web/packages/agenta-i18n/locales/de-DE/channels.advanced.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions web/packages/agenta-i18n/locales/de-DE/channels.labels.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading