forward CustomAgentsLocalOnly in session.create and session.resume
Summary
Forward CustomAgentsLocalOnly from SessionConfig / ResumeSessionConfig into the .NET SDK's session.create and session.resume wire payloads.
Motivation
Fixes #1888. Agent discovery runs during session initialization. The .NET SDK previously only sent customAgentsLocalOnly via the post-create session.options.update call, which arrives too late to restrict discovery to the working directory. The Go SDK already includes this field in session.create / session.resume.
Changes
- Add
customAgentsLocalOnlyto internalCreateSessionRequestandResumeSessionRequestrecords - Populate the field from
config.CustomAgentsLocalOnlyinCreateSessionAsyncandResumeSessionAsync - Add unit serialization tests (serialize when set, omit when null)
- Add E2E wire-capture tests for create and resume requests
Tests
dotnet test test/GitHub.Copilot.SDK.Test.csproj --filter FullyQualifiedName~GitHub.Copilot.Test.Unit— 155 passed- New serialization tests for
customAgentsLocalOnly— passed - E2E wire-capture tests added (same harness as existing
ClientOptionsE2ETests; requiretsxin CI)
Notes
- Post-create
session.options.updatebehavior is unchanged; this only ensures the value is present at initialization time. - Pre-submit review (composer-2.5): APPROVE 4/5 — minimal fix matching Go SDK behavior for explicitly configured values.
Fixes #1888
Thanks. I've pushed an additional commit on top that propagates this to all other language SDKs and also fixes the CustomAgentsLocalOnly behavior in Empty mode.
@github/copilot-sdk can someone give this a look please?