feat(discover): skip tiny real outputs in missed-savings estimate#2676
Open
wilmerdooley wants to merge 1 commit into
Open
feat(discover): skip tiny real outputs in missed-savings estimate#2676wilmerdooley wants to merge 1 commit into
wilmerdooley wants to merge 1 commit into
Conversation
09ccbd0 to
af0fe52
Compare
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.
Resolves #2130.
Summary
rtk discoverflags commands RTK handles but cannot profitably compress as missed savings, even when the real output was tiny. For example, a session with many smallgit pushoutputs was reported as thousands of saveable tokens.output_len),discovernow skips a supported command whose output is belowMIN_DISCOVER_FALLBACK_OUTPUT_TOKENS(100 tokens), so genuinely small outputs no longer inflate the estimate.This narrows the false positives the issue describes. It does not yet add the persisted fallback-size logging or the
--accuratemode the issue also proposes, and the estimate still uses category averages when real output size is unavailable. Happy to follow up on those if you would like them in this PR or a separate one.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets: clean.cargo test discover::: 428 passed, 0 failed.git pushreported it as saveable before the change and omits it after.