Runaway copilot-file-search thread consumes CPU and unbounded disk while session is idle
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Version: GitHub Copilot CLI 1.0.83-3 on Ubuntu 24.04
Summary
While a copilot --yolo session reports its status as idle, an internal copilot-file-search thread can continue running indefinitely, pinning a CPU core and writing an unbounded per-process diagnostic log under ~/.copilot/logs/ until the disk fills to 100%.
Observed behavior
- The session's foreground process stays alive and its reported status is
idle, but the process is not actually idle at the OS level. - The internal
copilot-file-searchthread crawls/indexes the working directory at ~50% CPU and does not stop on its own. - The per-process diagnostic log in
~/.copilot/logs/grows continuously — observed rates around 8 MiB per 10 seconds — with no apparent size cap or rotation. Individual logs reached 6–22 GB before intervention. - On large or deeply nested directory trees, the crawler appears to get stuck (repeated traversal, symlink-loop-like behavior) rather than completing and going quiet.
Impact
- Root filesystem exhaustion (reached 100% used in the worst case), which affects the whole machine, not just the session.
- Sustained CPU consumption for an ostensibly idle session.
Reproduced
Seen multiple times in a 24h span, all with the identical signature: idle status + active copilot-file-search thread + a continuously growing diagnostic log under ~/.copilot/logs/. Killing the process is the only thing that stops it; the log then has to be deleted manually to reclaim space.
Expected behavior
- File-search/indexing should terminate (or throttle) when the session is idle.
- The crawler should detect and break traversal loops instead of looping indefinitely.
- Diagnostic logs should be size-capped or rotated so a single session cannot exhaust the disk.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先复现空闲会话的行为,并结合检查 ~/.copilot/logs/ 下的每进程文件来检查 copilot-file-search 的活动。跟踪遍历是否会重复,以及日志是否会无限增长。完成的标准是:空闲会话停止或限制索引,遍历循环终止,并且诊断日志受到限制或进行轮换。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- linux
- 领域
- cli, observability, performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100