Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(config): correct type resolution for model pin tests

Steven Enamakel800c08632bc4
diff --git a/crates/openhuman-core/src/config/schema/types/resolvers.rs b/crates/openhuman-core/src/config/schema/types/resolvers.rs
index e91a5ea848..0ad3246473 100644
--- a/crates/openhuman-core/src/config/schema/types/resolvers.rs
+++ b/crates/openhuman-core/src/config/schema/types/resolvers.rs
@@ -76,8 +76,8 @@ impl Config {
/// 1. `orchestrator.model` when resolving the front-line orchestrator.
/// 2. `[teams.<agent_id>]` entries, with `lead_model` used for agents
/// that can delegate and `agent_model` used for leaf workers.
- /// 3. Built-in aliases such as `[teams.code]` for `code_executor` and
- /// `[teams.tools]` for `tools_agent`, matching the issue examples.
+ /// 3. `[teams.<name>]` for an `<name>_agent` id (e.g. `[teams.code]` for
+ /// `code_agent`).
///
/// Empty strings are ignored so partially-written configs fall back to
/// the existing auto-routing path.
@@ -105,27 +105,9 @@ impl Config {
return Some(model);
}
- if let Some(stripped) = agent_id.strip_suffix("_agent") {
- if let Some(model) = self
- .teams
- .get(stripped)
- .and_then(|team| team.model_for_role(is_team_lead))
- {
- return Some(model);
- }
- }
-
- let aliases: &[&str] = match agent_id {
- "code_executor" => &["code"],
- "tool_maker" | "tools_agent" => &["tools"],
- "integrations_agent" => &["integrations"],
- _ => &[],
- };
-
- aliases.iter().find_map(|alias| {
- self.teams
- .get(*alias)
- .and_then(|team| team.model_for_role(is_team_lead))
- })
+ let stripped = agent_id.strip_suffix("_agent")?;
+ self.teams
+ .get(stripped)
+ .and_then(|team| team.model_for_role(is_team_lead))
}
}
diff --git a/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs b/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
index f22ac8f11a..5de7364145 100644
--- a/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
+++ b/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
@@ -50,17 +50,20 @@ fn config_parses_orchestrator_and_team_model_pins() {
Some("deepseek/deepseek-r2")
);
assert_eq!(
- config.configured_agent_model("tool_maker", false),
+ config.configured_agent_model("tools", false),
Some("deepseek/v3.2")
);
assert_eq!(
- config.configured_agent_model("tool_maker", true),
+ config.configured_agent_model("tools", true),
Some("minimax/m3")
);
+ // `<name>_agent` falls back to `[teams.<name>]`.
assert_eq!(
- config.configured_agent_model("code_executor", false),
+ config.configured_agent_model("code_agent", false),
Some("qwen/qwen3")
);
+ // The retired built-in aliases no longer resolve.
+ assert_eq!(config.configured_agent_model("code_executor", false), None);
}
#[test]
@@ -119,5 +122,5 @@ fn empty_model_pin_values_fall_back_to_auto_routing() {
);
assert_eq!(config.configured_agent_model("orchestrator", true), None);
- assert_eq!(config.configured_agent_model("tool_maker", false), None);
+ assert_eq!(config.configured_agent_model("tools_agent", false), None);
}