mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
fix(coding-agent): show unknown context usage after compaction, fix multi-compaction boundary
After compaction, context token count is unknown until the next LLM response. Instead of showing stale pre-compaction values or heuristic estimates, the footer now shows ?/200k. ContextUsage.tokens and ContextUsage.percent are now number | null (breaking change). Removed usageTokens, trailingTokens, lastUsageIndex from ContextUsage (internal details). Also fixed _checkCompaction() using .find() (first compaction) instead of getLatestCompactionEntry() (latest), which caused incorrect overflow detection with multiple compactions. Closes #1382
This commit is contained in:
parent
1e88c5e463
commit
7eb969ddb1
5 changed files with 56 additions and 29 deletions
|
|
@ -2,6 +2,15 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- `ContextUsage.tokens` and `ContextUsage.percent` are now `number | null`. After compaction, context token count is unknown until the next LLM response, so these fields return `null`. Extensions that read `ContextUsage` must handle the `null` case. Removed `usageTokens`, `trailingTokens`, and `lastUsageIndex` fields from `ContextUsage` (implementation details that should not have been public) ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed context usage percentage in footer showing stale pre-compaction values. After compaction the footer now shows `?/200k` until the next LLM response provides accurate usage ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
|
||||
- Fixed `_checkCompaction()` using the first compaction entry instead of the latest, which could cause incorrect overflow detection with multiple compactions ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
|
||||
|
||||
## [0.52.9] - 2026-02-08
|
||||
|
||||
### New Features
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue