Repository navigation
Conversation
This branch has not been deployed
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.
Description
Expose whether the LLM token subtotal covers every successful VLM response in an operation.
OpenAI and LiteLLM currently skip token aggregation when a successful response has no usage object. This makes missing usage look like an explicitly reported zero. If an earlier response reported usage, a later response without usage leaves a valid but partial subtotal that looks complete.
This change adds an optional
summary.tokens.llm.coverageobject. It reportscomplete,partial, ormissingwith successful, reported, and missing response counts. Numeric token totals keep their existing meaning.Human Involvement
Related Issue
The same machine-readable accounting ambiguity is described in openai/codex#54055. This PR implements a focused OpenViking contract. It does not copy external code or claim provider billing finality.
Type of Change
Changes Made
summary.tokens.llm.coveragewithout changing numeric totals.Example:
{ "tokens": { "llm": { "input": 100, "output": 10, "total": 110, "coverage": { "status": "partial", "successful_response_count": 2, "reported_response_count": 1, "missing_report_count": 1 } } } }Testing
Commands run:
The focused run passed 35 tests. Two byte-identical fixed-state probe runs passed 41 source and behavior checks. Missing versus explicit zero and partial versus complete improved from 0/2 distinguishable provider families on the base to 3/3 instrumented provider paths.
A broader regression run passed 162 tests and failed 17. The same 17 exact cases fail on the unchanged base. They are existing Ollama
num_ctxexpectation mismatches and one existing OpenAI response usage-shape mismatch.Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
The scope is observed successful VLM response coverage for one operation. It does not cover failed attempts, retries, replay identity, delegated threads, cumulative session usage, or provider billing finality. There are no dependencies, configuration changes, stored-data changes, or migrations.