fix(cost): drop crude cumulative-sum auto-compact nudge#7
Merged
Conversation
… metering, not policy cost_on_request_post compared cost_TOTAL_INPUT (the CUMULATIVE input-token sum across all turns) against max_session_tokens and fired a one-shot "/compact suggested" notification. A running spend total is not a context-window-occupancy proxy — it crosses the threshold from sheer turn count regardless of actual context pressure, so the nudge was misleading. The auto-compact WHEN decision now belongs to the compaction-trigger plugin (measures the latest turn's occupancy correctly + emits compact_armed). Removed the block and the now-dead sticky cost_NOTIFIED_COMPACT module var; cost stays pure metering (the observe/policy split the standalone compaction-trigger placement chose). Default-bundle behavior change: the misleading one-shot nudge is gone; the correct signal is compaction-trigger (opt-in). Removing a wrong signal is not a regression. /cost display, USD accounting, and the `summary` action are unchanged. Verified: wilson build (default) OK; wilson test 23/23; no remaining cost_NOTIFIED_COMPACT references. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Follow-up flagged during the token-economy port.
cost_on_request_postnudged
/compactwhencost_TOTAL_INPUT(cumulative input-token sumacross all turns) exceeded
max_session_tokens— a running spend totalis not a context-occupancy proxy, so it crossed the line from turn count
alone and fired a misleading one-shot notification.
Removed the block + the now-dead
cost_NOTIFIED_COMPACTvar. Theauto-compact WHEN decision now belongs to
compaction-trigger(correctlatest-turn occupancy metric). cost stays pure metering — the
observe/policy split chosen when compaction-trigger landed standalone.
Default-bundle behavior change: the wrong one-shot nudge is gone; the
correct signal is compaction-trigger (opt-in).
/cost, USD accounting,and
summaryare unchanged.Test
wilson builddefault OK;wilson test23/23; no remainingcost_NOTIFIED_COMPACTrefs.🤖 Generated with Claude Code