Skip to content

[pull] main from github:main - #250

Merged
pull[bot] merged 1 commit into
ehtick:mainfrom
github:main
Aug 4, 2026
Merged

[pull] main from github:main#250
pull[bot] merged 1 commit into
ehtick:mainfrom
github:main

Conversation

@pull

@pull pull Bot commented Aug 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…l-registration API (#2223)

The Node.js example in the "CLI -> SDK (inbound)" section of
docs/observability/opentelemetry.md registered a tool by calling
session.registerTool(myTool, handler). That method is not part of the public
CopilotSession API, so copying the example fails to compile with

  error TS2339: Property 'registerTool' does not exist on type 'CopilotSession'

and, if the types are bypassed, throws
"TypeError: session.registerTool is not a function" at runtime. The plural
registerTools() is marked @internal and stripped from the shipped declarations,
so there is no public session method to register a tool with after the session
exists.

Move the trace-restoring handler into defineTool() and register the tool through
client.createSession({ tools: [myTool] }), which is the public registration path
and the one used by the rest of the documentation. The trace-context logic is
unchanged; only the registration mechanism is corrected. As a side effect the
handler's args and invocation parameters are now contextually typed, so the
invocation.traceparent / invocation.tracestate access in the example is actually
type-checked.

Co-authored-by: examon <examon@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Aug 4, 2026
@pull pull Bot added the ⤵️ pull label Aug 4, 2026
@pull
pull Bot merged commit bfebe1b into ehtick:main Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant