fix(ensure): stop re-asking cheaper /compact models when already set - #213
Merged
Conversation
fkiene
enabled auto-merge (squash)
July 23, 2026 10:32
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
compact_models_configured() used str::parse::<toml::Value>(), which in toml 1.x only accepts a single value. Real config.toml files failed that parse, the error was swallowed, and ensure/doctor always re-prompted for cheaper /compact models even when [compact].models was already set. Parse with toml::from_str like the rest of the config loaders. Signed-off-by: François Kiene <46886660+fkiene@users.noreply.github.com>
fkiene
force-pushed
the
fix/ensure-compact-reprompt
branch
from
July 23, 2026 10:38
ab7fb5d to
81749c2
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.
Summary
compact_models_configured()always returnedfalseon a realconfig.tomlbecause it usedstr::parse::<toml::Value>(). In toml 1.x that is a single-value parser; multi-key documents fail with "unexpected content, expected nothing", and.ok()swallowed the error.llmtrim ensure/doctortherefore always thought[compact].modelswas missing and re-promptedUse cheaper models for Claude Code /compact (Haiku → Sonnet)?even when it was already configured.compact statusand the proxy were fine — they already usedtoml::from_str.toml::from_str(same as every other config reader), extract a pure helper for the check, and add a regression test that includes a multi-key document.Test plan
cargo test -p llmtrim-core --lib compact_models(8 passed, including new multi-key regression)llmtrim doctorno longer warns about compact when~/.config/llmtrim/config.tomlhas[compact] models = [...]llmtrim ensuredoes not re-prompt the cheaper/compactmodels question when already configured