Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): accumulate step tokens for compaction - #10215
Conversation
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate/Related PRs Found:
These PRs all relate to token management, compaction triggering, and overflow prevention. PR #10123 seems most closely related as it deals with custom compaction thresholds and token overflow. Recommend reviewing these to ensure PR #10215's token accumulation logic integrates properly with existing compaction mechanisms. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes token accumulation in the OpenCode session processor to properly track cumulative token usage across multi-step loops and enable correct overflow detection for compaction triggers.
Changes:
- Accumulate step-level token usage instead of overwriting per-step values in the assistant message
- Use cumulative tokens for overflow checks to properly trigger compaction in multi-step scenarios
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
740fc40 to
b5b18aeComparef1ae801 to
08fa7f7CompareClosing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
What does this PR do?
How did you verify your code works?
bun test --timeout 30000 --bail(failed: ConnectionRefused to https://models.dev/api.json)