Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#956 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
javascript
领域
authorization, cli

调研方向

使用显示的 onPermissionRequest 回调,通过 CLI v1.0.13-1 复现权限流程,测试已批准规则和已拒绝规则的响应。跟踪 CLI 从扩展响应到提示的权限时序;当批准响应抑制提示,同时拒绝和无结果时的行为保持正确时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 9 小时
30 天内合并 PR
129

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。