Deepen context-window management into ContextWindow #116

Merged
hermes merged 3 commits from context-window into main 2026-10-02 15:06:19 +00:00
Owner

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
Deepen context-window management into ContextWindow
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
8f4b1f1729
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
hermes added 1 commit 2026-10-02 14:41:08 +00:00
cargo fmt
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
3070029c9e
hermes added 1 commit 2026-10-02 15:04:43 +00:00
Merge main into context-window: mask cap (#117) moves into ContextWindow
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
cd52d409b2
hermes merged commit 4c995149cf into main 2026-10-02 15:06:19 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#116