fix(core): guard non-reducing compaction - #34261
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found a potentially related PR: Related PR:
The other PRs found (#33667, #18941) are related to overflow and compaction in general but appear to address different aspects of the issue. |
|
#34029 and this PR cover different failure modes. #34029 handles aborts/errors while generating the overflow recovery summary. This PR handles the case where recovery summary generation succeeds, but the rebuilt request is still over budget or is not smaller than the original request. In that case we persist the original overflow error instead of retrying into another overflow cycle. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #27924
Type of change
What does this PR do?
Stops overflow recovery when compaction does not make progress.
After the recovery summary is added, the runner re-estimates the request. It only retries the provider if the compacted request is smaller than the original request and within the model context budget. Otherwise it persists the original overflow error and exits instead of retrying into another overflow cycle.
How did you verify your code works?
From
packages/core:bun test test/session-runner.test.ts --test-name-pattern "overflow"bun typecheckScreenshots / recordings
Not a UI change.
Checklist