[pull] main from danny-avila:main#110
Merged
Merged
Conversation
* feat: emit ON_CONTEXT_USAGE token budget snapshot per model call * fix: scale post-prune remaining tokens to calibrated units * feat: include per-tool token counts and deferred names in budget breakdown * fix: dispatch context usage at invoke time with post-format recount * test: live context usage verification for single, handoff, and subagent runs * fix: gate usage dispatch behind empty-prompt guard, catch deferred definitions * fix: refresh tool accounting on discovery, align reserve ratio, recalibrate per-tool counts * fix: account same-length tail formatting in usage snapshot, assert discovery refresh * test: live accuracy verification for tool loops, caching, and pruning * test: cross-provider live accuracy matrix (google, bedrock) * fix: coherent post-prune breakdown, trailing-batch recount, awaited dispatch, compaction budget fields * 🩹 fix: Keep Usage Breakdown Coherent with Calibrated Budget Fields - sync breakdown.instructionTokens/availableForMessages to the pruner's effective (calibrated) overhead so the aggregate agrees with the top-level budget fields even under the calibration variance threshold - re-derive breakdown.messageTokens and update messageCount after the dispatch-time recount/tail-delta adjustments so the snapshot describes the payload actually sent * 🩹 fix: Exact Legacy-Content Deltas and Reconciled Per-Tool Counts - track the exact set of messages formatContentStrings will flatten via a shared isLegacyConvertible predicate and fold their token delta into the dispatch-time adjustment, so legacy-content rewrites before the trailing batch no longer skew the snapshot (zero extra tokenization when no convertible messages exist) - apportion per-tool schema counts with the largest-remainder method so they sum exactly to the aggregate, both at initial counting and when calibration rescales them - document fallback-retry snapshot semantics on ContextUsageEvent
* 💸 feat: Report Subagent Child-Run Model Usage via Usage Sink * 🎯 fix: Per-Request Usage Events, Root-Run & Invoked-Provider Attribution * 🧮 fix: Await Async Usage Sinks & Attribute Summarizer Model
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )