fix(opencode): accumulate step tokens for compaction#10215
fix(opencode): accumulate step tokens for compaction#10215Skyline-23 wants to merge 1 commit intoanomalyco:devfrom
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
b5b18ae
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Closing 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)