Skip to content

Conversation

@karpetrosyan
Copy link
Collaborator

No description provided.

@RobertCraigie
Copy link
Collaborator

There's a merge conflict FYI

consecutive_compactions += 1
log.debug(f"Consecutive compactions: {consecutive_compactions}")
if consecutive_compactions >= 2:
raise RuntimeError("Infinite compaction detected: two consecutive iterations performed compaction")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we should include something actionable in the error message, what could the user do to prevent this?

Also minor but

Suggested change
raise RuntimeError("Infinite compaction detected: two consecutive iterations performed compaction")
raise RuntimeError("Potentially infinite compaction detected: two consecutive iterations performed compaction")

Copy link
Collaborator Author

@karpetrosyan karpetrosyan Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens mostly because the threshold number is very small. If you set it too low, some extra tokens, for example tool definitions won’t be affected by compaction and won’t fit within that threshold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants