Skip to content

Align Copilot SDK documentation with permission handling requirements#1107

Open
jamesmontemagno wants to merge 5 commits intogithub:stagedfrom
jamesmontemagno:clean/sdk-perms
Open

Align Copilot SDK documentation with permission handling requirements#1107
jamesmontemagno wants to merge 5 commits intogithub:stagedfrom
jamesmontemagno:clean/sdk-perms

Conversation

@jamesmontemagno
Copy link
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, or workflow file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, or workflow with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

Updates all Copilot SDK documentation and cookbook examples to consistently include explicit permission-handling configuration (onPermissionRequest/on_permission_request) when creating or resuming sessions.

Changes across 48 files:

  • Add approveAll / PermissionHandler.approve_all / PermissionHandler.ApproveAll to session creation examples across TypeScript/Node.js, Python, Go, and C#
  • Update resume-session examples to pass permission handling where supported
  • Align cookbook recipe code and corresponding markdown docs with the new permission-handling requirement
  • Fix review feedback: stray comma syntax error, unused imports replaced with consistent approveAll/PermissionHandler.approve_all usage, missing imports added to SKILL.md snippets

This is a clean rebased version of PR #1103 (which included unrelated files from a publish commit). Only SDK permission changes are included here.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify):

By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI and others added 3 commits March 20, 2026 17:23
Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jamesmontemagno/awesome-copilot/sessions/adf27a88-92f8-4ca6-b3fe-1204e3bb9963
Address 5 review comments from PR github#1103:

1. Fix invalid object literal syntax (stray comma) in resumeSession
   example in copilot-sdk-nodejs.instructions.md

2. Replace unused PermissionHandler import with actual usage in
   cookbook/copilot-sdk/python/recipe/ralph_loop.py (was using
   inline lambda instead)

3. Replace unused approveAll import with actual usage in
   cookbook/copilot-sdk/nodejs/recipe/ralph-loop.ts (was using
   inline handler instead)

4. Add missing PermissionHandler import to 4 Python code snippets
   in skills/copilot-sdk/SKILL.md that reference it without importing

5. Add missing approveAll import to 3 TypeScript code snippets
   in skills/copilot-sdk/SKILL.md that reference it without importing
Copilot AI review requested due to automatic review settings March 20, 2026 17:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Copilot SDK documentation and cookbook recipes to consistently include explicit permission-handling configuration when creating or resuming sessions, aligning examples across TypeScript/Node.js, Python, Go, and C#.

Changes:

  • Add onPermissionRequest: approveAll / on_permission_request: PermissionHandler.approve_all / OnPermissionRequest = PermissionHandler.ApproveAll to session creation examples.
  • Update resume-session examples to pass permission handling where supported.
  • Align runnable cookbook recipe source files and their corresponding markdown docs to match the new permission-handling requirement.

