mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-18 15:15:15 +00:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user