anthropics / anthropics/claude-agent-sdk-python

Bug: Autocompact is thrashing due to rapid context refill

未關閉
#958 4 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
8.1k
分支
1.3k
平均合併
2 天 31 分鐘
30 天內合併 PR
1

描述

### Describe the bug
I am encountering an issue where the autocompact feature is thrashing. The system throws the following error/warning:

> "Autocompact is thrashing: the context refilled to the limit within 3 turns of the previous compact, 3 times in a row. A file being read or a tool output is likely too large for the context window. Try reading in smaller chunks, or use /clear to start fresh."

This appears to happen when reading files or processing tool outputs that are relatively large, causing the context window to hit its limit almost immediately after a compact operation.

### Steps to Reproduce
1. [Explain what you were doing, e.g., "I asked the agent to read a specific large file using the file-read tool."]
2. [Explain the subsequent interactions, e.g., "The agent attempted to process the output."]
3. The "Autocompact is thrashing" error is triggered.

### Expected Behavior
The agent or SDK should ideally handle large tool outputs more gracefully, perhaps by automatically chunking the content or preventing the context limit from being overwhelmed instantly after an autocompact.

skill number:64
subagent:6
command:2
dialog 1 count error:Autocompact is thrashing: the context refilled to the limit within 3 turns of the previous compact, 3 times in a row. A file being read or a tool output is likely too large for the context window. Try reading in smaller chunks, or use /clear to start fresh.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。