Skip to content

Update .NET Copilot SDK recipes for explicit permission (fix for SDK v0.1.28)#1033

Merged
aaronpowell merged 2 commits into
github:stagedfrom
jongalloway:update-copilot-recipes-permissions
Mar 17, 2026
Merged

Update .NET Copilot SDK recipes for explicit permission (fix for SDK v0.1.28)#1033
aaronpowell merged 2 commits into
github:stagedfrom
jongalloway:update-copilot-recipes-permissions

Conversation

@jongalloway
Copy link
Copy Markdown
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

This PR updates the existing .NET Copilot SDK cookbook recipes and their corresponding markdown examples to match the SDK's opt-in permission model introduced in v0.1.28.

The changes add explicit OnPermissionRequest handlers to the affected .NET recipe examples and update the documentation snippets to match. It also updates the managing-local-files recipe so it can optionally take a target directory argument and otherwise default to the current directory, which makes it easier to demo safely.

I verified the changes by running the repo build and testing the managing-local-files example against this repository in a dry-run style scenario. The example correctly recognized that the repository should not be reorganized.


Type of Contribution

  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify): Update to existing cookbook recipe files and documentation.

Additional Notes

  • This PR updates existing cookbook content only; it does not add new instructions, prompts, agents, skills, plugins, or workflows.
  • I ran npm run build, bash scripts/fix-line-endings.sh, and git diff --check.
  • markdownlint still reports existing long-line issues in the touched markdown files. Some new long-line warnings are introduced by the added permission-handling snippets, but they were left as-is to keep the cookbook examples simple and readable.

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 review requested due to automatic review settings March 16, 2026 18:05
Copy link
Copy Markdown
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 the .NET Copilot SDK cookbook recipes and their accompanying markdown docs to align with the SDK’s opt-in permission model introduced in v0.1.28, and improves the local-files recipe to be easier/safer to demo by allowing an optional target directory argument.

Changes:

  • Added explicit OnPermissionRequest handlers to multiple .NET recipe sessions and mirrored those updates in the markdown examples.
  • Updated the “managing local files” recipe (and docs) to accept an optional CLI folder argument, defaulting to the current directory.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cookbook/copilot-sdk/dotnet/recipe/ralph-loop.cs Uses explicit permission handler via PermissionHandler.ApproveAll.
cookbook/copilot-sdk/dotnet/recipe/pr-visualization.cs Adds explicit permission handling to the session config.
cookbook/copilot-sdk/dotnet/recipe/persisting-sessions.cs Adds explicit permission handling to the session config.
cookbook/copilot-sdk/dotnet/recipe/multiple-sessions.cs Adds explicit permission handling to each session config.
cookbook/copilot-sdk/dotnet/recipe/managing-local-files.cs Adds permission handling and allows optional folder arg (defaults to CWD).
cookbook/copilot-sdk/dotnet/recipe/error-handling.cs Adds explicit permission handling to the session config.
cookbook/copilot-sdk/dotnet/recipe/accessibility-report.cs Adds explicit permission handling to the session config.
cookbook/copilot-sdk/dotnet/ralph-loop.md Updates snippet(s) to include explicit permission handling.
cookbook/copilot-sdk/dotnet/pr-visualization.md Updates snippet to include explicit permission handling.
cookbook/copilot-sdk/dotnet/persisting-sessions.md Updates snippet to include explicit permission handling.
cookbook/copilot-sdk/dotnet/multiple-sessions.md Updates snippets to include explicit permission handling (plus a heading typo).
cookbook/copilot-sdk/dotnet/managing-local-files.md Documents optional folder argument + permission handling.
cookbook/copilot-sdk/dotnet/error-handling.md Updates snippets + adds note about v0.1.28 opt-in permissions.
cookbook/copilot-sdk/dotnet/accessibility-report.md Updates snippets to include explicit permission handling.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread cookbook/copilot-sdk/dotnet/multiple-sessions.md
@codemillmatt
Copy link
Copy Markdown
Contributor

@jongalloway - can you retarget this to the staged branch?

@aaronpowell
Copy link
Copy Markdown
Contributor

It looks like you've incorrectly branched from the main branch not staged, and as a result all the materialised plugins are included in this PR.

You can attempt to fix this with a rebase:

git fetch origin staged
git rebase --onto origin/staged origin/main <branch name>
git push --force-with-lease

If that does not resolve it, you can run npm run plugin:clean which will delete the materialised plugins and you can commit that change.

@jongalloway jongalloway force-pushed the update-copilot-recipes-permissions branch from 148fb60 to b70ade3 Compare March 17, 2026 01:08
@jongalloway jongalloway changed the base branch from main to staged March 17, 2026 01:08
@aaronpowell aaronpowell merged commit e2c763d into github:staged Mar 17, 2026
5 checks passed
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.

4 participants