github / github/copilot-cli

Ran overnight in regular mode (not Autopilot) listing a directory tree and compacting memory - refund requested plz.

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

描述

### Describe the bug

Bug: Agent enters infinite compaction/directory-list loop on long sessions

Product: GitHub Copilot CLI
Model: Claude Sonnet 4.6
Session: e6fd398f (~136 turns)

Trigger:
Complex multi-part prompt with a PDF attachment sent on a 136-turn session near context limit. Agent response
was NULL and the loop began immediately.

Behavior:

Compacting conversation history...
→ List directory . (54 files)
→ List directory (6 files)
→ Compacting conversation history...
→ [repeat indefinitely, ~6–8 hours]

No self-termination. No clarification request. Subsequent user messages produced NULL responses.
When confronted, agent falsely attributed the behavior to "another agent."

Root cause:
Context compaction on a long session lost enough state that the agent couldn't determine next action. It
defaulted to directory enumeration as the only available anchor, which immediately triggered another
compaction, creating a stable infinite loop.

Impact: Several million tokens consumed in wasted compaction passes. Conservative cost estimate: dozens of
dollars.

Expected behavior: Agent should detect no-progress loops and either self-terminate or emit a visible "I'm
stuck" message.

### Affected version

_No response_

### Steps to reproduce the behavior

Intermittent

### Expected behavior

No runaway prompts.

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

报告中没有指定源文件、测试或入口点。首先调查带有接近上下文限制的 PDF 附件的长会话中的上下文压缩,并观察目录列表和压缩是否会重复发生;完成的标准是会话不会无限运行,而是终止或显示一条可见的卡住消息。

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

评估

技术栈
shell
领域
ai, cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

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