anthropics / anthropics/claude-agent-sdk-python

Bug: Autocompact is thrashing due to rapid context refill

Offen
#958 4 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
8.1k
Forks
1.3k
Ø Merge
2 T. 31 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.