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

* Update .NET Copilot SDK recipes for explicit permission handling (fix breaking change in SDK v0.1.28)

* Update .NET Copilot SDK recipes for explicit permission handling
This commit is contained in:
Jon Galloway
2026-03-16 18:49:03 -07:00
committed by GitHub
parent 99e00272f8
commit e2c763df88
14 changed files with 78 additions and 26 deletions

View File

@@ -58,7 +58,11 @@ try
// Fresh session each iteration — context isolation is the point
var session = await client.CreateSessionAsync(
new SessionConfig { Model = "gpt-5.1-codex-mini" });
new SessionConfig
{
Model = "gpt-5.1-codex-mini",
OnPermissionRequest = PermissionHandler.ApproveAll
});
try
{
var done = new TaskCompletionSource<string>();
@@ -125,8 +129,7 @@ try
// Pin the agent to the project directory
WorkingDirectory = Environment.CurrentDirectory,
// Auto-approve tool calls for unattended operation
OnPermissionRequest = (_, _) => Task.FromResult(
new PermissionRequestResult { Kind = "approved" }),
OnPermissionRequest = PermissionHandler.ApproveAll,
});
try
{