Skip to content

Forward internalCorrelationIds through session create/resume#1820

Draft
belaltaher8 wants to merge 1 commit into
github:mainfrom
belaltaher8:belaltaher8/internal-correlation-ids
Draft

Forward internalCorrelationIds through session create/resume#1820
belaltaher8 wants to merge 1 commit into
github:mainfrom
belaltaher8:belaltaher8/internal-correlation-ids

Conversation

@belaltaher8

@belaltaher8 belaltaher8 commented Jun 28, 2026

Copy link
Copy Markdown

What

Forward an internalCorrelationIds map through the SDK's session.create and session.resume payloads

Why

How

Verification

  • npm run typecheck
  • npm run build ✅ — confirmed the field is absent from every emitted dist/**/*.d.ts (stripped) but present in the compiled dist/**/client.js bag.
  • npm run lint ✅ (only pre-existing warnings in untouched test files)
  • New tests pass: forwards / omits internalCorrelationIds on create + resume.

The runtime already accepts an `internalCorrelationIds` param on
`session.create`/`session.resume` and stamps each entry onto every
emitted telemetry event as an `sdk_correlation_<key>` property. The SDK,
however, builds its wire bag by explicitly enumerating fields, so the
value never reached the runtime and could not be set by first-party
hosts (e.g. the Copilot cloud agent) that need to join the runtime's CLI
telemetry stream back to their own job/repo identifiers.

Add an `@internal` `internalCorrelationIds` field on `SessionConfigBase`
(stripped from the published type declarations via `stripInternal`, so
third-party integrators do not see it) and forward it in both the
`session.create` and `session.resume` payloads, mirroring the existing
`expAssignments` passthrough.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@belaltaher8 belaltaher8 requested a review from a team as a code owner June 28, 2026 03:46
Copilot AI review requested due to automatic review settings June 28, 2026 03:46
@belaltaher8 belaltaher8 marked this pull request as draft June 28, 2026 03:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures first-party hosts can pass through an internalCorrelationIds string map during session lifecycle calls so the Copilot runtime can stamp those IDs onto its telemetry events for cross-system correlation, without introducing a new public typed API surface in the published Node SDK.

Changes:

  • Added @internal internalCorrelationIds?: Record<string, string> to SessionConfigBase (stripped from published d.ts via stripInternal).
  • Forwarded config.internalCorrelationIds in the session.create and session.resume JSON-RPC parameter bags.
  • Added unit tests that mirror the existing expAssignments forwarding/omission tests for both create and resume.
Show a summary per file
File Description
nodejs/src/types.ts Adds the @internal internalCorrelationIds config field intended for first-party correlation passthrough.
nodejs/src/client.ts Threads internalCorrelationIds through the explicitly enumerated session.create / session.resume request payloads.
nodejs/test/client.test.ts Adds coverage verifying internalCorrelationIds is forwarded (or undefined when unset) for create and resume.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Low

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants