The copilot CLI flashes the permission prompt UI, even though extension has approved.
还没有人认领这个 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
github/copilot-sdk#2709 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 78/100
github/copilot-sdk#2673 ·
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
HL7/fhir-ig-publisher#1375 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
johanhaleby/occurrent#1134 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
objectionary/jeo-maven-plugin#1811 ·
-
难度 2/5 1-3 小时 新手友好度 88/100