Query_heapsnapshot_objects className finds nothing for class names that the other heap tools print, because it matches node names
Maintainers usually reply within 1 day
@dinfuehr is already working on this.
Since Oct 13, 2026.
- #3096 by @lorenzozanee — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- devtools
Research direction
Read the query_heapsnapshot_objects description and className parameter in docs/tool-reference.md, then inspect the worker's queryObjects in third_party/devtools-frontend/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts. Reproduce with the detached DOM fixture and heap snapshot steps in the issue. Done means class names from heap details select the corresponding objects, while the LeakyThing control still works.
Written by the indexing model from the issue text.
Description
Description of the bug
query_heapsnapshot_objects documents className as matching the "object class name", but it matches each node's name instead. For JavaScript objects the two are the same, so LeakyThing works. For DOM and other native nodes they differ: get_heapsnapshot_details reports the class Detached <div> with 50 objects, yet className: "Detached <div>" (or ^Detached <div>$) returns 0 objects, because those nodes are named Detached <div class="detached-node">. Class names from the details output that contain regular-expression syntax, such as (array), also select unrelated nodes (Array, system / ArrayList, system / DescriptorArray). An agent that copies a class name from one heap tool into this query gets wrong or empty results without any error.
Actual behavior
Both builds (two snapshots per build: the fixture above and a larger leak fixture):
get_heapsnapshot_details (detached filter):
id,name,count,selfSize,retainedSize
1,Detached <div>,50,5.2 kB,10.8 kB
query className "Detached <div>" -> Showing 1-0 of 0 (main: Showing 0-0 of 0)
query className "^Detached <div>$" -> Showing 1-0 of 0 (main: Showing 0-0 of 0)
query className "Detached <div" -> 36383,Detached <div class="detached-node">,native,6,0.1 kB,0.2 kB ... Showing 1-2 of 50
query className "(array)" -> 37509,Array,object,5,...; 46611,system / DescriptorArray,object shape,7,... Showing 1-3 of 2292
With the larger fixture, className: "Detached" also returned a script source string whose text contains "detached" (the match is case-insensitive and against any node name, including string contents).
Reproduction
- Serve this page locally as
detached.html:
<!doctype html><title>Detached fixture</title>
<script>
window.kept = [];
for (let i = 0; i < 50; i++) { const d = document.createElement('div'); d.className = 'detached-node'; window.kept.push(d); }
</script>
- Send these tool calls:
{"name":"new_page","arguments":{"url":"http://127.0.0.1:<port>/detached.html"}}
{"name":"take_heapsnapshot","arguments":{"pageId":2,"filePath":"<workspace>/snaps/detached.heapsnapshot"}}
{"name":"get_heapsnapshot_details","arguments":{"filePath":"<workspace>/snaps/detached.heapsnapshot","filterName":"objectsRetainedByDetachedDomNodes","pageSize":5}}
{"name":"query_heapsnapshot_objects","arguments":{"filePath":"<workspace>/snaps/detached.heapsnapshot","className":"Detached <div>","pageSize":3}}
{"name":"query_heapsnapshot_objects","arguments":{"filePath":"<workspace>/snaps/detached.heapsnapshot","className":"^Detached <div>$","pageSize":3}}
{"name":"query_heapsnapshot_objects","arguments":{"filePath":"<workspace>/snaps/detached.heapsnapshot","className":"(array)","pageSize":3}}
{"name":"query_heapsnapshot_objects","arguments":{"filePath":"<workspace>/snaps/detached.heapsnapshot","className":"Detached <div","pageSize":2}}
Expectation
The className parameter is "Optional regex or text matching object class name", and the tool description lists it among the filters for "objects matching specific filters (className, ...)". The heap tools present class names in get_heapsnapshot_details and compare_heapsnapshots; a class name printed there, such as Detached <div> or (array), should select the objects of that class (50 detached div elements here), as the same name does for JavaScript classes such as LeakyThing.
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 5ddb0a3110c5059f8e5513e566196cce2a35c6d1 (local build)
Chrome version
154.0.8037.98 (stable)
Node version
v22.23.2
Operating system
macOS 27.0
Environment details
chrome-devtools-mcp1.10.1 from npm (the release build) and upstreammainat commit5ddb0a3110c5059f8e5513e566196cce2a35c6d1built from source (themainbuild).- Google Chrome 154.0.8037.98 (stable), Node.js v22.23.2, macOS 27.
- Server started with
--isolated --headless --no-usage-statistics --no-performance-crux --memoryDebuggingandCHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, driven by a minimal stdio MCP client whose workspace root contains<workspace>/snaps/.
Evidence
- Expected source:
query_heapsnapshot_objectsdescription andclassNameparameter indocs/tool-reference.md, both builds; class names as printed byget_heapsnapshot_detailson the same snapshot. - Failure source: my runs of the steps above on both builds; static breadcrumb: the worker's
queryObjects(third_party/devtools-frontend/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.tson themainbuild) compilesnew RegExp(queryOptions.className, 'i')and tests it against the node name. - Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
Fix check
Run the steps above. Failing: className: "Detached <div>" returns 0 objects while get_heapsnapshot_details reports 50 Detached <div> objects. Passing: the same query returns those 50 detached div nodes, and className: "(array)" returns the objects that get_heapsnapshot_details counts under (array) rather than Array objects. Control: className: "LeakyThing" (or ^LeakyThing$) on a page with that JavaScript class still returns the same instances as get_heapsnapshot_class_nodes for that class.
Additional context
The full open and closed issue and pull request corpus was screened as of 2026-10-06; no issue covers this. Merged pull request #2553 added the tool. If the maintainers prefer node-name matching, an alternative resolution is a className description that says it matches node names and explains how class names containing regular-expression syntax are treated. An invalid regular expression in className (for example () fails with an internal TypeError; that is a separate problem with its own fix and is not part of this report.
- Dominant language
- TypeScript
- Stars
- 59.8k
- Forks
- 4.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChromeDevTools/chrome-devtools-mcp
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainers usually reply within 1 day
-
`evaluate_script` `sourcePath` http(s) URLs are mangled into `file://` pathsMay be free again A pull request for this issue was closed without being merged. Opencollecting-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3453 · 3 comments ·
Maintainers usually reply within 1 day
-
collecting-feedback feature
Difficulty 2/5 Half a day Newbie friendliness 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 comments ·
Maintainers usually reply within 1 day
-
confirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 comment ·
Maintainers usually reply within 1 day
-
Project Migration: Moving to devtools-frontendPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
ChromeDevTools/chrome-devtools-mcp#3648 ·
Maintainers usually reply within 1 day
All issues in ChromeDevTools/chrome-devtools-mcp
Similar issues
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nightly-labs/openbot#21303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OHDSI/Data2Evidence#3816 ·
Maintainers usually reply within 3 days
-
`ovsx verify` fails for a version older than the 100 newest of an extensionPossibly taken @trivikr claimed this today. Opencli
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
eclipse-openvsx/openvsx#2482 · 2 comments ·
Maintainers usually reply within 1 day
-
bug builder-vite hmr sev:S3
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
storybookjs/storybook#37965 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day