Repository navigation
fix(network): reject string values for includeBody - #1545
Open
monsterlag wants to merge 1 commit into
Open
monsterlag wants to merge 1 commit into
monsterlag wants to merge 1 commit into
Conversation
This branch has not been 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.
Note
AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.
Summary
Fixes #1538.
view-network-request-detailsdeclaredincludeBodywithz.coerce.boolean(), which uses JS truthiness, so an MCP or HTTP caller sending"includeBody": "false"(or"0") got the response body anyway, with no sign the value was ignored.Declare it as a plain
z.boolean(), the same change #1385 makes forcaptureBaseline/captureCurrentinscreenshot-diff. A string value is now rejected asinvalid_typeonincludeBodyinstead of being silently turned intotrue. Booleans and thetruedefault are unchanged. The CLI already maps--includeBody falseto a real boolean, so it is not affected.Add regressions in
chromium-network.test.ts: string values ("false","0","true") are rejected, booleans are accepted as given.No docs update is needed: the tools reference does not describe this parameter.
Testing
npx vitest run test/chromium-network.test.ts test/network(inpackages/tool-server): 4 files, 295 passednpm run buildnpm run typecheck:tests --workspaces --if-presentnpx eslint(withNODE_OPTIONS=--max-old-space-size=2600, the default heap ran out in the container) andnpx prettier --checkon the two changed files: cleanContainer note: dependencies were installed with
npm ci --ignore-scripts, because thetree-sitternative build fails under Node 24 in the test container. No live-device testing was performed.