From c35b6a90edff17e1944150f8e14df793f2feec24 Mon Sep 17 00:00:00 2001 From: Scott Werner Date: Tue, 16 Jun 2026 12:01:17 -0400 Subject: [PATCH] refactor(config): apply /simplify cleanups to cli target resolve - warn_if_demoted_template labels for cli.target now use the real config paths (cli.target.url / cli.target.path) instead of the synthetic cli.target.http.url / cli.target.unix.path. The http/unix segment is the serde tag value, not a TOML path segment, so the old labels matched neither the actual config path nor the adjacent require_string error paths. This aligns the warn field with the error path and with the convention used by the other demoted-field warnings (run.model.provider, cli.exec.model.*). - resolve_exec reuses the `model` binding when building CliExecModelSettings instead of re-deriving exec.model.as_ref() twice. Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/crates/fabro-config/src/resolve/cli.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/crates/fabro-config/src/resolve/cli.rs b/lib/crates/fabro-config/src/resolve/cli.rs index 12ebebb9d..ad6c63dc6 100644 --- a/lib/crates/fabro-config/src/resolve/cli.rs +++ b/lib/crates/fabro-config/src/resolve/cli.rs @@ -47,13 +47,13 @@ fn resolve_target( ) -> Option { match target { Some(CliTargetLayer::Http { url }) => { - super::warn_if_demoted_template("cli.target.http.url", url.as_deref()); + super::warn_if_demoted_template("cli.target.url", url.as_deref()); Some(CliTargetSettings::Http { url: require_string(url.as_ref(), "cli.target.url", errors), }) } Some(CliTargetLayer::Unix { path }) => { - super::warn_if_demoted_template("cli.target.unix.path", path.as_deref()); + super::warn_if_demoted_template("cli.target.path", path.as_deref()); Some(CliTargetSettings::Unix { path: require_string(path.as_ref(), "cli.target.path", errors), }) @@ -80,8 +80,8 @@ fn resolve_exec(exec: Option<&CliExecLayer>) -> CliExecSettings { .prevent_idle_sleep .expect("defaults.toml should provide cli.exec.prevent_idle_sleep"), model: CliExecModelSettings { - provider: exec.model.as_ref().and_then(|model| model.provider.clone()), - name: exec.model.as_ref().and_then(|model| model.name.clone()), + provider: model.and_then(|model| model.provider.clone()), + name: model.and_then(|model| model.name.clone()), }, agent: CliExecAgentSettings { permissions: exec.agent.as_ref().and_then(|agent| agent.permissions),