fix(core): honor compaction.auto on provider overflow#17779
fix(core): honor compaction.auto on provider overflow#17779clzoc wants to merge 1 commit intoanomalyco:devfrom
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #17766 - fix(provider): treat Anthropic billing_error as context overflow for auto-compaction This PR is related because it also deals with context overflow and auto-compaction behavior in providers, though it focuses on a different error type (Anthropic billing_error). Since PR #17779 (the current PR) addresses how No duplicate PRs addressing the exact same issue were found. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Fixes #16882
When provider-triggered context overflow reaches the reactive processor path,
compaction.auto: falsewas being ignored and the session still tried to compact. This change makes the processor stop cleanly with a persisted overflow error when auto-compaction is disabled, while preserving the existing compaction path when it is enabled.Verification:
cd /Users/tsunami/Downloads/opencode/packages/opencode && bun test test/session/compaction.test.tscd /Users/tsunami/Downloads/opencode/packages/opencode && bun test test/session/message-v2.test.ts -t "detects context overflow from APICallError provider messages"cd /Users/tsunami/Downloads/opencode/packages/opencode && bun test test/session/retry.test.ts -t "does not retry context overflow errors"cd /Users/tsunami/Downloads/opencode/packages/opencode && bun typecheck