Skip to content

Reset the context meter on clear and after compaction - #550

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6933-reset-context-meter-on-new-clear-and-after-compaction
Aug 23, 2026
Merged

Reset the context meter on clear and after compaction#550
TheGreatAxios merged 3 commits into
mainfrom
cl-6933-reset-context-meter-on-new-clear-and-after-compaction

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Hide the prompt Ctx meter after /new and /clear so it no longer shows prior session occupancy
  • After a successful fold (including idle empty continuation), paint the shrunk governor estimate until real usage arrives
  • Refresh cost chrome on inference.start and on the meter-only settle path so operators see the update without a following user turn

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • Manually: /clear after a long session hides Ctx; after a real compact, meter drops and/or flash path from sibling PR is independent

Fixes CL-6933

The prompt Ctx meter kept showing prior occupancy after /new and /clear,
and stayed inflated after a successful fold until the next inference.done.
Clear the painted meter immediately on session clear, hide it when the
session has no turns, and treat the post-compact governor estimate as
authoritative until real usage arrives.
Idle compaction with an empty continuation never marked the governor
estimate authoritative, so the prompt meter kept pre-fold occupancy
until the next user turn. Resume with a meter-only settle so the
shrunk estimate paints without starting another inference.
@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

CL-6933

…-meter-on-new-clear-and-after-compaction

# Conflicts:
#	src/agent/compaction.test.ts
#	src/agent/compaction.ts
@TheGreatAxios
TheGreatAxios merged commit 09ad92a into main Aug 23, 2026
5 checks passed
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