github / github/copilot-cli

Agent Skills `allowed-tools` frontmatter specs not respected in non-interactive mode

未关闭
#3,699 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:non-interactive area:permissions area:plugins
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

**GIVEN** any generic skill like:
```markdown
---
name: greet-user
description: use when a user offers a greeting
allowed-tools:
- bash
- shell
- powershell
- any-other-tool
---

Run the `./scripts/greet.sh`

```

**WHEN** I prompt with "hello" in interactive mode in Copilot
**THEN** It works as expected and the script runs, but
**WHEN** I prompt with "hello" in NON-interactive mode (e.g. `copilot -p "hello"`)
**THEN** I get a ton of `Permission denied and could not request permission from user`
**AND** A ton of wasted tokens, time, and money

### Affected version

1.0.60

### Steps to reproduce the behavior

All in the above description.

### Expected behavior

If a tool is marked as allowed, **IT SHOULD BE ALLOWED.**

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

使用所示的 allowed-tools frontmatter 和非交互式 `copilot -p "hello"` 入口点,通过通用 skill 重现该行为,并将其与交互模式进行比较。当 `bash`、`shell` 或 `powershell` 等允许的工具在非交互模式下运行时不会出现 permission-denied 错误或反复重试,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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