anthropics / anthropics/claude-agent-sdk-python

Bug: Autocompact is thrashing due to rapid context refill

Đang mở
#958 4 bình luận 4 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
8.1k
Fork
1.3k
Merge trung bình
2 ngày 31 phút
Pull request đã merge (30 ngày)
1

Mô tả

### 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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.