Update API plugin manifest schema from v2.3 to v2.4#7166
Merged
gavinbarron merged 2 commits intomainfrom Nov 26, 2025
Merged
Conversation
Co-authored-by: sebastienlevert <7620955+sebastienlevert@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update the x-ai-adaptive-card extension schema to 2.4
Update API plugin manifest schema from v2.3 to v2.4
Nov 26, 2025
sebastienlevert
approved these changes
Nov 26, 2025
gavinbarron
approved these changes
Nov 26, 2025
Alive-Fish
added a commit
to OfficeDev/microsoft-365-agents-toolkit
that referenced
this pull request
Apr 23, 2026
… through Kiota plugin generation (#15731) (#15772) * fix: propagate x-ai-adaptive-card and x-openai-isConsequential into Kiota plugin manifest (#15731) Bumps `@microsoft/kiota` to 1.31.1 (which emits plugin manifest schema v2.4 via microsoft/kiota#7166) and adds a workaround that patches the generated `*-apiplugin.json` so the following OpenAPI extensions are honored: - `x-ai-adaptive-card` -> `function.capabilities.response_semantics` (with `data_path` and the inlined Adaptive Card as `static_template`) - `x-ai-capabilities.confirmation` -> `function.capabilities.confirmation` - `x-openai-isConsequential` -> `confirmation.isNonConsequential` (negated, since "non-consequential" is the inverse) As of Kiota 1.31.1 the v2.4 schema bump only changed the manifest header; the generator still drops these extensions. The workaround in `patchOpenApiExtensionsIntoPluginManifest` reads the source spec emitted by `tsp compile`, walks every operation, and merges the extension data into the plugin manifest produced by Kiota. It only fills in capability blocks Kiota left empty - existing values are preserved. The new helper is invoked from `TypeSpecCompileDriver.execute` immediately after each `kiotageneratePlugin` call (both the single-spec and multi-spec branches). Tests: - 8 new unit tests in `tests/common/daSpecParser.test.ts` covering the happy paths, both `isConsequential` polarities, no-overwrite behavior, no-op behavior, missing inputs, invalid YAML, and unreadable Adaptive Card files. - Full `npm run test:unit` line coverage stays above the 72.7% nyc threshold. Fixes #15731 * fix: inline Adaptive Card `static_template` placeholder emitted by Kiota (#15731) Follow-up to the original #15731 fix. End-to-end testing against a real TypeSpec project showed that Kiota 1.31.1 actually does emit a `response_semantics` block, but with a placeholder of the form "static_template": { "file": "adaptiveCards/<name>.json" } instead of inlining the Adaptive Card JSON itself. Microsoft 365 Copilot expects `static_template` to be the card object, so the previous "only fill if missing" guard left a non-functional manifest. Changes: - `patchOpenApiExtensionsIntoPluginManifest` now detects this placeholder shape (object with only a `file` property and none of `type`, `$schema`, `body`) and replaces it with the inlined card JSON. - Real cards already inlined by hand are left untouched. - The card-resolution helper now searches several candidate base directories (plugin manifest dir, its parent, its grandparent, spec dir, and the spec dir's parent), since the typical layout puts the card file in `<root>/adaptiveCards/` while the plugin manifest lives in `<root>/.generated/`. - 3 new unit tests cover: inlining the Kiota placeholder, preserving a real existing card, and resolving cards from the parent of the plugin manifest dir. All 11 tests under "patchOpenApiExtensionsIntoPluginManifest (issue #15731)" pass. Refs #15731 * test(fx-core): add coverage for patcher resolveCardJson catch and data_path backfill (#15731) * test(fx-core): cover parsed-spec-no-paths guard in patcher (#15731)
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.
Updates the API plugin manifest schema version from v2.3 to v2.4 to align with the latest Microsoft 365 Copilot API plugin manifest specification.
Changes
PluginsGenerationService.csto generate v2.4 manifests with updated schema URLgithubsearch-apiplugin.jsonandsuno-with-extensions-apiplugin.jsonPluginModelWithSecurity.jsonandPluginDiscriminatorSample.jsonAll schema URLs changed from:
https://developer.microsoft.com/json-schemas/copilot/plugin/v2.3/schema.json→v2.4https://aka.ms/json-schemas/copilot-extensions/v2.3/plugin.schema.json→v2.4Generated manifests will now reference the v2.4 schema.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/microsoftgraph/msgraph-metadata/contents/apis.json/usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false(http block)https://api.github.com/repos/microsoftgraph/msgraph-metadata/contents/apis.yaml/usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false(http block)https://api.github.com/search/repositories/usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/Kiota.Builder.Tests.deps.json /home/REDACTED/work/kiota/kiota/tests/Kiota.Builder.Tests/bin/Debug/net9.0/testhost.dll --port 44833 --endpoint 127.0.0.1:044833 --role client --parentprocessid 6712 --telemetryoptedin false(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.