fix: align discovered_config_files count with config check

The status_context function now filters loader.discover() to only count
paths that exist on disk, matching the check_config_health behavior.
Both config.discovered_files_count and workspace.discovered_config_files
now report the same number.

Generated with https://github.com/Yeachan-Heo/gajae-code
Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
bellman
2026-06-05 01:17:06 +09:00
parent 2447273d09
commit 6757ebde74
2 changed files with 3 additions and 2 deletions

View File

@@ -9238,7 +9238,8 @@ fn status_context(
) -> Result<StatusContext, Box<dyn std::error::Error>> {
let cwd = env::current_dir()?;
let loader = ConfigLoader::default_for(&cwd);
let discovered_config_files = loader.discover().len();
// #456: count only paths that exist on disk, matching check_config_health behavior.
let discovered_config_files = loader.discover().iter().filter(|e| e.path.exists()).count();
// #143: degrade gracefully on config parse failure rather than hard-fail.
// `claw doctor` already does this; `claw status` now matches that contract
// so that one malformed `mcpServers.*` entry doesn't take down the whole