Skip to content

copilot-sdk skill Python examples are incompatible with github-copilot-sdk 1.0.9 #2662

Description

@charendt

The Python examples in skills/copilot-sdk/SKILL.md use an older SDK call shape:

session = await client.create_session({...})
await session.send_and_wait({"prompt": "..."})

With github-copilot-sdk==1.0.9, CopilotClient.create_session is keyword-only and CopilotSession.send_and_wait accepts a string prompt. As a result, the examples fail before the first model request.

The skill also states Python 3.8+ and requires an independently installed Copilot CLI. The current package metadata requires Python 3.11+ and documents a bundled runtime, which can be pre-downloaded with python -m copilot download-runtime.

Expected Python shape:

async with CopilotClient() as client:
    async with await client.create_session(
        on_permission_request=PermissionHandler.approve_all,
        model="gpt-5",
    ) as session:
        response = await session.send_and_wait("What is 2 + 2?")
        print(response.data.content)

Suggested scope:

  1. Update every Python create_session call to use keyword arguments.
  2. Update every Python send_and_wait call to pass a string.
  3. Update the Python requirement to 3.11+.
  4. Document the bundled runtime and optional pre-download command.
  5. Use context managers or explicit session disconnection in lifecycle examples.
  6. Add CI that validates Python snippets against the currently pinned package release.

References:

  • github/copilot-sdk/python/copilot/client.py
  • github/copilot-sdk/python/copilot/session.py
  • Current PyPI package metadata and quick start

I’m happy to open a pull request with these documentation fixes and snippet validation if maintainers agree with the proposed scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions