feat(warming): replace per-window survival with commitment-based warming model#280
Merged
Conversation
…, dead-session cap - Guard warmupCount reset and dead-session re-enable with !isSubagentTurn to prevent subagent turns from falsely resetting the break-even counter - Add missing /keep mode notWarmingReason cases (break-even exceeded, cooldown active) so dashboard never shows 'Unknown' for forced sessions - expectedWarmupCycles returns maxCycles+1 for dead sessions so the continuation cap check correctly blocks instead of being a no-op - Fix warming overview table: show pReturns (new model) not pReturnDampened (legacy) to match session detail view
797051d to
793ef0e
Compare
This was referenced May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cache_writecost now correctly uses 2× base price inbuildAnthropicProfile()— was using the 5m price for both tiersread/writetoread/(write-read), accounting for the cache read paid on user return (~8.7% for 5m TTL, ~4.2% for 1h TTL)/keepmode now respects break-even cap — was running indefinitely (e.g. 2 hours on a 5m TTL session)Key behavioral changes
New helpers
breakFraction()— splits histogram at 3min floor (active coding vs breaks)pSessionFinished()— log-linear signal fusion with sigmoid outputexpectedWarmupCycles()— forward-looking cost via conditional survivalcostThreshold()/maxProfitableCycles()— corrected cost modelOther changes
warmupCounton user return for fresh break-even analysis