feat: phase 2 quick wins (#65 #69 #72)

- #65: update policies + per-agent version pinning
  - add settings.update_policy (stable/latest/skip)
  - add AgentDef.pin_version
  - honor both in update_cmd
  - add update_policy tests

- #69: REPL color theme CLI command
  - add am theme [name] (show/switch)
  - persist selected theme to config

- #72: doctor checks local model runtimes
  - verify ollama and llama-server on PATH
  - for ollama, also check server responds (ollama ls)

Version 0.4.4
This commit is contained in:
2026-08-17 22:24:45 -04:00
parent 98c0b30f68
commit 890ad953e5
12 changed files with 229 additions and 10 deletions
+34
View File
@@ -11,7 +11,17 @@ use std::path::PathBuf;
pub fn run(app: &App, agent_name: Option<&str>, all: bool) -> Result<i32> {
let runner = SystemRunner::new(app.dry_run(), app.cli.verbose, &app.log);
let policy = app.config.settings.update_policy.unwrap_or_default();
if policy == UpdatePolicy::None && all {
app.log.warn("update policy is 'none'; 'am update --all' is a no-op");
return Ok(0);
}
if let Some(name) = agent_name {
if policy == UpdatePolicy::None && !app.yes() {
app.log.warn("update policy is 'none'; use --yes to force a single-agent update");
}
return update_one(app, &runner, name);
}
if all {
@@ -31,6 +41,30 @@ pub fn run(app: &App, agent_name: Option<&str>, all: bool) -> Result<i32> {
fn update_one(app: &App, runner: &dyn Runner, name: &str) -> Result<i32> {
let agent = require_agent(app, name)?;
// Issue #65: honor per-agent pinned version.
if let Some(pin) = agent.pin_version.as_deref() {
let current = app
.state
.get(&agent.name)
.ok()
.flatten()
.and_then(|e| e.version.clone());
if current.as_deref() == Some(pin) {
app.log.success(&format!(
"{} is pinned to v{pin} and already at that version",
agent.title()
));
} else {
app.log.warn(&format!(
"{} is pinned to v{pin} but currently at {}; update skipped",
agent.title(),
current.as_deref().unwrap_or("unknown")
));
}
return Ok(0);
}
let Some(entry) = app.state.get(&agent.name).ok().flatten() else {
bail!(
"agent '{}' is not installed by agent-manager — use 'am install {}'",