Skip to content

fix: use SDK approval kind for tool permissions#268

Merged
spboyer merged 2 commits into
microsoft:mainfrom
drvoss:squad/266-fix-permission-approval-kind
May 23, 2026
Merged

fix: use SDK approval kind for tool permissions#268
spboyer merged 2 commits into
microsoft:mainfrom
drvoss:squad/266-fix-permission-approval-kind

Conversation

@drvoss

@drvoss drvoss commented May 22, 2026

Copy link
Copy Markdown
Contributor

Closes #266

Summary

  • switch the default permission callback to the SDK's built-in ApproveAll handler
  • add a regression test that verifies the approval kind matches the SDK constant

What Changed

  • replaced the legacy literal "approved" response in internal/execution/copilot.go
  • added a focused regression test in internal/execution/copilot_test.go

Testing

  • Unable to run go test ./... in this environment because go is not available on PATH.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@drvoss drvoss requested a review from spboyer as a code owner May 22, 2026 04:33
Copilot AI review requested due to automatic review settings May 22, 2026 04:33
@github-actions github-actions Bot enabled auto-merge (squash) May 22, 2026 04:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the “allow all tools” permission handler to use the Copilot SDK’s approved implementation and adds a regression test to ensure the returned permission result kind matches the SDK constant.

Changes:

  • Replace the local allowAllTools implementation with the SDK’s ApproveAll handler.
  • Add a unit test asserting allowAllTools returns PermissionRequestResultKindApproved.

Reviewed changes

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

File Description
internal/execution/copilot.go Switches allowAllTools to use the SDK-provided approval handler.
internal/execution/copilot_test.go Adds a test validating the approval kind returned by allowAllTools.

Comment thread internal/execution/copilot.go Outdated
Comment thread internal/execution/copilot.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
auto-merge was automatically disabled May 22, 2026 09:08

Head branch was pushed to by a user without write access

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clean — no issues found. LGTM.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0f5f245). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #268   +/-   ##
=======================================
  Coverage        ?   75.78%           
=======================================
  Files           ?      154           
  Lines           ?    17907           
  Branches        ?        0           
=======================================
  Hits            ?    13570           
  Misses          ?     3379           
  Partials        ?      958           
Flag Coverage Δ
go-implementation 75.78% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See feedbacj

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clean — no issues found. LGTM.

@spboyer spboyer merged commit a9b6055 into microsoft:main May 23, 2026
7 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.

After 0.33.0 tool calls are getting rejected with "unexpected user permission response"

4 participants