fix(mcp): bound predict-gate changedPaths - #1438
Merged
JSONbored merged 1 commit intoJun 26, 2026
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1438 +/- ##
=======================================
Coverage 95.39% 95.39%
=======================================
Files 193 193
Lines 20929 20929
Branches 7564 7564
=======================================
Hits 19966 19966
Misses 383 383
Partials 580 580
🚀 New features to boost your workflow:
|
This was referenced Jun 27, 2026
Closed
12 tasks
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
gittensory_predict_gateinput from driving large allocations and CPU during path-glob matching by applying the same per-path metadata size cap used elsewhere.Description
changedPathselements in the MCPpredictGateShapetoPREFLIGHT_LIMITS.changedFileChars(usingz.string().min(1).max(PREFLIGHT_LIMITS.changedFileChars)), keeping the existing array cap of 500.changedPathsentry togittensory_predict_gateand asserts the call is rejected before prediction processing.Testing
npx vitest run test/unit/mcp-predict-gate.test.ts, and all tests in that file passed.git diff --checkandnpm run typecheckand they succeeded (no typing or diff issues).npm run test:ci; the targeted change passed, but the full suite aborted on unrelated long-running coverage remap work withTypeError: jsTokens is not a functionand therefore did not complete end-to-end.npm audit --audit-level=moderatecould not complete due to a registry audit endpoint error (network/403) in this environment.Codex Task