Fix PermissionHandler import path for github-copilot-sdk 0.3.0#146
Merged
Conversation
Agent-Logs-Url: https://github.com/microsoft/microbots/sessions/eb3e9f0c-2ac7-4c6e-a157-bc1795862612 Co-authored-by: 0xba1a <2942888+0xba1a@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
0xba1a
May 19, 2026 11:10
View session
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
==========================================
+ Coverage 64.95% 65.04% +0.08%
==========================================
Files 34 34
Lines 2374 2380 +6
==========================================
+ Hits 1542 1548 +6
Misses 832 832
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…(100% coverage) Agent-Logs-Url: https://github.com/microsoft/microbots/sessions/a7e5c16c-5821-4022-aa26-d04de2059e59 Co-authored-by: 0xba1a <2942888+0xba1a@users.noreply.github.com>
0xba1a
approved these changes
May 19, 2026
shivashanmugam
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The claim in the issue is correct.
CopilotBot.__init__did:In
github-copilot-sdk0.3.0 (released April 24, after microbots 0.0.17 on April 10),PermissionHandlerwas moved fromcopilot.typestocopilot.session, so users with the new SDK installed hit the innerImportErrorand saw a misleading "github-copilot-sdk is not installed" message. Verified against the SDK 0.3.0 PyPI README which documentsfrom copilot.session import PermissionHandler.Fix
In
src/microbots/bot/CopilotBot.py:try/exceptblocks so the "not installed" message is only raised when the SDK isn't installed.copilot.sessionfirst (SDK ≥ 0.3.0), fall back tocopilot.types(older SDKs).Tests
github-copilot-sdk0.3.0CopilotBot.__init__to importPermissionHandlerfromcopilot.sessionfirst, falling back tocopilot.typestry/exceptso a missingCopilotClient/ExternalServerConfigis what triggers the "not installed" messagePermissionHandleron bothcopilot.sessionandcopilot.types)PermissionHandleris loaded fromcopilot.sessionwhen present (SDK ≥ 0.3.0 path)copilot.typeswhencopilot.sessionlacks the attribute (old-SDK path)ImportErrorwhen neither module exposesPermissionHandlerCopilotBot.run()with each SDK layout simulated (newTestCopilotBotSDKLayoutIntegration)pytest -m "unit or integration"reports 65 passed, 2 skipped (the 2 skipped require real Docker+CLI+auth), with 100% line coverage onsrc/microbots/bot/CopilotBot.py