Repository navigation
Commit 23d9a45
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>1 parent 079c558 commit 23d9a45
19 files changed
Lines changed: 685 additions & 6 deletions
File tree
- dotnet
- src
- test/Unit
- go
- java/src
- main/java/com/github/copilot
- rpc
- test/java/com/github/copilot
- nodejs
- src
- test
- python
- copilot
- rust/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | | - | |
| 1006 | + | |
| 1007 | + | |
1007 | 1008 | | |
1008 | 1009 | | |
1009 | 1010 | | |
| |||
1204 | 1205 | | |
1205 | 1206 | | |
1206 | 1207 | | |
1207 | | - | |
| 1208 | + | |
| 1209 | + | |
1208 | 1210 | | |
1209 | 1211 | | |
1210 | 1212 | | |
| |||
2444 | 2446 | | |
2445 | 2447 | | |
2446 | 2448 | | |
2447 | | - | |
| 2449 | + | |
| 2450 | + | |
2448 | 2451 | | |
2449 | 2452 | | |
2450 | 2453 | | |
| |||
2539 | 2542 | | |
2540 | 2543 | | |
2541 | 2544 | | |
2542 | | - | |
| 2545 | + | |
| 2546 | + | |
2543 | 2547 | | |
2544 | 2548 | | |
2545 | 2549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2688 | 2688 | | |
2689 | 2689 | | |
2690 | 2690 | | |
| 2691 | + | |
2691 | 2692 | | |
2692 | 2693 | | |
2693 | 2694 | | |
| |||
3064 | 3065 | | |
3065 | 3066 | | |
3066 | 3067 | | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
3067 | 3085 | | |
3068 | 3086 | | |
3069 | 3087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
449 | 540 | | |
450 | 541 | | |
451 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
| |||
1043 | 1044 | | |
1044 | 1045 | | |
1045 | 1046 | | |
| 1047 | + | |
1046 | 1048 | | |
1047 | 1049 | | |
1048 | 1050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2220 | 2220 | | |
2221 | 2221 | | |
2222 | 2222 | | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1150 | 1162 | | |
1151 | 1163 | | |
1152 | 1164 | | |
| |||
1542 | 1554 | | |
1543 | 1555 | | |
1544 | 1556 | | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1545 | 1565 | | |
1546 | 1566 | | |
1547 | 1567 | | |
| |||
1892 | 1912 | | |
1893 | 1913 | | |
1894 | 1914 | | |
| 1915 | + | |
1895 | 1916 | | |
1896 | 1917 | | |
1897 | 1918 | | |
| |||
1976 | 1997 | | |
1977 | 1998 | | |
1978 | 1999 | | |
| 2000 | + | |
1979 | 2001 | | |
1980 | 2002 | | |
1981 | 2003 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| |||
884 | 888 | | |
885 | 889 | | |
886 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
887 | 903 | | |
0 commit comments