mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-05 02:41:45 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
1afa06a4a0
commit
c35b6a90ed
1 changed files with 4 additions and 4 deletions
|
|
@ -47,13 +47,13 @@ fn resolve_target(
|
|||
) -> Option<CliTargetSettings> {
|
||||
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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue