huskies: merge 962

This commit is contained in:
dave
2026-05-13 11:58:50 +00:00
parent 658e02c9b2
commit 184c214c34
19 changed files with 204 additions and 44 deletions
+16
View File
@@ -1,4 +1,9 @@
//! Project configuration — parses `project.toml` for agents, components, and server settings.
/// Typed agent name (mirrors the agents.toml roster).
pub mod agent_name;
pub use agent_name::AgentName;
use crate::slog;
use serde::Deserialize;
use std::collections::HashSet;
@@ -646,6 +651,17 @@ fn validate_agents(agents: &[AgentConfig]) -> Result<(), String> {
}
}
}
// Skip the AgentName roster check in test mode — unit tests use
// synthetic agent names (e.g. "first", "second") that are not in the
// production enum. The check is meaningful only at server startup.
#[cfg(not(test))]
agent.name.parse::<AgentName>().map_err(|_| {
format!(
"Agent '{}': name is not in the AgentName roster; \
add a variant to `config::AgentName` or remove this agent from agents.toml",
agent.name
)
})?;
}
Ok(())
}