fix(core): validate auto_consolidate_min_window rejects zero#3392
Merged
fix(core): validate auto_consolidate_min_window rejects zero#3392
Conversation
Add FocusConfig.auto_consolidate_min_window (default 4, must be >= 1). Config::validate() rejects zero with a clear error. FocusState::should_auto_consolidate() returns false until the configured number of turns has elapsed, preventing LLM calls on every compress invocation when the window was set to 0. Closes #3387
3a1e3fa to
16aa47b
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
FocusConfig.auto_consolidate_min_window: usizefield (default 4, must be >= 1)Config::validate()rejects zero with a descriptive error pointing tofocus.enabled = falseas an alternativeFocusState::should_auto_consolidate()returnsfalseuntil the configured number of turns has elapsed, preventing spurious LLM calls when the window was set to 0Test plan
cargo nextest run --config-file .github/nextest.toml -p zeph-config -p zeph-core— 5 new tests: 3 predicate guards + 2 validation testscargo test --doc -p zeph-core— doc-test annotatedignore(pub(crate) type)cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— 0 warningsCloses #3387