fix: skip timeout compaction when run was aborted by user#81088
fix: skip timeout compaction when run was aborted by user#81088lykeion-dev wants to merge 2263 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection: current main can enter timeout compaction on a timed-out user abort because the compaction gate ignores Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Rebase onto current main, drop unrelated history, guard only timeout-triggered compaction with Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main can enter timeout compaction on a timed-out user abort because the compaction gate ignores Is this the best way to solve the issue? No. Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 99a6b1c5a886. Re-review progress:
|
* fix: install codex for openai onboarding * docs: require crabbox e2e bug proof
Dependency Changes DetectedThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Summary
Rebased version of #80746 on the 2026.5.9 release branch (original was based on 5.7).
Problem
When the user presses the Stop button in the Control UI, the run is aborted. Previously, if context token usage exceeded 65%, the timeout compaction mechanism would still fire — causing unnecessary compaction at an inappropriate time.
Fix
Add
!externalAbortguard to the timeout compaction condition insrc/agents/pi-embedded-runner/run.ts.Why
externalAbortinstead ofaborted:abortedis set totruefor BOTH user-initiated stops AND internal LLM timeouts (viaabortRun(true))!abortedwould incorrectly skip compaction for genuine provider timeouts that need recoveryexternalAbortis ONLY set when the user presses Stop (via theonAborthandler onparams.abortSignal)Changes
src/agents/pi-embedded-runner/run.ts: Add!externalAbortto both timeout compaction conditionssrc/agents/pi-embedded-runner/run.timeout-triggered-compaction.test.ts: Update existing test to explicitly setexternalAbort: false, add new test for user abort caseCHANGELOG.md: Added to Unreleased section