Skip to content

docs(node): fix snippets that fail to run or compile - #1636

Merged
willkill07 merged 1 commit into
NVIDIA:release/0.11from
greysonlalonde:docs/node-snippet-fixes
Nov 4, 2026
Merged

willkill07 merged 1 commit into
NVIDIA:release/0.11from
greysonlalonde:docs/node-snippet-fixes

Conversation

@greysonlalonde

@greysonlalonde greysonlalonde commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR fixes Node.js documentation examples that do not compile or run as written.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • use es module imports in examples with top-level await.
  • use toolCallExecuteAsync and llmCallExecuteAsync with asynchronous callbacks.
  • use ToolHandle and LlmHandle for manual lifecycle helpers.
  • add an explicit result codec to the typed tool example.
  • correct the response type cast in the llm wrapper example.
  • wait for subscriber delivery in provider codec examples.
  • update the node package readme to use a consistent module format.

Where should the reviewer start?

start with docs/integrate-into-frameworks/wrap-tool-calls.mdx and docs/integrate-into-frameworks/wrap-llm-calls.mdx to review the asynchronous execution changes.

then review:

  • docs/integrate-into-frameworks/using-codecs.mdx for the typed result codec.
  • docs/integrate-into-frameworks/provider-codecs.mdx for subscriber delivery.
  • docs/integrate-into-frameworks/code-examples.mdx for the corrected handle types.
  • crates/node/README.md for the module import change.

Summary by CodeRabbit

  • Documentation
    • Updated Node.js examples to use ES module imports and asynchronous execution patterns.
    • Improved type annotations for framework integration examples.
    • Added subscriber flushing and a custom result codec to relevant examples.

- switch three blocks mixing `require` with top-level `await` to `import`
- call `toolCallExecuteAsync` and `llmCallExecuteAsync` where callbacks
  are async
- brace stream collector and type handles with `ToolHandle` and
  `LlmHandle` in `code-examples.mdx`
- use `resultCodec` in typed tool boundary example in `using-codecs.mdx`
- cast awaited response `as LlmResponse` in `wrap-llm-calls.mdx`
- call `flushSubscribers` before exit in `provider-codecs.mdx` and
  `provider-response-codecs.mdx`

Signed-off-by: Greyson Lalonde <[email protected]>
@greysonlalonde greysonlalonde added this to the 0.11 milestone Nov 3, 2026
@greysonlalonde greysonlalonde self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The pull request updates Node.js documentation examples to use ES module imports and asynchronous execution APIs. It also adds specific framework handle types and a custom codec, and calls flushSubscribers after typed LLM execution.

Changes

Node.js documentation examples

