Skip to content

fix(skills): two_stage_matching and confusability_threshold not applied at startup #2404

@bug-ops

Description

@bug-ops

Problem

[skills] confusability_threshold and [skills] two_stage_matching config fields are never applied during initial agent startup — they only take effect after a hot config reload. On a fresh launch, both fields default to 0.0/false regardless of config file values.

Root cause

PR #2402 wired these fields into reload_config() but missed two things:

  1. No builder methods: AgentBuilder has no with_two_stage_matching() or with_confusability_threshold() methods.
  2. Not wired in runner.rs/daemon.rs: src/runner.rs:978 and src/daemon.rs:376 call with_disambiguation_threshold(config.skills.disambiguation_threshold) but have no equivalent calls for two_stage_matching or confusability_threshold.

Impact

  • /skills confusability always reports "monitoring is disabled" even when confusability_threshold = 0.85 is set in config ✅ (confirmed in CI-279)
  • two_stage_matching = true in config is silently ignored at startup
  • Both fields become active only after hot-reload (e.g. saving the config file while agent is running)

Fix

  1. Add builder methods:

    // in crates/zeph-core/src/agent/builder.rs
    pub fn with_two_stage_matching(mut self, enabled: bool) -> Self {
        self.skill_state.two_stage_matching = enabled;
        self
    }
    pub fn with_confusability_threshold(mut self, threshold: f32) -> Self {
        self.skill_state.confusability_threshold = threshold.clamp(0.0, 1.0);
        self
    }
  2. Wire them in src/runner.rs and src/daemon.rs alongside the existing with_disambiguation_threshold() call:

    .with_disambiguation_threshold(config.skills.disambiguation_threshold)
    .with_two_stage_matching(config.skills.two_stage_matching)
    .with_confusability_threshold(config.skills.confusability_threshold)

Verification

After fix: /skills confusability should show a report (not the disabled message) when confusability_threshold = 0.85 is set in config.

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingskillszeph-skills crate

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions