From f79f5f4ec607cdda73ed8d595466cae8752203d0 Mon Sep 17 00:00:00 2001 From: examon Date: Mon, 27 Jul 2026 19:47:48 +0000 Subject: [PATCH] Fix the Python list_sessions docstring example to use session_id The Example block in CopilotClient.list_sessions printed session.sessionId, but list_sessions returns list[SessionMetadata], and that dataclass declares session_id. sessionId exists only as the wire key, mapped to session_id inside SessionMetadata.from_dict/to_dict, so anyone copying the documented example hit: AttributeError: 'SessionMetadata' object has no attribute 'sessionId' Use the attribute the returned dataclass actually declares. The Go and .NET bindings already document this method with their own idiomatic spelling of the same field. Docstring text only: no public API, behavior, or wire format change. --- python/copilot/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/copilot/client.py b/python/copilot/client.py index 401618355..a7706dfe5 100644 --- a/python/copilot/client.py +++ b/python/copilot/client.py @@ -3386,7 +3386,7 @@ async def list_sessions(self, filter: SessionListFilter | None = None) -> list[S Example: >>> sessions = await client.list_sessions() >>> for session in sessions: - ... print(f"Session: {session.sessionId}") + ... print(f"Session: {session.session_id}") >>> # Filter sessions by repository >>> from copilot.client import SessionListFilter >>> filtered = await client.list_sessions(SessionListFilter(repository="owner/repo"))