Skip to content

fix(dotnet): forward CustomAgentsLocalOnly in session.create and session.resume#1899

Open
syf2211 wants to merge 1 commit into
github:mainfrom
syf2211:fix/dotnet-custom-agents-local-only-session-create
Open

fix(dotnet): forward CustomAgentsLocalOnly in session.create and session.resume#1899
syf2211 wants to merge 1 commit into
github:mainfrom
syf2211:fix/dotnet-custom-agents-local-only-session-create

Conversation

@syf2211

@syf2211 syf2211 commented Jul 3, 2026

Copy link
Copy Markdown

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.Unit155 passed
  • New serialization tests for customAgentsLocalOnlypassed
  • 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

…ion.resume

CustomAgentsLocalOnly was only sent via the post-create
session.options.update call, which arrives after agent discovery
has already completed. Mirror the Go SDK by including
customAgentsLocalOnly in CreateSessionRequest and
ResumeSessionRequest wire payloads.

Fixes github#1888
@syf2211 syf2211 requested a review from a team as a code owner July 3, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CustomAgentsLocalOnly - Incorrect Behaviour

1 participant