fix: align backend approval tool keys

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-17 14:05:00 +02:00
co-authored by Copilot
parent fa355197cb
commit fce0430091
6 changed files with 325 additions and 66 deletions
@@ -154,11 +154,15 @@ public sealed class CopilotSessionHooksTests
[Theory]
[InlineData("view", "read")]
[InlineData("grep", "read")]
[InlineData("rg", "read")]
[InlineData("edit", "write")]
[InlineData("apply_patch", "write")]
[InlineData("powershell", "shell")]
public async Task Create_PreToolUseAutoAllowsWhenCategoryIsApproved(string toolName, string category)
[InlineData("web_search", "web_fetch")]
[InlineData("store_memory", "store_memory")]
public async Task Create_PreToolUseAutoAllowsWhenApprovalToolKeyIsApproved(string toolName, string approvalToolKey)
{
RunTurnCommandDto command = CreateCommandWithAutoApprovedCategory(category);
RunTurnCommandDto command = CreateCommandWithAutoApprovedCategory(approvalToolKey);
SessionHooks hooks = CopilotSessionHooks.Create(command, command.Workflow.GetAgentNodes()[0], ResolvedHookSet.Empty, new RecordingHookCommandRunner());
PreToolUseHookOutput? decision = await hooks.OnPreToolUse!(