Skip to content

fix(core): validate auto_consolidate_min_window rejects zero#3392

Merged
bug-ops merged 1 commit intomainfrom
3387-auto-consolidate-min-window
Apr 24, 2026
Merged

fix(core): validate auto_consolidate_min_window rejects zero#3392
bug-ops merged 1 commit intomainfrom
3387-auto-consolidate-min-window

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 24, 2026

Summary

  • Add FocusConfig.auto_consolidate_min_window: usize field (default 4, must be >= 1)
  • Config::validate() rejects zero with a descriptive error pointing to focus.enabled = false as an alternative
  • FocusState::should_auto_consolidate() returns false until the configured number of turns has elapsed, preventing spurious LLM calls when the window was set to 0

Test plan

  • cargo nextest run --config-file .github/nextest.toml -p zeph-config -p zeph-core — 5 new tests: 3 predicate guards + 2 validation tests
  • cargo test --doc -p zeph-core — doc-test annotated ignore (pub(crate) type)
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — 0 warnings

Closes #3387

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate config Configuration file changes bug Something isn't working size/M Medium PR (51-200 lines) labels Apr 24, 2026
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
@bug-ops bug-ops force-pushed the 3387-auto-consolidate-min-window branch from 3a1e3fa to 16aa47b Compare April 24, 2026 23:11
@bug-ops bug-ops enabled auto-merge (squash) April 24, 2026 23:11
@bug-ops bug-ops merged commit 4161beb into main Apr 24, 2026
32 checks passed
@bug-ops bug-ops deleted the 3387-auto-consolidate-min-window branch April 24, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working config Configuration file changes core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(core): validate auto_consolidate_min_window rejects zero

1 participant