copilot-sdk icon indicating copy to clipboard operation
copilot-sdk copied to clipboard

forward CustomAgentsLocalOnly in session.create and session.resume

Open syf2211 opened this issue 4 months ago • 2 comments

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 customAgentsLocalOnly to internal CreateSessionRequest and ResumeSessionRequest records
  • Populate the field from config.CustomAgentsLocalOnly in CreateSessionAsync and ResumeSessionAsync
  • 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; require tsx in CI)

Notes

  • Post-create session.options.update behavior 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

syf2211 avatar Jul 03 '26 10:07 syf2211

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.

roji avatar Jul 17 '26 11:07 roji

@github/copilot-sdk can someone give this a look please?

roji avatar Jul 17 '26 11:07 roji