Skip to content

fix(compaction): admit prompts during breaker cooldown - #556

Merged
code-yeongyu merged 1 commit into
mainfrom
fix/issue-531-compaction-cooldown-admission-task
Jul 31, 2026
Merged

fix(compaction): admit prompts during breaker cooldown#556
code-yeongyu merged 1 commit into
mainfrom
fix/issue-531-compaction-cooldown-admission-task

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • let prompt, final-payload, scheduled-continuation, and retry admission proceed when opportunistic compaction is unavailable because the circuit breaker is cooling down
  • keep genuine oversized payloads, overflow compaction, and non-breaker cancellation fail-closed
  • add deterministic regression coverage and a hermetic real-CLI outage/continuation scenario

This supersedes #532 on current main, preserving the original contributor's implementation and co-author attribution. It does not overlap #527's separate blocking-route breaker/cap enforcement in the builtin compaction extension.

RED -> GREEN

  • RED on origin/main: 531-compaction-cooldown-admission.test.ts failed with RequiredCompactionError at _enforceCompactionBeforeProvider; non-breaker control passed.
  • GREEN after fix: 2/2 issue regression tests pass.

Verification

  • Scoped compaction/session tests: 45 files, 360 tests passed.
  • npm run check: passed.
  • Senpi CLI QA: local-ignore/qa-evidence/20260731-issue-531-breaker-admission/cli-qa.log
    • 4/4 checks passed
    • post-trip compaction rejections: 0/7
    • provider requests continued: 21
    • compaction lifecycle pairs: 29 starts / 29 ends
    • real auth unchanged

Closes #531


Summary by cubic

Admit prompts during compaction breaker cooldown to prevent bricked sessions during provider outages. Non-breaker cancellations and true overflow still block as before.

  • Bug Fixes
    • Allow prompt, final-payload, scheduled continuation, and retry admission to proceed when compaction was cancelled due to circuit-breaker cooldown.
    • Preserve fail-closed behavior for oversized payloads, overflow-driven compaction, and non-breaker cancellations.
    • Add a regression test and a hermetic CLI outage scenario to validate no spinner leaks and that turns keep reaching the provider.

Written for commit 48682cb. Summary will update on new commits.

Review in cubic

Allow opportunistic compaction admission to degrade when the latest rejection is the circuit breaker, while preserving fail-closed behavior for genuine overflow and other cancellation causes.\n\nCloses #531\n\nCo-authored-by: effortprogrammer <yhjhoward7@gmail.com>
@code-yeongyu
code-yeongyu merged commit 2640786 into main Jul 31, 2026
9 checks passed
@code-yeongyu
code-yeongyu deleted the fix/issue-531-compaction-cooldown-admission-task branch July 31, 2026 02:44
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.

Breaker-tripped compaction hard-blocks prompt admission forever — session stuck in infinite compaction rejection loop

1 participant