Skip to content

get_network_request reports a failed responseFilePath write as "Response body not available anymore" #2957

Closed

Description

@coygeek

Description of the bug

When get_network_request cannot write the response body to responseFilePath, it returns a normal (non-error) result whose ### Response Body says <Response body not available anymore>. The body is in fact available (the same call without responseFilePath prints it), and the real cause, a failed file write, is not reported. Paths rejected before the write (for example, outside the workspace) are reported as errors. Both tested builds behave the same.

Actual behavior

Both builds:

responseFilePath <workspace>/blocked -> isError=false
  ### Response Body
  <Response body not available anymore>
responseFilePath <workspace>/ok      -> isError=false, body saved to <workspace>/ok.network-response
no responseFilePath                  -> isError=false
  ### Response Body
  <!doctype html><title>blank</title><p>blank</p>   (the file's content)

In the other investigator's root-path run, the same request printed <Response body not available anymore> with isError=false, while the same request without responseFilePath printed its body (hello gzip world).

Reproduction

  1. Save <!doctype html><title>blank</title><p>blank</p> as blank.html in an empty directory and serve it with python3 -m http.server PORT --bind 127.0.0.1.
  2. Create an empty directory <workspace> and, inside it, a directory named blocked.network-response (so that writing the file <workspace>/blocked.network-response fails). Start the server under test with --workspace <workspace>.
  3. Send these tools/call requests; REQID is the reqid of the GET .../blank.html [200] request from list_network_requests:
{"name":"new_page","arguments":{"url":"http://127.0.0.1:PORT/blank.html"}}
{"name":"list_network_requests","arguments":{"pageId":2}}
{"name":"get_network_request","arguments":{"pageId":2,"reqid":REQID,"responseFilePath":"<workspace>/blocked"}}
{"name":"get_network_request","arguments":{"pageId":2,"reqid":REQID,"responseFilePath":"<workspace>/ok"}}
{"name":"get_network_request","arguments":{"pageId":2,"reqid":REQID}}

The sequence was run as written once per build (the navigation request was reqid 1), and once per build in an earlier session against a fetch-initiated request for the same file, with the same results. Another investigator triggered the same result on both builds with a different write failure: responseFilePath equal to the workspace root, which the server rewrites to <workspace>.network-response, outside the allowed root.

Expectation

responseFilePath is described as "The absolute or relative path to a .network-response file to save the response body to." When the body exists but cannot be saved, the call should fail (isError: true) with the write error, as the same tool does for a path it rejects up front (an earlier run in this investigation observed Error: Access denied: path ... is not within any of the configured workspace roots. with isError: true for both requestFilePath and responseFilePath outside the workspace, on both builds). "Response body not available anymore" should be reserved for bodies that Chrome no longer holds.

MCP configuration

--headless --isolated --no-usage-statistics --no-performance-crux unless the reproduction states otherwise (update checks disabled with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1).

Chrome DevTools MCP version

1.10.1 (npm) and main 5ddb0a3 (local build)

Chrome version

154.0.8037.98 (stable)

Node version

v22.23.2

Operating system

macOS 27.0

Environment details

  • chrome-devtools-mcp 1.10.1 from npm (the release build).
  • chrome-devtools-mcp built from main at commit 5ddb0a3 (the main build).
  • Google Chrome 154.0.8037.98 stable, headless; Node v22.23.2; macOS 27.
  • Both builds were started with --headless --isolated --no-usage-statistics --no-performance-crux and CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, and driven by a scripted stdio MCP client. In a fresh isolated session the page opened by new_page has page ID 2.

Evidence

  • Expected source: responseFilePath parameter description (src/tools/network.ts, docs/tool-reference.md); the Access denied errors returned for out-of-root paths by the same tool (from an earlier run in this investigation's runs on both builds).
  • Failure source: scripted MCP runs above on both builds. In NetworkFormatter.#loadDetailedData, response.buffer() and saveFile(...) share one try whose catch {} discards the error ("Flatten error handling for buffer() failure and save failure"), and any missing file path then becomes <Response body not available anymore> (src/formatters/NetworkFormatter.ts:117-141 on the main build).
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

The root-path variant is from an earlier run in this investigation; the directory-collision case was observed for this report.

Fix check

With the steps above, the responseFilePath <workspace>/blocked call returns isError: true with text that identifies the failed write to <workspace>/blocked.network-response, and does not say the body is unavailable. Control: the <workspace>/ok call still saves the body, and a request whose body Chrome has actually evicted still reports <Response body not available anymore>.

Additional context

The full open and closed issue and PR corpus was screened as of 2026-10-06. Closed #842 changed the message printed when a body is no longer available, which is the message this failure now borrows; no issue reports write failures being hidden.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions