Commit e3cbdaa
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>1 parent ba36305 commit e3cbdaa
4 files changed
Lines changed: 96 additions & 2 deletions
File tree
- dotnet
- src
- test/Unit
- java/src/test/java/com/github/copilot
- rust/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2667 | 2667 | | |
2668 | 2668 | | |
2669 | 2669 | | |
| 2670 | + | |
2670 | 2671 | | |
2671 | 2672 | | |
2672 | 2673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 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 | + | |
499 | 536 | | |
500 | 537 | | |
501 | 538 | | |
| |||
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
879 | | - | |
| 879 | + | |
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
908 | 929 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5030 | 5030 | | |
5031 | 5031 | | |
5032 | 5032 | | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + | |
| 5036 | + | |
| 5037 | + | |
| 5038 | + | |
| 5039 | + | |
| 5040 | + | |
| 5041 | + | |
| 5042 | + | |
| 5043 | + | |
| 5044 | + | |
| 5045 | + | |
| 5046 | + | |
| 5047 | + | |
| 5048 | + | |
| 5049 | + | |
| 5050 | + | |
| 5051 | + | |
| 5052 | + | |
| 5053 | + | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
5033 | 5068 | | |
5034 | 5069 | | |
5035 | 5070 | | |
| |||
0 commit comments