feat: v0.7.0 — configuration post-install : bloc config: par agent (env_map + fichiers), adaptateurs TOML/YAML/JSON/key=value, édition douce, jamais de token en clair (api_key = @secret) (closes #91)

- Nouveau module src/agent_config.rs : apply_post_install (écriture fichiers), apply_env_map (env injectée au start/run), provider_pref (provider > config.provider_default > default_provider)
- am install écrit les fichiers de config de l'agent avec le provider/modèle résolus ; --no-config / install.configurable:false / --dry-run respectés ; agent sans adaptateur → message clair, install réussit
- Catalogue : blocs config: pour claude-code, codex, agentty (+ provider_default)
This commit is contained in:
2026-08-19 20:41:34 -04:00
parent ebc753cc4a
commit 68eb170f57
11 changed files with 627 additions and 6 deletions
+10 -2
View File
@@ -157,6 +157,14 @@ pub fn run(
}
}
// Post-install provider configuration (issue #91): write the agent
// config files with the resolved provider/model. Skipped on --no-config
// and on agents declaring install.configurable: false; never reached in
// dry-run (returns earlier).
if !no_config && spec.configurable {
crate::agent_config::apply_post_install(app, agent, &resolved)?;
}
let entry = installers::make_entry(agent, method, &outcome, app);
let version = entry.version.clone().unwrap_or_else(|| "unknown".to_string());
app.state.set(&entry)?;
@@ -207,7 +215,7 @@ fn resolve_provider_config(
flag_model: Option<&str>,
) -> Result<Option<(String, Option<String>)>> {
let flag_p = flag_provider.filter(|p| !p.is_empty());
let agent_p = agent.provider.as_deref().filter(|p| !p.is_empty());
let agent_p = crate::agent_config::provider_pref(agent).filter(|p| !p.is_empty());
// Explicit provider requested but not registered: hard error.
if let Some(p) = flag_p {
@@ -241,7 +249,7 @@ fn resolve_provider_config(
let Some((pname, def, model)) = crate::providers::resolve_for(
&app.config,
agent.provider.as_deref(),
crate::agent_config::provider_pref(agent),
agent.model.as_deref(),
flag_provider,
flag_model,