[Routine - VT] fix(mcp): guard validate_json_structure against non-object array elements - #104
Merged
winterdrive merged 1 commit intoAug 16, 2026
Conversation
…ents
A group entry that is null, a string, or a number (e.g. [null, {...}])
throws a TypeError on `g.id` inside the loop. That TypeError is
swallowed by the outer catch and reported back to the AI agent as a
misleading "JSON parse error" for otherwise-parseable JSON. Same bug
class as the earlier `g.files` undefined-iteration guard (#82), just
for the element itself.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 27, 2026
This was referenced Aug 12, 2026
winterdrive
marked this pull request as ready for review
August 16, 2026 15:30
winterdrive
added a commit
that referenced
this pull request
Aug 16, 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.
Pre-flight Check
gh pr list --state openreturned no open PRs at the time of this run.git branch -r | grep routine): ~20 exist, but every one of them is already squash-merged intomain(verified viagh pr list --state closed, e.g. [Routine - VT] fix(sendTo): guard against empty destFolders (Infinity step) #74–[Routine - VT] fix(provider): avoid duplicate built-in group on scoped resetToDefault #98). None are active/unmerged, so there is nothing to overlap with.AGENTS.mdexists in the repo root.mcp-server/src/server.ts, inside thevalidate_json_structuretool handler — not touched by any recent commit.Changes
validate_json_structureiterates the parsed JSON array and immediately readsg.id/g.name/g.filesoff each element. If an element isnull, a string, or a number (e.g.[null, {...}]), that throws aTypeError, which the outertry/catchswallows and reports back to the AI agent as a misleading"JSON parse error"for otherwise well-formed JSON.This is the same bug class as the earlier merged fix "guard files iteration in validate_json_structure against undefined" (#82) — that one guarded
g.files; this one guardsgitself. Added a single early-continue guard:Confirms this PR does not:
package.jsonpackage.json/package-lock.jsonversion fields orCHANGELOG.mdSafety Verification
Commands run locally, all passed:
CI / Release Gate Note
This is a daily routine Draft PR. Package version bump and
CHANGELOG.mdconsolidation are intentionally deferred to the weekend release/integration PR. If CI fails solely due to the repository's version-bump release gate, that is expected release-readiness behavior for a routine PR, not a code validation failure.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com