docs: correct the delta field the MAF streaming example reads - #2105
Merged
Conversation
The "Node.js / TypeScript (standalone SDK)" example under "Streaming responses" registered an `assistant.message_delta` handler that read `event.data.delta`. The payload type for that event, `AssistantMessageDeltaData`, declares `deltaContent`; there is no `delta`. The read therefore evaluated to `undefined` and the handler wrote nothing for each delta event, so none of the streamed text reached stdout. `deltaContent` is required, so the `?? ""` fallback is inert; it is kept as-is to hold the change to the single field name.
Contributor
There was a problem hiding this comment.
Pull request overview
Corrects the Microsoft Agent Framework TypeScript streaming example to read the actual delta payload field.
Changes:
- Replaces nonexistent
event.data.deltawithevent.data.deltaContent.
Show a summary per file
| File | Description |
|---|---|
docs/integrations/microsoft-agent-framework.md |
Fixes streamed response output in the standalone SDK example. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
SteveSandersonMS
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2104
The "Node.js / TypeScript (standalone SDK)" example under Streaming responses in the Microsoft Agent Framework guide registered an
assistant.message_deltahandler that readevent.data.delta. The payload type for that event,AssistantMessageDeltaData, declaresdeltaContent; there is nodelta. The read therefore evaluated toundefined, the?? ""fallback turned that into an empty string, and the handler wrote nothing for each delta event.The change
session.on("assistant.message_delta", (event) => { - process.stdout.write(event.data.delta ?? ""); + process.stdout.write(event.data.deltaContent ?? ""); });docs/integrations/microsoft-agent-framework.md, one line.event.data.deltaappeared exactly once in the repository; it now appears nowhere.deltaContentis required, so the?? ""fallback is inert either way. It is kept as-is to hold the change to the single field name.Why
deltaContentAssistantMessageDeltaData(nodejs/src/generated/session-events.ts) declaresdeltaContent,messageIdand an optional deprecatedparentToolCallId. The generated types for Go, .NET, Java and Python agree on the same wire field, and the Java example in this same section of this same guide already callsevent.getData().deltaContent().Verification
Extracting the doc block and type-checking it against the SDK source types, with the compiler options
scripts/docs-validation/validate.tsgenerates:snippet.ts(11,37): error TS2339: Property 'delta' does not exist on type 'AssistantMessageDeltaData'.(exit 2)That is the block's only type error, and this change removes it.
Observed behaviour, using an instrumented handler that accumulates both accessors side by side rather than the doc block verbatim:
Checks run in
nodejs/:npm run lint,npm run typecheck,npm run format:checkandnpm testall pass.