Skip to content

fix(cost): drop crude cumulative-sum auto-compact nudge#7

Merged
dancinlife merged 1 commit into
mainfrom
fix/cost-pure-metering
May 17, 2026
Merged

fix(cost): drop crude cumulative-sum auto-compact nudge#7
dancinlife merged 1 commit into
mainfrom
fix/cost-pure-metering

Conversation

@dancinlife
Copy link
Copy Markdown
Contributor

Summary

Follow-up flagged during the token-economy port. cost_on_request_post
nudged /compact when cost_TOTAL_INPUT (cumulative input-token sum
across all turns) exceeded max_session_tokens — a running spend total
is 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_COMPACT var. The
auto-compact WHEN decision now belongs to compaction-trigger (correct
latest-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 summary are unchanged.

Test

wilson build default OK; wilson test 23/23; no remaining
cost_NOTIFIED_COMPACT refs.

🤖 Generated with Claude Code

… 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>
@dancinlife dancinlife merged commit 6dfdadf into main May 17, 2026
0 of 2 checks passed
@dancinlife dancinlife deleted the fix/cost-pure-metering branch May 17, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant