Skip to content

Commit 071fd5d

Browse files
authored
docs: remove the nonexistent toolName field from tool.execution_complete (#2212)
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. Co-authored-by: examon <examon@users.noreply.github.com>
1 parent 3b06ffd commit 071fd5d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

nodejs/docs/agent-author.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Subscribe to session events. Returns an unsubscribe function.
258258

259259
```js
260260
const unsub = session.on("tool.execution_complete", (event) => {
261-
// event.data.toolName, event.data.success, event.data.result
261+
// event.data.success, event.data.result
262262
});
263263
```
264264

@@ -268,7 +268,7 @@ const unsub = session.on("tool.execution_complete", (event) => {
268268
| ------------------------- | ------------------------------------------------------ |
269269
| `assistant.message` | `content`, `messageId` |
270270
| `tool.execution_start` | `toolCallId`, `toolName`, `arguments` |
271-
| `tool.execution_complete` | `toolCallId`, `toolName`, `success`, `result`, `error` |
271+
| `tool.execution_complete` | `toolCallId`, `success`, `result`, `error` |
272272
| `user.message` | `content`, `attachments`, `source` |
273273
| `session.idle` | `backgroundTasks` |
274274
| `session.error` | `errorType`, `message`, `stack` |

nodejs/docs/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ session.on((event) => {
368368
369369
```js
370370
const unsubscribe = session.on("tool.execution_complete", (event) => {
371-
// event.data.toolName, event.data.success, event.data.result, event.data.error
371+
// event.data.success, event.data.result, event.data.error
372372
});
373373
374374
// Later, stop listening
@@ -417,7 +417,7 @@ session.on("assistant.message", (event) => {
417417
| `assistant.message` | Agent's final response | `content`, `messageId`, `toolRequests` |
418418
| `assistant.message_delta` | Message content chunks (ephemeral) | `deltaContent` |
419419
| `tool.execution_start` | A tool is about to run | `toolCallId`, `toolName`, `arguments` |
420-
| `tool.execution_complete` | A tool finished running | `toolCallId`, `toolName`, `success`, `result`, `error` |
420+
| `tool.execution_complete` | A tool finished running | `toolCallId`, `success`, `result`, `error` |
421421
| `user.message` | User sent a message | `content`, `attachments`, `source` |
422422
| `session.idle` | Session finished processing a turn | `backgroundTasks` |
423423
| `session.error` | An error occurred | `errorType`, `message`, `stack` |
@@ -677,6 +677,6 @@ session.on("assistant.message", (event) => {
677677
});
678678
679679
session.on("tool.execution_complete", (event) => {
680-
// event.data.success, event.data.toolName, event.data.result
680+
// event.data.success, event.data.result
681681
});
682682
```

0 commit comments

Comments
 (0)