You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compact mid-turn when a tool loop fills the context #184
Auto-compaction runs only between prompts, so a single long tool loop can exceed the context window before the turn ends. Compacting at a round boundary within the turn lets long agentic runs continue without user intervention.
Acceptance criteria
When usage after a tool round crosses the auto-compaction threshold, the loop compacts before the next model request and continues the same turn from the summary.
Compaction occurs after every tool result in the round has been recorded, so the transcript never contains an unresolved tool call.
The summary preserves the in-progress task, and the continuation message tells the model to resume it.
Queued prompts and cancellation behave as they do at other round boundaries.
The existing failure circuit breaker also covers mid-turn attempts.
A failed mid-turn compaction ends the turn with TurnFailed and a hint to run /compact.
The auto-compaction design doc describes the new trigger point and amends decisions 3 and 7.
Notes
Mid-turn compaction conflicts with two decisions in the auto-compaction design doc: decision 3 (boundary-only compaction) and decision 7 (no automatic continue prompt).
Decision: amend both. Compaction may also run at a round boundary inside a turn, and only that mid-turn case adds an automatic continuation message, since the model is resuming work the user already asked for. Compaction between prompts still waits for user input.
Activity
docs: track planned work in GitHub issues (#188)
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): name what started a compaction with CompactTrigger
refactor(engine): run both compactions through one pipeline and split…