Repository navigation
Add token-based review chunks, usage reporting, and longer timeout - #7
Merged
Merged
Conversation
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
DiffVouch now measures diff chunks in tokens and reports review token usage, making chunk limits and context consumption easier to inspect.
Existing
chunk_bytesconfigurations retain byte-based behavior. Whole files and hunks remain the splitting boundaries. Native OpenAI API and ChatGPT subscription responses supply input, cached input, output, and reasoning usage when available; terminal and JSON output distinguish estimates and unavailable data. The original review prompt is unchanged.Documentation covers configuration, usage interpretation, the decision to retain the original prompt, and the deferred chunk-size experiment.
Evidence
After: configuration migration tests cover token defaults and legacy byte limits; chunk tests preserve multilingual diffs and enforce token limits; subscription and rendering tests verify usage, missing values, and peak versus cumulative input.
go test -mod=readonly -race ./...,go vet -mod=readonly ./..., and release builds for Linux, macOS, and Windows on amd64 and arm64.Merge Danger
Door: two-way
The change can be reverted without migrating persisted data. Existing explicit byte limits continue to work.
Blast Radius: reviews
The new default can change chunk boundaries and review behavior. Unknown model tokenizers use an explicitly labeled
o200k_baseestimate. The chunk limit covers the diff only, not the full model context. Longer native reviews can consume more time and subscription allowance. External CLI and Anthropic usage remains unavailable.