Skip to content

feat(init): add hard_compaction_threshold prompt to --init wizard #1719

@bug-ops

Description

@bug-ops

Context

Tiered context compaction (#1338) introduced two thresholds:

  • soft_compaction_threshold (default 0.70)
  • hard_compaction_threshold (default 0.90)

Current behavior

The --init wizard (src/init.rs) prompts for soft_compaction_threshold with validation that the entered value is less than hard_compaction_threshold. However, hard_compaction_threshold is never prompted — it is read from Config::default() (0.90) only for validation purposes and never written to config.

Users who want a non-default hard threshold must edit config.toml manually.

Expected behavior

The wizard should prompt for hard_compaction_threshold after the soft prompt, store it in WizardState, and write it to config.memory.hard_compaction_threshold.

Implementation

In src/init.rs step_memory():

  1. Add hard_compaction_threshold: f32 to WizardState (default 0.90)
  2. Add an Input prompt for hard threshold after the soft prompt, with validation that hard > soft
  3. Write config.memory.hard_compaction_threshold = state.hard_compaction_threshold alongside the soft threshold

This is the only integration point from CLAUDE.md project rules not fully covered by #1338.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions