feat: consolidate Hermes context optimization and tokenizer telemetry#59
Open
SecretSettler wants to merge 16 commits into
Open
feat: consolidate Hermes context optimization and tokenizer telemetry#59SecretSettler wants to merge 16 commits into
SecretSettler wants to merge 16 commits into
Conversation
added 16 commits
June 12, 2026 23:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR consolidates the complete stacked work from #52 through #58 into one reviewable branch targeting
main, then adds the tokenizer-only telemetry/reporting corrections currently validated in the Hermes runtime.Consolidated stack
Token accounting correction
chars / 4token-savings accountingactual_token_status=availableactual_tokens_before,actual_tokens_after, andactual_tokens_savedfrom the configured tokenizertiktoken:cl100k_basewhen available; otherwise reportsunavailableScope
This PR supersedes the code stacks in #52, #53, #54, #55, #56, #57, and #58. Those PRs should remain open until this consolidated PR passes GitHub CI and review.
Intentionally excluded:
feature/msc-cache-optimization), which is independent and currently conflictedspeculative_patches/Verification
Local verification on the consolidated worktree:
python3 -m pytest tests/ -v --tb=short -m "not slow and not gpu and not integration"python3 -m compileall -q __init__.py contextpilot scripts testsgit diff --checkorigin/mainestimated_chars_div_4/chars_saved // 4accountingReview notes
tiktoken:cl100k_baseis explicitly recorded as the tokenizer backend. These are tokenizer-measured counts, not provider API usage counts for every possible model family.pytest-asyncio/pytest-timeoutconfig plugins.continue-on-error; this PR does not perform an unrelated whole-repository reformat.