GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — fix(opencode): break auto-compact loop when compaction makes no progress by ZehuaWang · Pull Request #29150 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs addressing auto-compaction and context overflow issues: Potentially Related PRs:
Why they might be related: These PRs all address aspects of the auto-compaction loop, token overflow detection, and preventing infinite compaction cycles. PR #27919 appears most similar as it also fixes an "infinite compaction loop." You should verify whether #27919 was already attempted, what its status is, and how this PR (#29150) differs in its approach (using a stall detector vs. other mechanisms). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Review found the boundary check used >= instead of >, so a reduction that hit exactly the threshold (e.g. 200K → 190K) was flagged as stalled and threw ContextOverflowError, contradicting the PR description that requires "at least 5% reduction" to escape stall. The boundary test name said "returns false right at the 5% boundary" but the assertion said true — which made the inconsistency obvious. Change the comparison to strict `>`. Now exactly-(1-threshold) reduction counts as progress; only reductions strictly less than the threshold trip the guard. Update the boundary test name, comment, and assertions to match. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Switching the percentage check from >= to > closed the boundary false-positive (200K -> 190K now counts as progress) but opened a zero-token hole: when the provider directly throws ContextOverflowError, SessionProcessor.halt sets needsCompaction without running step-finish, so handle.message.tokens stays at the zero-initialized values. The percentage check then evaluates 0 > 0 * 0.95 = false on every fire and the loop keeps recreating compactions. Add a one-line guard so two consecutive zero-token compactions trip the stall detector. Unit test added alongside the boundary cases. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
I was looking into this after #30749 landed. That PR covers the I tried applying this locally against current Is this PR still intended to move forward? If it mainly needs a rebase, I'd be happy to help with that or prepare a small follow-up if maintainers prefer. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # packages/opencode/src/session/prompt.ts
|
Thanks @danielxxomg, really appreciate you digging into this 🙏 Yes — still intended to move forward. You've got it exactly right: #30749 only covered the I've just merged latest
All resolved against current Happy to squash/rebase instead of the merge commit if maintainers prefer — just say the word. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Auto-compact infinite loop with claude-opus-4.7-1m (GitHub Copilot) due to wrong context window
There was an error while loading. Please reload this page.