github / github/copilot-cli

Nested agents load ALL copilot-instructions.md, not just the ones at the nested level

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

描述

### Describe the bug

This feature was added: https://github.com/github/copilot-cli/issues/1655

However, whilst nested agents are now dispalyed, they read the `copilot-instructions.md` at ALL levels.

This is not expected behavior because it should be assumed that nested folders are sub-projects / workspaces in their own right

Solutions:
- Default to only read the copilot-instructions.md at the same level in a nested hierarchy
- Add a boolean setting to turn this behavior on / off as needed, defaulted to off

### Affected version

_No response_

### Steps to reproduce the behavior

create:
- .github/copilot-instructions.md
- nested_folder/.github/agents/test-agent.md
- nested_folder/.github/copilot-instructions.md

ask the test-agent.md to link the absolute path to all of the instructions in its context window & memory and it will link both:

Image

### Expected behavior

it should be assumed that nested folders are sub-projects / workspaces in their own right. therefore it shouldn't be loading in content that's outside the view and/or control of the hierarchy

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

Start by reproducing the issue with .github/copilot-instructions.md, nested_folder/.github/agents/test-agent.md, and nested_folder/.github/copilot-instructions.md. Trace the nested-agent instruction discovery entry point and any existing tests for instruction loading; done means the nested agent uses only the instruction file at its own level by default, without loading the parent file.

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

评估

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

把新 issue 发到你的邮箱

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