Skip to content

in Python SDK, multi-session methods like list_sessions and delete_session does not exist, raises AttributeError exception when trying to use it. #143

@zavocc

Description

@zavocc

I'm trying to implement multiple sessions on my bot according to this cookbook guide about multiple sessions: https://github.com/github/copilot-sdk/blob/main/cookbook/python/multiple-sessions.md

Which when I try to use list_sessions() method, it just throws AttributeError because it does not exist at all from CopilotClient object, same thing for delete_session() method which does not exist.

Here's the sample code to reproduce

import asyncio
from copilot import CopilotClient

async def main():
    client = CopilotClient()
    await client.start()

    session = await client.create_session({
        "session_id": "test-session-123",
        "model": "gpt-4.1"
    })
    response = await session.send_and_wait({"prompt": "Hello, world!"})

    print(response.data.content)

    await session.destroy()

    # List sessions - raises AttributeError exception ''CopilotClient' object has no attribute 'list_sessions'
    _sessions = await client.list_sessions()
    for s in _sessions:
        print(s)

    # Delete session, also raises similar exception
    await client.delete_session("test-session-123")
    
    # Stop
    await client.stop()

asyncio.run(main())

I'm currently using github-copilot-sdk version 0.1.16 in which as of writing this issue... this is the latest one installed from pip. Ubuntu 24.04, venv, Python 3.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions