Skip to content

fix: remove fatal per-turn compaction cap - #728

Closed
realsigridjin wants to merge 1 commit into
code-yeongyu:mainfrom
realsigridjin:fix/compaction-hard-cap
Closed

fix: remove fatal per-turn compaction cap#728
realsigridjin wants to merge 1 commit into
code-yeongyu:mainfrom
realsigridjin:fix/compaction-hard-cap

Conversation

@realsigridjin

@realsigridjin realsigridjin commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Allow required compaction beyond the former per-turn soft cap.
  • Retain the absolute hard cap of 10 and report it accurately.
  • Cover accepted, ineffective, route-guard, and degradation-recovery paths.

Validation

  • npm --prefix packages/coding-agent test -- test/compaction (52 files, 392 tests)
  • npm run build

Summary by cubic

Removed the per-turn compaction cap so required compactions can continue within a turn. Compaction now only stops at the absolute session cap (10), preventing premature turn termination.

  • Bug Fixes
    • Enforce only the absolute cap of 10 via shouldRejectByCap; removed soft-cap checks.
    • Updated logs and rejection text to “absolute compaction cap” and count acceptedAbsolute.
    • Fixed route guards to admit compaction across turn boundaries and after degradation recovery until the hard cap.
    • Updated tests for absolute-cap behavior (accepted, ineffective, route-guard, and recovery paths).

Written for commit bb08d0e. Summary will update on new commits.

Review in cubic

@code-yeongyu

Copy link
Copy Markdown
Owner

Thanks @realsigridjin (Sigrid) — the intent here was right: the per-turn soft cap made required compactions fatal mid-turn, and removing it in favor of the absolute session cap is exactly what landed.

This PR could not pass the Changelog gate (runtime source changed without a CHANGELOG.md entry) and also missed the fork's changes.md/AGENTS.md/QA-evidence gates, so we reworked the same policy change end to end in #731:

  • per-turn soft cap removed; admission bounded only by the absolute session cap (10) + circuit breaker
  • rejection message corrected to "absolute compaction cap reached for this session" (cause id kept for extension-API stability)
  • CHANGELOG.md [Unreleased] entry, fork-tracker changes.md entries, AGENTS.md/fixture doc sync
  • committed senpi-qa RPC scenario (compaction-absolute-cap-qa.mjs): 10 accepted compactions in one session, non-fatal absolute-cap rejection, baseline on old code showing the misleading per-turn wording

#731 is merged with full CI green, so closing this one in its favor. Credit for the diagnosis and direction stays with this PR.

stevenahhh pushed a commit to stevenahhh/senpi that referenced this pull request Aug 5, 2026
The per-turn soft cap (3 accepted + ineffective compactions) rejected required compactions mid-turn, fatally ending turns that legitimately needed more than three compactions. Admission is now bounded only by the absolute session cap (10) and the failure circuit breaker. The rejection cause keeps the historical per-turn-cap identifier for extension-API stability but reports the absolute session cap. Adds an RPC senpi-qa scenario driving 10 accepted compactions plus a non-fatal absolute-cap rejection against the real CLI.

Supersedes code-yeongyu#728 by @realsigridjin; closes code-yeongyu#728.
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.

2 participants