Repository navigation
fix(mcp): report a banned license as a business failure - #1838
Merged
Merged
Conversation
Closes #1823 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
Contributor
📊 Cognitive Complexity AnalysisNet Delta: +7 | Added: 4 | Increased: 2 | Improved: 0 | Removed: 0 | Violations: 0
|
Contributor
Author
|
I tried to auto-update this PR with |
Member
|
/unicoder fix CI failures |
Contributor
Author
Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
Member
|
/unicoder /merge |
Contributor
Author
Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
marcossevilla
approved these changes
Nov 30, 2026
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.
Summary
The MCP license check used to report a banned license as invalid caller input.
very_good packages check licensesexits withExitCode.config(78) when it bans a dependency.ToolFailureType.fromExitCodemapped that code tovalidation/invalid_input, so agents were told to fix their arguments. In fact the check ran correctly and found a policy violation.This PR classifies that case as a
businessfailure with a newlicense_bannedreason. The banned packages are now part of the payload, so an agent can act without parsing the report.Closes #1823
Changes
LicenseCheckRecorderside channelExitCode.config.ToolRun.capturenow wraps the command in aLicenseCheckRecorderzone, alongside the existingTestRunRecorder.ToolRunbusinessand the reason becomesToolFailureReason.licenseBanned(license_banned).validation/invalid_inputas before.licensespayload onStructuredToolErrorbanned(the total count) andbannedDependencies(eachpackagewith thelicensesthat banned it), capped at the firstmaxPayloadItems(20) entries.license_bannedlicenses.bannedDependencies.allowed,forbiddenorskip_packagesonly with the user's agreement.packages_check_licensestool description.license_bannedto the failure reason table insite/docs/commands/mcp.md.Tests
allowedandforbidden, and records nothing when every license is allowed.ToolRungives each run its own recorder and returnsbusiness/license_bannedwith thelicensespayload when dependencies are banned.ToolRunfalls back tovalidation/invalid_inputwhen nothing was recorded.StructuredToolErrorputslicensesin the right key order, omits it when absent, and caps it at 20 entries.ToolFailureReasonwire values includelicense_banned.