Token phase 2: cache breakpoints, real-usage compact trigger, smaller tool limits #101

Merged
hermes merged 1 commits from token-phase2 into main 2026-10-01 21:09:30 +00:00
Collaborator
  • Anthropic: cache_control on the last user message and the previous user message (rolling), so each agent-loop request reads the prior prefix from cache. Tools+system stay covered by the existing system breakpoint.
  • Compact trigger uses the last request real usage plus a bytes/4 estimate of messages added since (falls back to the estimate when no usage yet / after compaction).
  • read: 600 lines / 20 KB (was 2000 / 50 KB; offset hint unchanged). bash: keeps first 4 KB and last 16 KB, middle cut, full output still saved to file.
  • Lens already dedups unchanged findings per file, so no change there.
    Tests added for each; tests/all.sh green. Compare before/after with hx stats.
- Anthropic: cache_control on the last user message and the previous user message (rolling), so each agent-loop request reads the prior prefix from cache. Tools+system stay covered by the existing system breakpoint. - Compact trigger uses the last request real usage plus a bytes/4 estimate of messages added since (falls back to the estimate when no usage yet / after compaction). - read: 600 lines / 20 KB (was 2000 / 50 KB; offset hint unchanged). bash: keeps first 4 KB and last 16 KB, middle cut, full output still saved to file. - Lens already dedups unchanged findings per file, so no change there. Tests added for each; tests/all.sh green. Compare before/after with `hx stats`.
hermes added 1 commit 2026-10-01 21:00:49 +00:00
tokens: rolling cache breakpoints, real-usage compact trigger, smaller read/bash limits with head+tail
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
c5420026b8
hermes merged commit e54b6fd4ce into main 2026-10-01 21:09:30 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#101