From 08546b9160686174f3820ec5a8e99a595d0f0449 Mon Sep 17 00:00:00 2001 From: Stefan Sedich Date: Tue, 10 Mar 2026 13:57:11 -0700 Subject: [PATCH 1/5] fix: update Python example to work OOTB --- docs/getting-started.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index fe952182c..4de3a416d 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -129,15 +129,18 @@ Create `main.py`: ```python import asyncio -from copilot import CopilotClient +from copilot import CopilotClient, PermissionHandler async def main(): client = CopilotClient() await client.start() - session = await client.create_session({"model": "gpt-4.1"}) - response = await session.send_and_wait({"prompt": "What is 2 + 2?"}) + session = await client.create_session({ + "on_permission_request": PermissionHandler.approve_all, + "model": "gpt-4.1" + }) + response = await session.send_and_wait({"prompt": "What is 2 + 2?"}) print(response.data.content) await client.stop() From e3786debddca0faf04e851f8482e302a30e42be1 Mon Sep 17 00:00:00 2001 From: Stefan Sedich Date: Tue, 10 Mar 2026 14:03:22 -0700 Subject: [PATCH 2/5] fix: update all examples --- docs/getting-started.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 4de3a416d..d8eefd2df 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -136,8 +136,8 @@ async def main(): await client.start() session = await client.create_session({ - "on_permission_request": PermissionHandler.approve_all, - "model": "gpt-4.1" + "model": "gpt-4.1", + "on_permission_request": PermissionHandler.approve_all }) response = await session.send_and_wait({"prompt": "What is 2 + 2?"}) @@ -277,7 +277,7 @@ Update `main.py`: ```python import asyncio import sys -from copilot import CopilotClient +from copilot import CopilotClient, PermissionHandler from copilot.generated.session_events import SessionEventType async def main(): @@ -286,6 +286,7 @@ async def main(): session = await client.create_session({ "model": "gpt-4.1", + "on_permission_request": PermissionHandler.approve_all, "streaming": True, }) @@ -656,7 +657,7 @@ Update `main.py`: import asyncio import random import sys -from copilot import CopilotClient +from copilot import CopilotClient, PermissionHandler from copilot.tools import define_tool from copilot.generated.session_events import SessionEventType from pydantic import BaseModel, Field @@ -681,6 +682,7 @@ async def main(): session = await client.create_session({ "model": "gpt-4.1", + "on_permission_request": PermissionHandler.approve_all, "streaming": True, "tools": [get_weather], }) @@ -928,7 +930,7 @@ Create `weather_assistant.py`: import asyncio import random import sys -from copilot import CopilotClient +from copilot import CopilotClient, PermissionHandler from copilot.tools import define_tool from copilot.generated.session_events import SessionEventType from pydantic import BaseModel, Field @@ -950,6 +952,7 @@ async def main(): session = await client.create_session({ "model": "gpt-4.1", + "on_permission_request": PermissionHandler.approve_all, "streaming": True, "tools": [get_weather], }) From 8a97d3bfc31634fce3e1619c37b34398a19da366 Mon Sep 17 00:00:00 2001 From: Stefan Sedich Date: Tue, 10 Mar 2026 14:12:08 -0700 Subject: [PATCH 3/5] Update docs/getting-started.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/getting-started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index d8eefd2df..333bb585b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -136,9 +136,9 @@ async def main(): await client.start() session = await client.create_session({ - "model": "gpt-4.1", - "on_permission_request": PermissionHandler.approve_all - }) + "model": "gpt-4.1", + "on_permission_request": PermissionHandler.approve_all, + }) response = await session.send_and_wait({"prompt": "What is 2 + 2?"}) print(response.data.content) From 7ebb3af4385d11c592bdb9410ca9cbfa030eca9c Mon Sep 17 00:00:00 2001 From: Stefan Sedich Date: Tue, 10 Mar 2026 14:12:15 -0700 Subject: [PATCH 4/5] Update docs/getting-started.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 333bb585b..2c318f81e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -682,7 +682,7 @@ async def main(): session = await client.create_session({ "model": "gpt-4.1", - "on_permission_request": PermissionHandler.approve_all, + "on_permission_request": PermissionHandler.approve_all, "streaming": True, "tools": [get_weather], }) From d5428da73ee40a7e7a06dba50c3c4f76f3e193f0 Mon Sep 17 00:00:00 2001 From: Stefan Sedich Date: Tue, 10 Mar 2026 14:12:24 -0700 Subject: [PATCH 5/5] Update docs/getting-started.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 2c318f81e..e8c912b89 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -286,7 +286,7 @@ async def main(): session = await client.create_session({ "model": "gpt-4.1", - "on_permission_request": PermissionHandler.approve_all, + "on_permission_request": PermissionHandler.approve_all, "streaming": True, })