Token counting, the compaction trigger and the masking schedule lived in
Agent's private fields plus mask.rs, compact.rs, stats.rs and the TUI.
Move them behind one module with view/record/reset/tokens, so the
reset-together invariant and the mask-boundary rule have one owner.
Agent holds a ContextWindow instead of compact_at/ctx/mask_boundary
TUI shows Agent::context_tokens() (real reading + estimate), matching
the compaction trigger instead of the bytes/4 guess
stats replay goes through ContextWindow::masked
ContextMeter/estimate_tokens move into the module; mask is crate-private
tests at the ContextWindow interface replace the meter unit test
Token counting, the compaction trigger and the masking schedule lived in
Agent's private fields plus mask.rs, compact.rs, stats.rs and the TUI.
Move them behind one module with view/record/reset/tokens, so the
reset-together invariant and the mask-boundary rule have one owner.
- Agent holds a ContextWindow instead of compact_at/ctx/mask_boundary
- TUI shows Agent::context_tokens() (real reading + estimate), matching
the compaction trigger instead of the bytes/4 guess
- stats replay goes through ContextWindow::masked
- ContextMeter/estimate_tokens move into the module; mask is crate-private
- tests at the ContextWindow interface replace the meter unit test
johannes
added 1 commit 2026-10-02 14:37:17 +00:00
Token counting, the compaction trigger and the masking schedule lived in
Agent's private fields plus mask.rs, compact.rs, stats.rs and the TUI.
Move them behind one module with view/record/reset/tokens, so the
reset-together invariant and the mask-boundary rule have one owner.
- Agent holds a ContextWindow instead of compact_at/ctx/mask_boundary
- TUI shows Agent::context_tokens() (real reading + estimate), matching
the compaction trigger instead of the bytes/4 guess
- stats replay goes through ContextWindow::masked
- ContextMeter/estimate_tokens move into the module; mask is crate-private
- tests at the ContextWindow interface replace the meter unit test
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Token counting, the compaction trigger and the masking schedule lived in
Agent's private fields plus mask.rs, compact.rs, stats.rs and the TUI.
Move them behind one module with view/record/reset/tokens, so the
reset-together invariant and the mask-boundary rule have one owner.
the compaction trigger instead of the bytes/4 guess