Forward internalCorrelationIds through session create/resume#1820
Draft
belaltaher8 wants to merge 1 commit into
Draft
Forward internalCorrelationIds through session create/resume#1820belaltaher8 wants to merge 1 commit into
belaltaher8 wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
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>toSessionConfigBase(stripped from publishedd.tsviastripInternal). - Forwarded
config.internalCorrelationIdsin thesession.createandsession.resumeJSON-RPC parameter bags. - Added unit tests that mirror the existing
expAssignmentsforwarding/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
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.
What
Forward an
internalCorrelationIdsmap through the SDK'ssession.createandsession.resumepayloadsWhy
How
Verification
npm run typecheck✅npm run build✅ — confirmed the field is absent from every emitteddist/**/*.d.ts(stripped) but present in the compileddist/**/client.jsbag.npm run lint✅ (only pre-existing warnings in untouched test files)internalCorrelationIdson create + resume.