feat: map confirmation isNonConsequential in AI capabilities extension#7857
Open
sebastienlevert wants to merge 3 commits into
Open
feat: map confirmation isNonConsequential in AI capabilities extension#7857sebastienlevert wants to merge 3 commits into
sebastienlevert wants to merge 3 commits into
Conversation
The x-ai-capabilities confirmation object supports isNonConsequential (plugin manifest 2.4), but Kiota dropped it: the ExtensionConfirmation parser only read type/title/body and the generated manifest confirmation was never populated with it. Parse, write, and map isNonConsequential to the manifest Confirmation.IsNonConsequential property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall coverage in the branch is 71%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
There was a problem hiding this comment.
Pull request overview
This PR ensures the x-ai-capabilities.confirmation.isNonConsequential flag is preserved end-to-end: parsed from the OpenAPI extension, re-serialized when needed, and mapped into the generated plugin manifest Confirmation so non-consequential confirmations enable the “Always Allow” UX.
Changes:
- Added
IsNonConsequentialto thex-ai-capabilitiesconfirmation model and implemented parse/write support. - Mapped
capabilities.Confirmation.IsNonConsequentialinto the generated plugin manifest confirmation object. - Extended unit + end-to-end tests and documented the change in the changelog.
Show a summary per file
| File | Description |
|---|---|
| tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs | Extends the end-to-end manifest generation test to assert IsNonConsequential is carried through. |
| tests/Kiota.Builder.Tests/OpenApiExtensions/OpenApiAiCapabilitiesExtensionTests.cs | Updates parse/serialize tests to include isNonConsequential in the AI capabilities extension. |
| src/Kiota.Builder/Plugins/PluginsGenerationService.cs | Maps IsNonConsequential from parsed capabilities into the generated manifest Confirmation. |
| src/Kiota.Builder/OpenApiExtensions/OpenApiAiCapabilitiesExtension.cs | Adds IsNonConsequential to the extension model and implements parsing + JSON emission. |
| CHANGELOG.md | Records the newly supported isNonConsequential confirmation property for the AI capabilities extension. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
…erialization Assert the serialized output contains "isNonConsequential":true rather than just the property name, so the test fails if the value is emitted incorrectly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
The
x-ai-capabilitiesconfirmation object supportsisNonConsequential(plugin manifest 2.4, available inMicrosoft.DeclarativeAgents.ManifestasConfirmation.IsNonConsequential), but Kiota was silently dropping it:ExtensionConfirmation(thex-ai-capabilitiesparser model) only hadType/Title/Body.ParseConfirmation/WriteConfirmationnever read or wroteisNonConsequential.PluginsGenerationService.GetFunctionCapabilitiesFromCapabilitiesExtensionmapped onlyType/Title/Bodyonto the generated manifestConfirmation.As a result, a function could never be marked non-consequential in the generated plugin manifest, so the "Always Allow" confirmation option was unavailable.
Changes
OpenApiAiCapabilitiesExtension.cs: addIsNonConsequentialtoExtensionConfirmation; parse it (boolean) inParseConfirmation; emit it inWriteConfirmation.PluginsGenerationService.cs: mapcapabilities.Confirmation.IsNonConsequential→Confirmation.IsNonConsequential.OpenApiAiCapabilitiesExtensionparse + write round-trip tests and the end-to-endGeneratesManifestWithAiCapabilitiesExtensionAsyncgeneration test to coverisNonConsequential.Example
OpenAPI operation extension:
now produces in the generated plugin manifest:
Testing
dotnet test tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj --filter "FullyQualifiedName~OpenApiAiCapabilitiesExtension|FullyQualifiedName~PluginsGenerationService"→ 96 passing, 0 failing.Context
Complements the TypeSpec authoring side (
@microsoft/typespec-m365-copilot) which emitsx-ai-capabilities.confirmation.isNonConsequential— see microsoft/typespec-copilot-skills#530. The underlying manifest model already supports the property (Microsoft.DeclarativeAgents.Manifest@5.0.0-rc.2); this PR wires Kiota's generator to populate it.