Skip to content

.NET: [BREAKING] Migrate .NET GitHub Copilot SDK to v1.0.0#6381

Merged
giles17 merged 5 commits into
microsoft:mainfrom
giles17:dotnet-ghcp-v1
Jun 8, 2026
Merged

.NET: [BREAKING] Migrate .NET GitHub Copilot SDK to v1.0.0#6381
giles17 merged 5 commits into
microsoft:mainfrom
giles17:dotnet-ghcp-v1

Conversation

@giles17

@giles17 giles17 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades the .NET Microsoft.Agents.AI.GitHub.Copilot package from GitHub.Copilot.SDK 1.0.0-beta.2 to stable 1.0.0.

Companion to the Python migration in #6292.

Breaking API Migrations

Change Before After
Namespace GitHub.Copilot.SDK GitHub.Copilot / GitHub.Copilot.Rpc
Permission handler return PermissionRequestResult PermissionDecision
Permission result PermissionRequestResultKind.Approved PermissionDecision.ApproveOnce()
Client options AutoStart = false Removed (client never auto-starts)
Client state check client.State != ConnectionState.Connected StartAsync() is idempotent
Config directory SessionConfig.ConfigDir SessionConfig.ConfigDirectory
Tools type ICollection<AIFunction> ICollection<AIFunctionDeclaration>
Attachment type UserMessageAttachmentFile AttachmentFile
Cache write tokens double? long?
Duration double? (milliseconds) TimeSpan?
Event subscription session.On(evt => ...) session.On<SessionEvent>(evt => ...)

Improvements

  • CopySessionConfig now uses SessionConfig.Clone() — automatically forwards all new properties added in v1.0.0
  • Added GHCP001 NoWarn at project level (follows framework convention for upstream experimental APIs, same as MEAI001/OPENAI001 elsewhere)

Files Modified (12)

  • Directory.Packages.props — version bump
  • GitHubCopilotAgent.cs — core API updates
  • CopilotClientExtensions.cs — namespace
  • Microsoft.Agents.AI.GitHub.Copilot.csproj — NoWarn
  • Unit tests (3 files) — namespace, types, NoWarn
  • Integration tests (2 files) — namespace, permission types, NoWarn
  • Sample Program.cs, README.md, .csproj — namespace, permission API, NoWarn

Testing

  • All 15 unit tests pass
  • Build clean across net8.0, net9.0, net10.0

- Update namespace from GitHub.Copilot.SDK to GitHub.Copilot
- Replace PermissionRequestResult/PermissionRequestResultKind with PermissionDecision
- Remove ConnectionState check (StartAsync is now idempotent)
- Rename ConfigDir to ConfigDirectory
- Use SessionConfig.Clone() for CopySessionConfig
- Update Tools type from List<AIFunction> to List<AIFunctionDeclaration>
- Rename UserMessageAttachmentFile to AttachmentFile
- Update usage data types (CacheWriteTokens: long, Duration: TimeSpan)
- Add GHCP001 NoWarn for experimental SDK APIs (matches framework convention)
- Specify type argument on CopilotSession.On<SessionEvent>()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 04:22
@moonbox3 moonbox3 added documentation Improvements or additions to documentation .NET labels Jun 8, 2026
@github-actions github-actions Bot changed the title Migrate .NET GitHub Copilot SDK to v1.0.0 .NET: Migrate .NET GitHub Copilot SDK to v1.0.0 Jun 8, 2026
@giles17 giles17 changed the title .NET: Migrate .NET GitHub Copilot SDK to v1.0.0 .NET: [BREAKING] Migrate .NET GitHub Copilot SDK to v1.0.0 Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET integration package (Microsoft.Agents.AI.GitHub.Copilot) to work with the stable GitHub.Copilot.SDK v1.0.0, adapting to the GA namespace and API breaking changes while keeping agent behavior consistent with the framework.

Changes:

  • Bumps GitHub.Copilot.SDK from 1.0.0-beta.2 to 1.0.0 and migrates code to the new namespaces (GitHub.Copilot + GitHub.Copilot.Rpc).
  • Updates agent/session glue code for SDK changes (idempotent StartAsync, typed On<SessionEvent>, attachment + tool declaration type updates, config clone usage).
  • Adds GHCP001 to NoWarn across the library, tests, and sample project to align with upstream/experimental warning-handling conventions.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dotnet/Directory.Packages.props Bumps GitHub.Copilot.SDK dependency to 1.0.0.
dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/Microsoft.Agents.AI.GitHub.Copilot.csproj Adds GHCP001 suppression at the library project level.
dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs Migrates core agent implementation to GA SDK APIs (session events, start semantics, config cloning, attachments, usage types).
dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/CopilotClientExtensions.cs Moves extension namespace to GitHub.Copilot to match the GA SDK surface.
dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests.csproj Adds GHCP001 suppression for unit test project.
dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/GitHubCopilotAgentTests.cs Updates unit tests for renamed types and config properties in v1.0.0.
dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.UnitTests/CopilotClientExtensionsTests.cs Updates extension tests for new namespaces / options behavior.
dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.IntegrationTests/Microsoft.Agents.AI.GitHub.Copilot.IntegrationTests.csproj Adds GHCP001 suppression for integration test project.
dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.IntegrationTests/GitHubCopilotAgentTests.cs Updates integration tests to use PermissionDecision API.
dotnet/samples/02-agents/AgentProviders/Agent_With_GitHubCopilot/README.md Updates sample docs to the GA namespaces.
dotnet/samples/02-agents/AgentProviders/Agent_With_GitHubCopilot/Program.cs Updates sample permission handler to PermissionDecision API and GA namespaces.
dotnet/samples/02-agents/AgentProviders/Agent_With_GitHubCopilot/Agent_With_GitHubCopilot.csproj Adds GHCP001 suppression for the sample project.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 87% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by giles17's agents

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
Azure Functions Core Tools v4 can no longer auto-detect the worker
runtime in CI (local.settings.json is gitignored). All 7 active
SamplesValidation tests fail with 'Worker runtime cannot be None'.

Tracked by: microsoft#6402

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
WorkflowSamplesValidation (5 tests): same func tools issue as microsoft#6402.
WorkflowConsoleAppSamplesValidation (4 tests): KeyNotFoundException
during workflow execution, tracked by microsoft#6404.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
@giles17 giles17 added this pull request to the merge queue Jun 8, 2026
Merged via the queue into microsoft:main with commit af77299 Jun 8, 2026
28 checks passed
learn-build-service-prod Bot pushed a commit to MicrosoftDocs/semantic-kernel-docs that referenced this pull request Jun 11, 2026
Update namespace from GitHub.Copilot.SDK to GitHub.Copilot, migrate
permission handler from PermissionRequestResult to PermissionDecision,
and remove --prerelease flag since the package is now stable.

Companion to microsoft/agent-framework#6381.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants