Repository navigation
Python: dispatch MCP approval modes by kind in the declarative tool - #9865
Closed
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Closed
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Conversation
The tool parsed approvalMode with the base class, which only carries the kind, so specify mode with its tool lists raised a TypeError and the simplified string parsed into the base class that the loader never matches. Parsing now dispatches by kind like the top level component path, and an unknown mode name is rejected. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
October 30, 2026 03:45 — with
GitHub Actions
Inactive
Manohar Paturi (ManoharPaturi)
requested review from
Darren Cohen (dargilco),
Jose Alvarez (jpalvarezl),
sophia-ramsey and
westey (westey-m)
as code owners
October 30, 2026 03:45
Manohar Paturi (ManoharPaturi)
temporarily deployed
to
github-app-auth
October 30, 2026 03:45 — with
GitHub Actions
Inactive
Contributor
Author
|
Sorry about that, I should have waited. #9864 now carries the template with both failing shapes and the stack trace, and this PR stays closed until the team agrees with the direction. |
This branch was previously deployed
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.
Motivation & Context
An MCP tool configured with
approvalModein specify mode could not be loaded. The dict form with its tool lists raised aTypeErrorbecause the tool parsed approval modes with the base class, which only carries the kind, and the simplified string form parsed into that base class instead of the specify subclass, so the agent loader never matched it and the approval configuration was silently dropped. The always and never modes only worked because the base class happens to hold all their state.Description & Review Guide
McpToolnow parsesapprovalModethrough the same kind based dispatch the top level component path uses, so every mode lands in its own subclass with its full state, and an unknown mode name is rejected with a clear error instead of silently parsing as the base mode.require_approvalfrom the tool lists as intended, and existing always and never specs parse to the same subclasses they already used.Related Issue
Fixes #9864
AI Assistance
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.