Skip to content

Update import statement for PermissionHandler#950

Open
rrachedEnterprise wants to merge 1 commit intogithub:mainfrom
rrachedEnterprise:patch-1
Open

Update import statement for PermissionHandler#950
rrachedEnterprise wants to merge 1 commit intogithub:mainfrom
rrachedEnterprise:patch-1

Conversation

@rrachedEnterprise
Copy link
Copy Markdown

the example uses an outdated SDK API.
Fixed PermissionHandler import.

the example uses an outdated SDK API.
Fixed PermissionHandler import.
@rrachedEnterprise rrachedEnterprise requested a review from a team as a code owner March 27, 2026 17:36
Copilot AI review requested due to automatic review settings March 27, 2026 17:36
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

Updates the Python “getting started” documentation snippet to use a new import path for PermissionHandler, aiming to reflect the current Python SDK API.

Changes:

  • Modified the Python quickstart example import for PermissionHandler in the getting-started guide.

import asyncio
from copilot import CopilotClient
from copilot.session import PermissionHandler
from copilot.types import PermissionHandler
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

copilot.types does not appear to exist in the Python package in this repo (PermissionHandler is defined in copilot.session). As written, this getting-started example will raise ModuleNotFoundError: No module named 'copilot.types'. Update the import back to from copilot.session import PermissionHandler (or add/re-export a copilot.types module if that’s the intended new public API) and keep the other Python snippets in this doc consistent.

Suggested change
from copilot.types import PermissionHandler
from copilot.session import PermissionHandler

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok - but the current github-copilot-sdk (github-copilot-sdk 0.2.0) places PermissionHandler inside copilot.types. And github-copilot-sdk 0.2.0 is the version a user would get when following the tutorial. (agreed that we woudl also need to change all other imports in the tutorial for consistency).

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