Skip to content

Rename github-copilot-sdk to copilot-sdk and update to SDK 2.0 - #987

Merged
brendaweles merged 3 commits into
masterfrom
update/microsoft-copilot-sdk
Dec 3, 2026
Merged

brendaweles merged 3 commits into
masterfrom
update/microsoft-copilot-sdk

Conversation

@realpython-bot

@realpython-bot realpython-bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Updates the companion code for Copilot SDK: Put a Coding Agent in Your Python Code (Post 2371, unpublished; admin).

Why

On Nov 17, 2026, the GitHub Copilot SDK was rebranded as the Microsoft Copilot SDK and released as v2.0.0 with breaking changes. github-copilot-sdk is now deprecated on PyPI, and none of the four scripts ran on 2.x as written. The tutorial was updated to the new package and name, and its slug changed from github-copilot-sdk to copilot-sdk.

Changes

  • Renamed the folder github-copilot-sdk/ → copilot-sdk/, matching the tutorial's new brand-neutral slug (/copilot-sdk/, chosen after an Ahrefs check showed "copilot sdk" as the strongest current keyphrase). The copilot-sdk-code opt-in (ID 1425) already points at the new path.
  • requirements.txt: microsoft-copilot-sdk==2.0.6, pydantic==2.14.4.
  • All four scripts were ported to the 2.x API:
    • CopilotClient(github_token=token) → CopilotClient(mode="coding-agent", github={"token": token})
    • on_permission_request=... → permissions={"on_request": ...}
    • tools=[...] → tools={"definitions": [...]}
    • streaming=True → events={"streaming": True}
    • hello_agent.py and issue_agent.py now handle a None reply.
  • README: new title and link.

Verification

  • Python 3.14.10 on Linux. I installed from requirements.txt into a fresh venv and ran all four scripts against Copilot with a fine-grained PAT. hello_agent.py, issue_agent.py, and refactor_agent.py worked as the article describes. ci_agent.py gave FAIL and exit 1 for project/shopping.py, PASS and exit 0 for project/test_shopping.py, and left the file unchanged when asked to edit it.
  • Run from a subfolder of a larger git checkout (such as this repo), ci_agent.py sometimes fails closed. The agent asks to read the repo root, the policy rejects it, and the script exits 1 without reviewing. Run from a standalone folder or the zip download, it works as shown.
  • ruff format --check, ruff check (0.14.1), and dircheck.py pass.

🤖 Generated with Claude Code

realpython-bot and others added 2 commits December 3, 2026 12:39
The GitHub Copilot SDK was rebranded as the Microsoft Copilot SDK in v2.0.0,
and github-copilot-sdk is deprecated on PyPI. Move the folder to match the
tutorial's new slug, pin microsoft-copilot-sdk==2.0.6 and pydantic==2.14.4,
and port all four scripts to the 2.x API (required mode, nested github,
permissions, tools, and events options).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the tutorial's brand-neutral slug, chosen after Ahrefs showed
"copilot sdk" as the strongest current keyphrase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realpython-bot realpython-bot changed the title Rename github-copilot-sdk to microsoft-copilot-sdk and update to SDK 2.0 Rename github-copilot-sdk to copilot-sdk and update to SDK 2.0 Dec 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brendaweles
brendaweles merged commit 7509191 into master Dec 3, 2026
1 check passed
@brendaweles
brendaweles deleted the update/microsoft-copilot-sdk branch December 3, 2026 17:18
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.

2 participants