Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

The copilot CLI flashes the permission prompt UI, even though extension has approved.

Đang mở
#956 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
authorization, cli

Hướng nghiên cứu

Tái hiện luồng quyền với callback onPermissionRequest được hiển thị bằng CLI v1.0.13-1, kiểm thử cả phản hồi cho quy tắc được chấp thuận và bị từ chối. Theo dõi trình tự quyền của CLI từ phản hồi của extension đến prompt; hoàn tất khi phản hồi chấp thuận ngăn prompt hiển thị, còn hành vi khi bị từ chối và không có kết quả vẫn đúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I'm working on an extension that would auto approve based on some rules.

// Deferred fire-and-forget logger — session isn't available until joinSession resolves
let _session = null;
const log = (msg) => { if (_session) _session.log(msg).catch(() => {}); };
...

onPermissionRequest: (request) => {
        const toolName = request.toolName ?? "";
        const toolArgs = {};
        if (request.fullCommandText) toolArgs.command = request.fullCommandText;
        if (request.fileName) toolArgs.path = request.fileName;

        // 1. deny rules first
        for (const rule of parsedDeny) {
            if (matchRule(rule, toolName, toolArgs)) {
                log(`DENY (permission) tool=${toolName} kind=${request.kind} rule="${rule.raw}"`);
                return { kind: "denied-by-rules", rules: [rule.raw] };
            }
        }

        // 2. allow rules — auto-approve
        for (const rule of parsedAllow) {
            if (matchRule(rule, toolName, toolArgs)) {
                log(`APPROVE (permission) tool=${toolName} kind=${request.kind} rule="${rule.raw}"`);
                return { kind: "approved" };
            }
        }

        // 3. no match — let CLI handle (prompt user)
        log(`NO MATCH (permission) tool=${toolName} kind=${request.kind}`);
        return { kind: "no-result" };
    },

In the cli i see the UI prompt none the less, if i do nothing, i see the tool call get approved and complete in the background.
If i'm fast enough or am on autopilot with limited permissions then the ui prompt rejects the tool call and fails it.

I do not think the CLI is correctly sequencing and waiting on extensions for permissions flow.

CLI Version : v1.0.13-1

Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
130

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/copilot-sdk

Tất cả issue của github/copilot-sdk

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.