Layer / File(s) Summary
Module imports and framework handle types
docs/configure-plugins/*.mdx, docs/integrate-into-frameworks/code-examples.mdx
Plugin examples use ES module imports. Framework completion examples use LlmHandle and ToolHandle for handle parameters.
Asynchronous execution examples
crates/node/README.md, docs/instrument-applications/code-examples.mdx, docs/integrate-into-frameworks/non-serializable-data.mdx, docs/integrate-into-frameworks/wrap-llm-calls.mdx, docs/integrate-into-frameworks/wrap-tool-calls.mdx
Examples use asynchronous LLM and tool execution APIs. The streaming collector uses a block-bodied callback that pushes chunks into collected.
Codec examples and subscriber flushing
docs/integrate-into-frameworks/provider-codecs.mdx, docs/integrate-into-frameworks/provider-response-codecs.mdx, docs/integrate-into-frameworks/using-codecs.mdx
Typed tool examples define and pass a SearchResult codec. Provider codec examples call flushSubscribers after typed LLM execution.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • NVIDIA/NeMo-Relay#1442: Documents Node.js stream cleanup and subscriber flushing, which also appear in the streaming and provider codec examples updated here.
Merge Risk: Minimal · up to 35c00

The PR updates documentation examples without an established merge-blocking defect.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title follows Conventional Commits format with the allowed lowercase type docs, lowercase scope node, an imperative summary, no trailing period, and 52 characters.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template. It has the Overview, Details, Where should the reviewer start, and Related Issues sections. The author checked both confirmation boxes and listed the c…
Full details: Description check

Explanation

The description follows the repository template. It has the Overview, Details, Where should the reviewer start, and Related Issues sections. The author checked both confirmation boxes and listed the concrete changes in the Details section. The reviewer guidance names the key files. Two gaps remain. The Overview keeps the template placeholder comment, and the Related Issues section is blank, with no 'Closes', 'Fixes', 'Resolves', or 'Relates to' entry. The PR objectives cite PR #1636, but the description does not link it. No test results are reported, though the description does not require them.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d5c024d and 35c0096.

Files selected for processing: 11
  • crates/node/README.md
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/initialize-plugins.mdx
  • docs/instrument-applications/code-examples.mdx
  • docs/integrate-into-frameworks/code-examples.mdx
  • docs/integrate-into-frameworks/non-serializable-data.mdx
  • docs/integrate-into-frameworks/provider-codecs.mdx
  • docs/integrate-into-frameworks/provider-response-codecs.mdx
  • docs/integrate-into-frameworks/using-codecs.mdx
  • docs/integrate-into-frameworks/wrap-llm-calls.mdx
  • docs/integrate-into-frameworks/wrap-tool-calls.mdx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

Recent review details
Context from checks skipped due to timeout: 4
  • GitHub Check: Prepare
  • GitHub Check: Detect docs changes
  • GitHub Check: request / require-nvskills-ci / require-nvskills-ci
  • GitHub Check: Apply PR labels
Additional context used
Code guidelines: 5
.agents/skills/contribute-docs/SKILL.md — configured
AGENTS.md — configured
.agents/skills/add-binding-feature/SKILL.md — configured
CLAUDE.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
Path-based instructions: 8
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

CodeRabbit configuration file

Files:

  • docs/configure-plugins/initialize-plugins.mdx
  • docs/integrate-into-frameworks/provider-response-codecs.mdx
  • docs/integrate-into-frameworks/non-serializable-data.mdx
  • docs/integrate-into-frameworks/wrap-tool-calls.mdx
  • docs/instrument-applications/code-examples.mdx
  • docs/integrate-into-frameworks/wrap-llm-calls.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/integrate-into-frameworks/provider-codecs.mdx
  • docs/integrate-into-frameworks/code-examples.mdx
  • docs/integrate-into-frameworks/using-codecs.mdx
Treat binding changes as public API changes.

CodeRabbit configuration file

Files:

  • crates/node/README.md
Source excerpt: In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/configure-plugins/initialize-plugins.mdx
  • docs/integrate-into-frameworks/provider-response-codecs.mdx
  • docs/integrate-into-frameworks/non-serializable-data.mdx
  • docs/integrate-into-frameworks/wrap-tool-calls.mdx
  • docs/instrument-applications/code-examples.mdx
  • docs/integrate-into-frameworks/wrap-llm-calls.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/integrate-into-frameworks/provider-codecs.mdx
  • docs/integrate-into-frameworks/code-examples.mdx
  • docs/integrate-into-frameworks/using-codecs.mdx
Source excerpt: Update public documentation and examples when public behavior, package names, supported bindings, or documented workflows change.

CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/configure-plugins/initialize-plugins.mdx
  • docs/integrate-into-frameworks/provider-response-codecs.mdx
  • docs/integrate-into-frameworks/non-serializable-data.mdx
  • docs/integrate-into-frameworks/wrap-tool-calls.mdx
  • docs/instrument-applications/code-examples.mdx
  • docs/integrate-into-frameworks/wrap-llm-calls.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/integrate-into-frameworks/provider-codecs.mdx
  • docs/integrate-into-frameworks/code-examples.mdx
  • docs/integrate-into-frameworks/using-codecs.mdx
Source excerpt: [ ] `README.md`, `docs/getting-started/`, or binding-level READMEs updated if behavior differs by language Source excerpt: [ ] Relevant getting-started, README, or example docs updated if usage changed

CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Files:

  • crates/node/README.md
Source excerpt: [ ] Relevant package or crate `README.md` files updated when examples or binding guidance changed

CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • crates/node/README.md
Source excerpt: A public or observable runtime change requires identifying which bindings expose the affected contract.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • crates/node/README.md
Source excerpt: Verify MDX files use JSX delimiters for top-of-file SPDX comments.

CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/configure-plugins/initialize-plugins.mdx
  • docs/integrate-into-frameworks/provider-response-codecs.mdx
  • docs/integrate-into-frameworks/non-serializable-data.mdx
  • docs/integrate-into-frameworks/wrap-tool-calls.mdx
  • docs/instrument-applications/code-examples.mdx
  • docs/integrate-into-frameworks/wrap-llm-calls.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/integrate-into-frameworks/provider-codecs.mdx
  • docs/integrate-into-frameworks/code-examples.mdx
  • docs/integrate-into-frameworks/using-codecs.mdx
Learnings: 1
Learning: 2026-08-03T17:31:06.265Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 654
File: crates/node/src/callable.rs:1205-1212
Timestamp: 2026-08-03T17:31:06.265Z
Learning: In the Node binding, `flushSubscribers()` is defined to fully drain Promise-returning event subscriber callbacks. Do not recommend an arbitrary timeout for unsettled subscriber promises without a separate lifecycle-policy decision, because a timeout changes this contract.

Applied to files:

  • docs/integrate-into-frameworks/provider-codecs.mdx
Additional comments: 11
docs/integrate-into-frameworks/using-codecs.mdx: 1

214-214: LGTM!

Also applies to: 223-226, 233-233

docs/integrate-into-frameworks/provider-codecs.mdx: 1

258-258: LGTM!

Also applies to: 315-315

docs/integrate-into-frameworks/provider-response-codecs.mdx: 1

519-519: LGTM!

Also applies to: 544-544

docs/configure-plugins/adaptive/configuration.mdx: 1

157-158: LGTM!

docs/configure-plugins/initialize-plugins.mdx: 1

101-102: LGTM!

docs/integrate-into-frameworks/code-examples.mdx: 1

79-87: LGTM!

Also applies to: 93-93, 102-102

crates/node/README.md: 1

112-112: LGTM!

docs/instrument-applications/code-examples.mdx: 1

110-110: LGTM!

Also applies to: 114-114, 232-234

docs/integrate-into-frameworks/non-serializable-data.mdx: 1

77-77: LGTM!

Also applies to: 85-85

docs/integrate-into-frameworks/wrap-llm-calls.mdx: 1

112-112: LGTM!

Also applies to: 120-120, 129-129

docs/integrate-into-frameworks/wrap-tool-calls.mdx: 1

78-78: LGTM!

Also applies to: 86-86, 154-154

@greysonlalonde
greysonlalonde marked this pull request as ready for review November 3, 2026 23:12
@greysonlalonde
greysonlalonde requested review from a team as code owners November 3, 2026 23:12
@github-actions github-actions Bot added size:S PR is small Documentation documentation-related labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

@willkill07
willkill07 merged commit 57184ba into NVIDIA:release/0.11 Nov 4, 2026
28 of 32 checks passed

This branch was previously deployed

1 inactive deployment
fern — 35c00969 Deployed Nov 4, 2026 by willkill07 via Clean up docs preview #6982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation documentation-related size:S PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants