Chrome DevTools for coding agents
docs: mention heapsnapshot being cached between runs (#3045)
Nikolay Vitkovf08dbe152502
diff --git a/docs/tool-reference.md b/docs/tool-reference.mdindex d3da9a3c..f0ad98c8 100644--- a/docs/tool-reference.md+++ b/docs/tool-reference.md@@ -514,7 +514,7 @@ in the DevTools Elements panel (if any).### `analyze_heapsnapshot_contexts`-**Description:** Loads a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)**Parameters:**@@ -529,7 +529,7 @@ in the DevTools Elements panel (if any).### `close_heapsnapshot`-**Description:** Closes a previously loaded memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)+**Description:** Closes a previously loaded and cached memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)**Parameters:**@@ -539,7 +539,7 @@ in the DevTools Elements panel (if any).### `compare_heapsnapshots`-**Description:** Loads two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)**Parameters:**@@ -551,7 +551,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_class_nodes`-**Description:** Loads a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)**Parameters:**@@ -567,7 +567,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_details`-**Description:** Loads a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)**Parameters:**@@ -581,7 +581,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_dominators`-**Description:** Loads a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)**Parameters:**@@ -593,7 +593,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_duplicate_strings`-**Description:** Loads a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)**Parameters:**@@ -606,7 +606,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_edges`-**Description:** Loads a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)**Parameters:**@@ -623,7 +623,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_object_details`-**Description:** Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)**Parameters:**@@ -635,7 +635,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_retainers`-**Description:** Loads a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)**Parameters:**@@ -649,7 +649,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_retaining_paths`-**Description:** Loads a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)**Parameters:**@@ -664,7 +664,7 @@ in the DevTools Elements panel (if any).### `get_heapsnapshot_summary`-**Description:** Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)**Parameters:**@@ -675,7 +675,7 @@ in the DevTools Elements panel (if any).### `query_heapsnapshot_objects`-**Description:** Loads a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)+**Description:** Loads and caches a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)**Parameters:**diff --git a/src/config/cli-options.ts b/src/config/cli-options.tsindex b7b030de..e12568b0 100644--- a/src/config/cli-options.ts+++ b/src/config/cli-options.ts@@ -29,7 +29,7 @@ export type Commands = Record<export const commands: Commands = {analyze_heapsnapshot_contexts: {description:- 'Loads a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -146,7 +146,7 @@ export const commands: Commands = {},close_heapsnapshot: {description:- 'Closes a previously loaded memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)',+ 'Closes a previously loaded and cached memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -173,7 +173,7 @@ export const commands: Commands = {},compare_heapsnapshots: {description:- 'Loads two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)',+ 'Loads and caches two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {baseFilePath: {@@ -505,7 +505,7 @@ export const commands: Commands = {},get_heapsnapshot_class_nodes: {description:- 'Loads a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -565,7 +565,7 @@ export const commands: Commands = {},get_heapsnapshot_details: {description:- 'Loads a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -612,7 +612,7 @@ export const commands: Commands = {},get_heapsnapshot_dominators: {description:- 'Loads a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -638,7 +638,7 @@ export const commands: Commands = {},get_heapsnapshot_duplicate_strings: {description:- 'Loads a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -670,7 +670,7 @@ export const commands: Commands = {},get_heapsnapshot_edges: {description:- 'Loads a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -729,7 +729,7 @@ export const commands: Commands = {},get_heapsnapshot_object_details: {description:- 'Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -755,7 +755,7 @@ export const commands: Commands = {},get_heapsnapshot_retainers: {description:- 'Loads a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -793,7 +793,7 @@ export const commands: Commands = {},get_heapsnapshot_retaining_paths: {description:- 'Loads a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -837,7 +837,7 @@ export const commands: Commands = {},get_heapsnapshot_summary: {description:- 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {@@ -1392,7 +1392,7 @@ export const commands: Commands = {},query_heapsnapshot_objects: {description:- 'Loads a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)',+ 'Loads and caches a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)',category: 'Memory',args: {filePath: {diff --git a/src/tools/memory.ts b/src/tools/memory.tsindex 404267f4..26314d4a 100644--- a/src/tools/memory.ts+++ b/src/tools/memory.ts@@ -64,7 +64,7 @@ export const takeHeapSnapshot = definePageTool(() => ({export const getHeapSnapshotSummary = defineTool(() => ({name: 'get_heapsnapshot_summary',description:- 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary.',+ 'Loads and caches a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -106,7 +106,7 @@ export const getHeapSnapshotSummary = defineTool(() => ({export const getHeapSnapshotDetails = defineTool(() => ({name: 'get_heapsnapshot_details',description:- 'Loads a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates.',+ 'Loads and caches a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -154,7 +154,7 @@ export const getHeapSnapshotDetails = defineTool(() => ({export const getHeapSnapshotClassNodes = defineTool(() => ({name: 'get_heapsnapshot_class_nodes',description:- 'Loads a memory heapsnapshot and returns instances of a specific class with their IDs.',+ 'Loads and caches a memory heapsnapshot and returns instances of a specific class with their IDs.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -200,7 +200,7 @@ export const getHeapSnapshotClassNodes = defineTool(() => ({export const getHeapSnapshotRetainers = defineTool(() => ({name: 'get_heapsnapshot_retainers',description:- 'Loads a memory heapsnapshot and returns retainers for a specific node ID.',+ 'Loads and caches a memory heapsnapshot and returns retainers for a specific node ID.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -234,7 +234,7 @@ export const getHeapSnapshotRetainers = defineTool(() => ({export const closeHeapSnapshot = defineTool(() => ({name: 'close_heapsnapshot',description:- 'Closes a previously loaded memory heapsnapshot, freeing its memory.',+ 'Closes a previously loaded and cached memory heapsnapshot, freeing its memory.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: false,@@ -265,7 +265,7 @@ export const closeHeapSnapshot = defineTool(() => ({export const getHeapSnapshotRetainingPaths = defineTool(() => ({name: 'get_heapsnapshot_retaining_paths',description:- 'Loads a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected.',+ 'Loads and caches a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -310,7 +310,7 @@ export const getHeapSnapshotRetainingPaths = defineTool(() => ({export const getHeapSnapshotEdges = defineTool(() => ({name: 'get_heapsnapshot_edges',description:- 'Loads a memory heapsnapshot and returns outgoing edges (references) for a specific node ID.',+ 'Loads and caches a memory heapsnapshot and returns outgoing edges (references) for a specific node ID.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -361,7 +361,7 @@ export const getHeapSnapshotEdges = defineTool(() => ({export const getHeapSnapshotDominators = defineTool(() => ({name: 'get_heapsnapshot_dominators',description:- 'Loads a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive.',+ 'Loads and caches a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -393,7 +393,7 @@ export const getHeapSnapshotDominators = defineTool(() => ({export const compareHeapSnapshots = defineTool(() => ({name: 'compare_heapsnapshots',description:- 'Loads two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff.',+ 'Loads and caches two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -439,7 +439,7 @@ export const compareHeapSnapshots = defineTool(() => ({export const getHeapSnapshotDuplicateStrings = defineTool(() => ({name: 'get_heapsnapshot_duplicate_strings',description:- 'Loads a memory heapsnapshot and returns duplicate strings grouped by their value.',+ 'Loads and caches a memory heapsnapshot and returns duplicate strings grouped by their value.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -471,7 +471,7 @@ export const getHeapSnapshotDuplicateStrings = defineTool(() => ({export const getHeapSnapshotObjectDetails = defineTool(() => ({name: 'get_heapsnapshot_object_details',description:- 'Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness.',+ 'Loads and caches a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -501,7 +501,7 @@ export const getHeapSnapshotObjectDetails = defineTool(() => ({export const queryHeapSnapshotObjects = defineTool(() => ({name: 'query_heapsnapshot_objects',description:- 'Loads a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy).',+ 'Loads and caches a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy).',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,@@ -570,7 +570,7 @@ export const queryHeapSnapshotObjects = defineTool(() => ({export const analyzeHeapSnapshotContexts = defineTool(() => ({name: 'analyze_heapsnapshot_contexts',description:- 'Loads a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes.',+ 'Loads and caches a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes.',annotations: {category: ToolCategory.MEMORY,readOnlyHint: true,