From 70e02f34195fd2b26465f94894d8170aff3654ae Mon Sep 17 00:00:00 2001 From: examon Date: Sun, 2 Aug 2026 05:27:39 +0000 Subject: [PATCH] docs: remove the nonexistent toolName field from tool.execution_complete The Node.js extension-authoring docs listed a `toolName` field on the `tool.execution_complete` session event, in two event-field reference tables and three handler code-comments. That event has no `toolName`: `ToolExecutionCompleteData` declares `required: ["toolCallId","success"]` with `additionalProperties: false` and no `toolName` property, so reading `event.data.toolName` in a completion handler is always undefined. `toolName` is emitted on `tool.execution_start`, and a completion is correlated to its start by `toolCallId`. Remove the field from the two `tool.execution_complete` rows and the three completion-handler comments. It stays on the `tool.execution_start` rows. The repository's shared event reference in docs/features/streaming-events.md already documents the event without it. --- nodejs/docs/agent-author.md | 4 ++-- nodejs/docs/examples.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nodejs/docs/agent-author.md b/nodejs/docs/agent-author.md index 9071814425..fa4bfb1baf 100644 --- a/nodejs/docs/agent-author.md +++ b/nodejs/docs/agent-author.md @@ -258,7 +258,7 @@ Subscribe to session events. Returns an unsubscribe function. ```js const unsub = session.on("tool.execution_complete", (event) => { - // event.data.toolName, event.data.success, event.data.result + // event.data.success, event.data.result }); ``` @@ -268,7 +268,7 @@ const unsub = session.on("tool.execution_complete", (event) => { | ------------------------- | ------------------------------------------------------ | | `assistant.message` | `content`, `messageId` | | `tool.execution_start` | `toolCallId`, `toolName`, `arguments` | -| `tool.execution_complete` | `toolCallId`, `toolName`, `success`, `result`, `error` | +| `tool.execution_complete` | `toolCallId`, `success`, `result`, `error` | | `user.message` | `content`, `attachments`, `source` | | `session.idle` | `backgroundTasks` | | `session.error` | `errorType`, `message`, `stack` | diff --git a/nodejs/docs/examples.md b/nodejs/docs/examples.md index 1bac87982e..a1c016cdfa 100644 --- a/nodejs/docs/examples.md +++ b/nodejs/docs/examples.md @@ -368,7 +368,7 @@ session.on((event) => { ```js const unsubscribe = session.on("tool.execution_complete", (event) => { - // event.data.toolName, event.data.success, event.data.result, event.data.error + // event.data.success, event.data.result, event.data.error }); // Later, stop listening @@ -417,7 +417,7 @@ session.on("assistant.message", (event) => { | `assistant.message` | Agent's final response | `content`, `messageId`, `toolRequests` | | `assistant.message_delta` | Message content chunks (ephemeral) | `deltaContent` | | `tool.execution_start` | A tool is about to run | `toolCallId`, `toolName`, `arguments` | -| `tool.execution_complete` | A tool finished running | `toolCallId`, `toolName`, `success`, `result`, `error` | +| `tool.execution_complete` | A tool finished running | `toolCallId`, `success`, `result`, `error` | | `user.message` | User sent a message | `content`, `attachments`, `source` | | `session.idle` | Session finished processing a turn | `backgroundTasks` | | `session.error` | An error occurred | `errorType`, `message`, `stack` | @@ -677,6 +677,6 @@ session.on("assistant.message", (event) => { }); session.on("tool.execution_complete", (event) => { - // event.data.success, event.data.toolName, event.data.result + // event.data.success, event.data.result }); ```