Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Strengthen toolTelemetry test assertions
Assert tool.execution_complete event has success=true and that
toolTelemetry, when present, is non-empty (not the {} that results
from the old stringification bug).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
Morabbin and Copilot committed Apr 1, 2026
commit 6677e8d6bbfda1f54ff8f4614b67bdbe29f35ba8
9 changes: 8 additions & 1 deletion nodejs/test/e2e/tool_results.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,16 @@ describe("Tool Results", async () => {
expect(toolResults[0]!.content).not.toContain("toolTelemetry");
expect(toolResults[0]!.content).not.toContain("resultType");

// Verify tool.execution_complete event carries toolTelemetry
// Verify tool.execution_complete event fires for this tool call
const toolCompletes = events.filter((e) => e.type === "tool.execution_complete");
expect(toolCompletes.length).toBeGreaterThanOrEqual(1);
const completeEvent = toolCompletes[0]!;
expect(completeEvent.data.success).toBe(true);
// When the server preserves the structured result, toolTelemetry should
// be present and non-empty (not the {} that results from stringification).
if (completeEvent.data.toolTelemetry) {
expect(Object.keys(completeEvent.data.toolTelemetry).length).toBeGreaterThan(0);
}

await session.disconnect();
});
Expand Down
Loading