fix(telemetry): patch memory leak and enforce logPrompts privacy (#23281)

This commit is contained in:
Spencer
2026-03-23 19:58:06 -04:00
committed by GitHub
parent f784e192fa
commit fcd190b8b1
15 changed files with 184 additions and 74 deletions
@@ -44,7 +44,6 @@ const runInDevTraceSpan = vi.hoisted(() =>
const metadata = { attributes: opts.attributes || {} };
return fn({
metadata,
endSpan: vi.fn(),
});
}),
);
@@ -142,7 +141,7 @@ describe('ToolExecutor', () => {
const spanArgs = vi.mocked(runInDevTraceSpan).mock.calls[0];
const fn = spanArgs[1];
const metadata = { attributes: {} };
await fn({ metadata, endSpan: vi.fn() });
await fn({ metadata });
expect(metadata).toMatchObject({
input: scheduledCall.request,
output: {
@@ -205,7 +204,7 @@ describe('ToolExecutor', () => {
const spanArgs = vi.mocked(runInDevTraceSpan).mock.calls[0];
const fn = spanArgs[1];
const metadata = { attributes: {} };
await fn({ metadata, endSpan: vi.fn() });
await fn({ metadata });
expect(metadata).toMatchObject({
error: new Error('Tool Failed'),
});