Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Resolved — posting the root cause and fix in case anyone else hits this, because the actual error is buried and the "Bad request" message in Teams is misleading.
Root cause: The agent's display name exceeded 30 characters. The Teams app manifest schema requires name.short to be ≤ 30 characters. Copilot Studio takes the agent's display name and writes it into name.short when it generates the Teams app definition on publish. If the name is over 30 characters, the generated manifest fails schema validation at the Teams settings store, and every Add attempt fails with a generic "Bad request."
In my case I renamed the agent from a 29 character name to a 38 character name which is over the limit. That single rename was the breaking change. The first publish before the rename worked because the name fit; every republish after the rename silently produced a manifest that Teams rejected.
How to confirm it's the same issue: Open Teams on the web, F12 → Network tab, click Add. Find the failing POST to /api/mt/part/{region}/beta/users/apps/templatedInstance/entitlements (status 400). Look at the Response body. If it contains something like:
"Failed to execute settings store request: .../apps/{appId}/definitionv2, StatusCode: 400, ReasonPhrase: Schema validation errors"
...then the manifest is failing schema validation, and the name length is the most likely cause (check icon dimensions and description length as secondary suspects).
Product feedback for Microsoft if anyone from the team sees this: Copilot Studio should either enforce the 30-char limit at rename time, truncate the name when generating name.short, or surface the schema validation error in the publish UI. Silently writing an invalid manifest and surfacing the failure as a generic "Bad request" only on the end user's Add click is a rough debugging experience — especially because the agent appears to publish successfully and works in M365 Chat, so there's no obvious signal that anything is wrong until users try to install.