You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose exp_assignments injection on session create/resume across all SDKs (#1750)
* Add exp_assignments injection to session create/resume config
Expose ExP assignment ("flight") data on the SDK's session-open and
session-resume paths so an out-of-process integrator can inject the same
CopilotExpAssignmentResponse payload the CLI fetches itself. The runtime
already accepts expAssignments on the wire, but the hand-written
SessionCreateWire / SessionResumeWire structs (and their public configs)
did not carry it.
- SessionConfig / ResumeSessionConfig: add doc-hidden exp_assignments
field (serde_json::Value) plus a doc-hidden with_exp_assignments builder
- SessionCreateWire / SessionResumeWire: add exp_assignments, serialized
as camelCase expAssignments and omitted when None
- Forward the field through both into_wire paths
- Unit tests asserting expAssignments is emitted on create and resume and
omitted when unset
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Expose exp_assignments injection across Node, Python, Go, .NET, Java SDKs
Mirror the Rust SDK change in the remaining five SDKs so out-of-process
integrators can inject ExP ("flight") assignment data into session create
and resume. Adds an internal/trusted-integrator config field that forwards
to the wire key `expAssignments` (omitted when unset), in the opaque JSON
shape of `CopilotExpAssignmentResponse`:
- Node: `expAssignments?: Record<string, unknown>` on `SessionConfigBase`
(`@internal`), forwarded in the inline session.create/session.resume
payloads in client.ts.
- Python: `exp_assignments: dict[str, Any] | None = None` kwarg on
`create_session`/`resume_session`, mapped to `payload["expAssignments"]`.
- Go: `ExpAssignments any` on `SessionConfig`/`ResumeSessionConfig`
(documented Internal:), forwarded into the create/resume wire structs
with `json:"expAssignments,omitempty"`.
- .NET: `JsonElement? ExpAssignments` on `SessionConfigBase`
(`[EditorBrowsable(Never)]`), wired through the internal
CreateSessionRequest/ResumeSessionRequest records.
- Java: `JsonNode expAssignments` field + fluent setter/getter on
SessionConfig/ResumeSessionConfig, mapped through
CreateSessionRequest/ResumeSessionRequest in SessionRequestBuilder.
Each language gains create+resume serialization tests asserting the field
serializes to `expAssignments` when set and is omitted when unset.
Part of github/github-app epic #7452; mirrors the runtime contract added
in github/copilot-agent-runtime#9955.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix .NET clone dropping ExpAssignments + add clone regression coverage
The SessionConfigBase copy constructor (used by SessionConfig.Clone() and
ResumeSessionConfig.Clone()) did not copy the newly added ExpAssignments
property, so cloning a config silently dropped it and it would not be
forwarded on create/resume. Copy it alongside the other base properties.
Cross-language audit of every config copy/clone path:
- .NET: had the gap (fixed here).
- Java: SessionConfig/ResumeSessionConfig clone() already copy expAssignments (safe).
- Rust: SessionConfig/ResumeSessionConfig derive Clone, no manual impl (safe).
- Node: createSession/resumeSession normalize via { ...defaults, ...config }
spread, which preserves all own properties (safe).
- Go: create/resume requests assign req.ExpAssignments = config.ExpAssignments
directly from the config pointer (safe).
- Python: exp_assignments is an explicit kwarg mapped straight into the
payload, no intermediate dict copy (safe).
Add clone regression tests for .NET, Java, and Rust (the three with explicit
Clone()/clone() methods) that set expAssignments, clone, and assert it
survives and is forwarded on the resulting create/resume request. The .NET
tests fail against the pre-fix copy constructor. Node's existing forward test
already exercises the spread-normalization copy path.
Switch the two new Java expAssignments tests off the deprecated
buildCreateRequest(SessionConfig) overload to the current
buildCreateRequest(SessionConfig, String) form to avoid new CodeQL debt.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments