Skip to content

Python: Upgrade github-copilot-sdk to v1.0.0b2 with new features#5665

Open
giles17 wants to merge 4 commits intomicrosoft:mainfrom
giles17:gh-copilot-v1-beta
Open

Python: Upgrade github-copilot-sdk to v1.0.0b2 with new features#5665
giles17 wants to merge 4 commits intomicrosoft:mainfrom
giles17:gh-copilot-v1-beta

Conversation

@giles17
Copy link
Copy Markdown
Contributor

@giles17 giles17 commented May 5, 2026

Motivation and Context

Upgrades the github-copilot-sdk dependency from v0.2.1 to v1.0.0-beta.2 and implements the new features exposed by this release. This keeps our integration current with the latest SDK capabilities.

Description

Dependency upgrade:

  • Bumps github-copilot-sdk from >=0.2.1,<=0.2.1 to >=1.0.0b2,<=1.0.0b2
  • Fixes breaking type renames: ErrorClass -> ToolExecutionCompleteError, Result -> ToolExecutionCompleteResult
  • Fixes mypy union-attr errors from SessionEvent.data type change (now a discriminated union)

New features:

  • instruction_directories - session-level option in GitHubCopilotOptions that passes custom instruction directory paths to both create_session() and resume_session(), allowing the CLI to load project-specific or team-shared instruction files
  • copilot_home - client-level setting in GitHubCopilotSettings (configurable via GITHUB_COPILOT_COPILOT_HOME env var) that controls where the CLI stores session state and config
  • _resume_session now forwards runtime options - model, system_message, mcp_servers, provider, and instruction_directories are all passed through on resumed sessions (previously silently dropped)

Tests and samples:

  • 9 new unit tests distributed across existing test classes (105 total)
  • New sample: github_copilot_with_instruction_directories.py
  • Updated README with new env var and sample entry

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add BREAKING prefix to the title of the PR.

- Bump github-copilot-sdk dependency from 0.2.1 to 1.0.0b1
- Fix breaking type renames: ErrorClass -> ToolExecutionCompleteError,
  Result -> ToolExecutionCompleteResult
- Add instruction_directories support in GitHubCopilotOptions (session-level)
- Add copilot_home support in GitHubCopilotSettings (client-level)
- Add sample: github_copilot_with_instruction_directories.py
- Update README with new env var and sample entry
- Add 8 new unit tests covering the new features (103 total, 96% coverage)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 22:23
@moonbox3 moonbox3 added documentation Improvements or additions to documentation python labels May 5, 2026
@giles17 giles17 marked this pull request as draft May 5, 2026 22:26
@moonbox3
Copy link
Copy Markdown
Contributor

moonbox3 commented May 5, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/github_copilot/agent_framework_github_copilot
   _agent.py3301396%45–46, 52, 124, 468, 483–484, 774–775, 813, 816, 883, 921
TOTAL33707390188% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
6600 30 💤 0 ❌ 0 🔥 1m 42s ⏱️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the Python github-copilot-sdk dependency to 1.0.0b1 and updates the Agent Framework GitHub Copilot integration to support newly added SDK features (session-level instruction_directories and client-level copilot_home), along with corresponding tests and samples.

Changes:

  • Bump github-copilot-sdk to 1.0.0b1 (lockfile + package dependency) and update tests for renamed SDK types.
  • Add support for copilot_home (SubprocessConfig passthrough, env var GITHUB_COPILOT_COPILOT_HOME) and instruction_directories (passed to create_session()).
  • Add a new sample + README entry demonstrating instruction directories; minor formatting tweaks in existing samples.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/uv.lock Locks github-copilot-sdk to 1.0.0b1 artifacts.
python/samples/04-hosting/container/hyperlight_codeact/call_server.py Minor string formatting cleanup for the default endpoint.
python/samples/02-agents/security/email_security_example.py Wrap long agent.run(...) call for readability.
python/samples/02-agents/providers/github_copilot/README.md Documents GITHUB_COPILOT_COPILOT_HOME and adds the new sample link.
python/samples/02-agents/providers/github_copilot/github_copilot_with_instruction_directories.py New sample demonstrating instruction_directories.
python/packages/github_copilot/tests/test_github_copilot_agent.py Adds/updates unit tests for new options and SDK type renames.
python/packages/github_copilot/pyproject.toml Pins github-copilot-sdk to 1.0.0b1.
python/packages/github_copilot/agent_framework_github_copilot/_agent.py Implements copilot_home and instruction_directories plumbing into client/session creation.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 4 | Confidence: 89% | Result: All clear

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


Automated review by giles17's agents

@giles17 giles17 force-pushed the gh-copilot-v1-beta branch from 231a24f to 5b32a1d Compare May 5, 2026 22:49
@giles17 giles17 force-pushed the gh-copilot-v1-beta branch from 5b32a1d to aaf2913 Compare May 5, 2026 22:53
@giles17 giles17 marked this pull request as ready for review May 6, 2026 17:16
Comment thread python/packages/github_copilot/agent_framework_github_copilot/_agent.py Outdated
…s, bump to beta.2

- Forward runtime_options through _resume_session (fixes silent drop of
  instruction_directories/model/etc on resumed sessions)
- Remove copilot_home from GitHubCopilotOptions (client-level setting only
  consumed at startup, not per-call)
- Bump github-copilot-sdk from 1.0.0b1 to 1.0.0b2
- Add test for instruction_directories override on resumed sessions
- Update existing resume test to match new _resume_session signature

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giles17 giles17 changed the title Python: Upgrade github-copilot-sdk to v1.0.0b1 with new features Python: Upgrade github-copilot-sdk to v1.0.0b2 with new features May 7, 2026
@giles17 giles17 requested a review from moonbox3 May 7, 2026 19:57
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 python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants