8956b698c0
CodeQL's rust/path-injection scan flagged `mcp_config_mtime(path)` because the helper takes `&Path` and calls `fs::metadata(path)`. Both call sites already validate via `validate_mcp_config_path` — `from_config_path` runs the check before constructing the pool, and `reload_if_config_changed` only sees paths that came from a `from_config_path`-validated `config_source` field — so the alert is a false positive about cross-function data flow. The clean fix is to tie the validation to the call site rather than rely on cross-function reasoning: `mcp_config_mtime` now short-circuits to `None` for paths that fail the same allow-list check `load_config` and `save_config` already use. The lazy-reload caller already treats `None` as "skip the check this turn", so a rejected path simply degrades gracefully rather than producing an error path. Cost is one regex check per call on a path we're about to stat anyway. This also makes the helper safe-by-construction for any future caller that forgets to validate, which matches the pattern of the adjacent `load_config` / `save_config` helpers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>