github alexgreensh/token-optimizer v5.6.6

5 hours ago

Fix: Quality score monotonicity bug

The composite quality score could climb during sessions without compaction. Three ratio-based signals (stale_reads, bloated_results, decision_density = 48% combined weight) were computed over full session history, so denominators grew and scores improved even as context degraded.

Rolling window scoring: Ratio-based signals now use a sliding window of the last 20 operations instead of full session history. Context fill, compaction depth, and duplicates remain cumulative (correct by nature). Configurable via TOKEN_OPTIMIZER_QUALITY_WINDOW env var.

Independent fill warnings: New fill-percentage warnings at 75% (WARNING) and 85% (CRITICAL) fire in the statusline and as system messages regardless of composite score value. These cannot be masked by improving ratio signals.

No changes needed for Codex or OpenClaw -- Codex uses the same compute_quality_score function (fix applies automatically), and OpenClaw scoring uses only point-in-time signals (no denominator expansion possible).

Don't miss a new token-optimizer release

NewReleases is sending notifications on new releases.