Skip to content

[main] feat: stop tool loops and prune long-context history - #147

Merged
Tomlord1122 merged 3 commits into
mainfrom
feat/agent-doom-loop-context-prune
Sep 15, 2026
Merged

Tomlord1122 merged 3 commits into
mainfrom
feat/agent-doom-loop-context-prune

Conversation

@Tomlord1122

Copy link
Copy Markdown
Member

Background

Long sessions could keep calling the same tool with the same arguments and repeating the same assistant text. Compaction could not cut inside the current user turn, so that loop stayed in the prompt and cache read looked full.

9f5f3a7: Tool calls now carry compacted_at so old outputs can be stubbed in the model prompt while the UI still has the full result.

7574872: Compaction can start in the middle of an oversized user turn instead of keeping every tool step. After a turn, older tool dumps beyond the protect window become [Old tool result content cleared].

b98c018: Three consecutive identical tool calls are blocked and the turn finishes without tools. The runner also prunes old tool output when the turn completes.

Signed-off-by: Tom Liu (Liu Hsiu-Chi) <0xtomlord1122@gmail.com>
Signed-off-by: Tom Liu (Liu Hsiu-Chi) <0xtomlord1122@gmail.com>
Signed-off-by: Tom Liu (Liu Hsiu-Chi) <0xtomlord1122@gmail.com>
@Tomlord1122
Tomlord1122 merged commit b15bc98 into main Sep 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant