Change summary
internal/permission/permission.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Detailed changes
@@ -127,6 +127,12 @@ func (s *permissionService) Request(opts CreatePermissionRequest) bool {
return true
}
+ // Check if the tool/action combination is in the allowlist
+ commandKey := opts.ToolName + ":" + opts.Action
+ if slices.Contains(s.allowedTools, commandKey) || slices.Contains(s.allowedTools, opts.ToolName) {
+ return true
+ }
+
// tell the UI that a permission was requested
s.notificationBroker.Publish(pubsub.CreatedEvent, PermissionNotification{
ToolCallID: opts.ToolCallID,
@@ -134,12 +140,6 @@ func (s *permissionService) Request(opts CreatePermissionRequest) bool {
s.requestMu.Lock()
defer s.requestMu.Unlock()
- // Check if the tool/action combination is in the allowlist
- commandKey := opts.ToolName + ":" + opts.Action
- if slices.Contains(s.allowedTools, commandKey) || slices.Contains(s.allowedTools, opts.ToolName) {
- return true
- }
-
s.autoApproveSessionsMu.RLock()
autoApprove := s.autoApproveSessions[opts.SessionID]
s.autoApproveSessionsMu.RUnlock()