Skip to content

Commit 893e5ce

Browse files
fix
1 parent 482ea61 commit 893e5ce

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

src/telemetry/tool_call_metrics.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,5 +556,14 @@
556556
"argType": "number"
557557
}
558558
]
559+
},
560+
{
561+
"name": "load_memory_snapshot",
562+
"args": [
563+
{
564+
"name": "file_path_length",
565+
"argType": "number"
566+
}
567+
]
559568
}
560569
]

src/tools/ToolDefinition.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ export type Context = Readonly<{
230230
): Promise<
231231
Record<string, DevTools.HeapSnapshotModel.HeapSnapshotModel.AggregatedInfo>
232232
>;
233-
getHeapSnapshotStats(filePath: string): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.Statistics>;
234-
getHeapSnapshotStaticData(filePath: string): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.StaticData | null>;
233+
getHeapSnapshotStats(
234+
filePath: string,
235+
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.Statistics>;
236+
getHeapSnapshotStaticData(
237+
filePath: string,
238+
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.StaticData | null>;
235239
}>;
236240

237241
export type ContextPage = Readonly<{

tests/tools/memory.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ describe('memory', () => {
4343
describe('load_memory_snapshot', () => {
4444
it('with default options', async () => {
4545
await withMcpContext(async (response, context) => {
46-
const filePath = join(process.cwd(), 'tests/fixtures/example.heapsnapshot');
47-
46+
const filePath = join(
47+
process.cwd(),
48+
'tests/fixtures/example.heapsnapshot',
49+
);
50+
4851
assert.ok(existsSync(filePath), `Fixture not found at ${filePath}`);
4952

5053
await exploreMemorySnapshot.handler(
@@ -54,8 +57,13 @@ describe('memory', () => {
5457
);
5558

5659
// Call handle to trigger formatting (similar to network tests)
57-
const responseData = await response.handle(exploreMemorySnapshot.name, context);
58-
const output = responseData.content.map(c => (c.type === 'text' ? c.text : '')).join('\n');
60+
const responseData = await response.handle(
61+
exploreMemorySnapshot.name,
62+
context,
63+
);
64+
const output = responseData.content
65+
.map(c => (c.type === 'text' ? c.text : ''))
66+
.join('\n');
5967

6068
// Check if response contains Statistics or Static Data
6169
assert.ok(output.includes('Statistics:'));

0 commit comments

Comments
 (0)