Reviewed changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
skills/copilot-sdk/SKILL.md Updates multi-language snippets to include permission handling during session creation/resume.
instructions/copilot-sdk-python.instructions.md Adds Python permission handler guidance across session lifecycle examples.
instructions/copilot-sdk-nodejs.instructions.md Adds Node.js permission handler guidance across session lifecycle examples.
instructions/copilot-sdk-go.instructions.md Adds Go permission handler fields in session config and resume examples.
instructions/copilot-sdk-csharp.instructions.md Adds C# permission handler properties in session config and resume examples.
cookbook/copilot-sdk/python/recipe/ralph_loop.py Uses PermissionHandler.approve_all for unattended operation.
cookbook/copilot-sdk/python/recipe/pr_visualization.py Adds permission handler to session config in runnable recipe.
cookbook/copilot-sdk/python/recipe/persisting_sessions.py Adds permission handling to create/resume session calls.
cookbook/copilot-sdk/python/recipe/multiple_sessions.py Adds permission handling to multiple-session creation.
cookbook/copilot-sdk/python/recipe/managing_local_files.py Adds permission handling to session creation.
cookbook/copilot-sdk/python/recipe/error_handling.py Adds permission handling to session creation in error handling recipe.
cookbook/copilot-sdk/python/recipe/accessibility_report.py Adds permission handling to session config in accessibility recipe.
cookbook/copilot-sdk/python/ralph-loop.md Updates Python docs snippet to include permission handling.
cookbook/copilot-sdk/python/pr-visualization.md Updates Python docs snippet to include permission handling.
cookbook/copilot-sdk/python/persisting-sessions.md Updates Python docs snippets to include permission handling for create/resume.
cookbook/copilot-sdk/python/multiple-sessions.md Updates Python docs snippets to include permission handling.
cookbook/copilot-sdk/python/managing-local-files.md Updates Python docs snippet to include permission handling.
cookbook/copilot-sdk/python/error-handling.md Updates Python docs snippets to include permission handling.
cookbook/copilot-sdk/python/accessibility-report.md Updates Python docs snippets to include permission handling.
cookbook/copilot-sdk/nodejs/recipe/ralph-loop.ts Uses approveAll for session permission handling in runnable recipe.
cookbook/copilot-sdk/nodejs/recipe/pr-visualization.ts Adds permission handler to session config in runnable recipe.
cookbook/copilot-sdk/nodejs/recipe/persisting-sessions.ts Adds permission handling to create/resume session calls.
cookbook/copilot-sdk/nodejs/recipe/multiple-sessions.ts Adds permission handling to multiple-session creation.
cookbook/copilot-sdk/nodejs/recipe/managing-local-files.ts Adds permission handling to session creation.
cookbook/copilot-sdk/nodejs/recipe/error-handling.ts Adds permission handling to session creation in error handling recipe.
cookbook/copilot-sdk/nodejs/recipe/accessibility-report.ts Adds permission handling to session config in accessibility recipe.
cookbook/copilot-sdk/nodejs/ralph-loop.md Updates Node.js docs snippet to include permission handling.
cookbook/copilot-sdk/nodejs/pr-visualization.md Updates Node.js docs snippet to include permission handling.
cookbook/copilot-sdk/nodejs/persisting-sessions.md Updates Node.js docs snippets to include permission handling for create/resume.
cookbook/copilot-sdk/nodejs/multiple-sessions.md Updates Node.js docs snippets to include permission handling.
cookbook/copilot-sdk/nodejs/managing-local-files.md Updates Node.js docs snippet to include permission handling.
cookbook/copilot-sdk/nodejs/error-handling.md Updates Node.js docs snippets to include permission handling.
cookbook/copilot-sdk/nodejs/accessibility-report.md Updates Node.js docs snippets to include permission handling.
cookbook/copilot-sdk/go/recipe/pr-visualization.go Adds permission handling to session config in runnable recipe.
cookbook/copilot-sdk/go/recipe/persisting-sessions.go Adds permission handling to create/resume session calls.
cookbook/copilot-sdk/go/recipe/multiple-sessions.go Adds permission handling to multiple-session creation.
cookbook/copilot-sdk/go/recipe/managing-local-files.go Adds permission handling to session creation.
cookbook/copilot-sdk/go/recipe/error-handling.go Adds permission handling to session creation in error handling recipe.
cookbook/copilot-sdk/go/recipe/accessibility-report.go Adds permission handling to session config in accessibility recipe.
cookbook/copilot-sdk/go/ralph-loop.md Updates Go docs snippet to include permission handling.
cookbook/copilot-sdk/go/pr-visualization.md Updates Go docs snippet to include permission handling.
cookbook/copilot-sdk/go/persisting-sessions.md Updates Go docs snippets to include permission handling for create/resume.
cookbook/copilot-sdk/go/multiple-sessions.md Updates Go docs snippets to include permission handling.
cookbook/copilot-sdk/go/managing-local-files.md Updates Go docs snippet to include permission handling.
cookbook/copilot-sdk/go/error-handling.md Updates Go docs snippets to include permission handling.
cookbook/copilot-sdk/go/accessibility-report.md Updates Go docs snippets to include permission handling.
cookbook/copilot-sdk/dotnet/recipe/persisting-sessions.cs Adds permission handling to resume session call in runnable recipe.
cookbook/copilot-sdk/dotnet/persisting-sessions.md Updates .NET docs snippet to include permission handling on resume.
Comments suppressed due to low confidence (1)

skills/copilot-sdk/SKILL.md:503

  • In this Python streaming/tools example, the newly added on_permission_request/model keys are indented differently than the other SessionConfig keys (streaming, tools). Align the indentation for all keys inside the dict for readability and to avoid confusing copy/paste.

…own lines

Address review comments on PR github#1107:
- Split OnPermissionRequest + Model onto separate lines in Go, C#, TypeScript
- Put closing }); on its own line consistently across all examples
- Fix indentation in SKILL.md Quick Start, CLI URL, Error Handling sections
- Fix cookbook Go multiple-sessions and error-handling formatting
- Fix ralph-loop.md TypeScript indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants