Skip to content

Commit 890b1a7

Browse files
patnikoCopilot
andauthored
docs: add steering and queueing guide (#714)
* docs: add steering and queueing guide Add a comprehensive guide covering the two message delivery modes available through the SDK: - Steering (immediate mode): inject messages into the current agent turn for real-time course correction - Queueing (enqueue mode): buffer messages for sequential processing after the current turn completes Includes code examples for all four SDK languages (Node.js, Python, Go, .NET), a sequence diagram, API reference, UI building patterns, and best practices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: correct Python permission handler in steering guide Fix all 3 Python snippets to use the correct signature: - 2-arg lambda (req, inv) matching PermissionHandlerFn typedef - Return PermissionRequestResult dataclass instead of plain dict - Add 'from copilot.types import PermissionRequestResult' import The previous pattern (lambda req: {"kind": "approved"}) would fail at runtime: TypeError from wrong arg count, and AttributeError from dict lacking .kind attribute access. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: correct Python permission handler in skills and custom-agents guides Same fix as the steering guide — use correct 2-arg signature and PermissionRequestResult dataclass return type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 396e8b3 commit 890b1a7

File tree

3 files changed

+510
-2
lines changed

3 files changed

+510
-2
lines changed

docs/guides/custom-agents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const session = await client.createSession({
6565

6666
```python
6767
from copilot import CopilotClient
68+
from copilot.types import PermissionRequestResult
6869

6970
client = CopilotClient()
7071
await client.start()
@@ -87,7 +88,7 @@ session = await client.create_session({
8788
"prompt": "You are a code editor. Make minimal, surgical changes to files as requested.",
8889
},
8990
],
90-
"on_permission_request": lambda req: {"kind": "approved"},
91+
"on_permission_request": lambda req, inv: PermissionRequestResult(kind="approved"),
9192
})
9293
```
9394

docs/guides/skills.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ await session.sendAndWait({ prompt: "Review this code for security issues" });
4343

4444
```python
4545
from copilot import CopilotClient
46+
from copilot.types import PermissionRequestResult
4647

4748
async def main():
4849
client = CopilotClient()
@@ -54,7 +55,7 @@ async def main():
5455
"./skills/code-review",
5556
"./skills/documentation",
5657
],
57-
"on_permission_request": lambda req: {"kind": "approved"},
58+
"on_permission_request": lambda req, inv: PermissionRequestResult(kind="approved"),
5859
})
5960

6061
# Copilot now has access to skills in those directories

0 commit comments

Comments
 (0)