Skip to content

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

refactor(inference): adjust turn role resolution logic

Steven Enamakel55f65bf1dc33
diff --git a/crates/openhuman-core/src/inference/turn_models.rs b/crates/openhuman-core/src/inference/turn_models.rs
index d377eb4f37..95da671ddd 100644
--- a/crates/openhuman-core/src/inference/turn_models.rs
+++ b/crates/openhuman-core/src/inference/turn_models.rs
@@ -219,11 +219,15 @@ fn build_turn_models_crate(
factory::PROVIDER_OPENHUMAN,
tier,
);
- let tier_role = registered_role.as_deref().unwrap_or_else(|| {
- tier.strip_prefix("hint:")
- .filter(|role| crate::config::WORKLOAD_ROLES.contains(role))
- .unwrap_or("chat")
- });
+ let tier_role = tier
+ .strip_prefix("hint:")
+ .filter(|role| crate::config::WORKLOAD_ROLES.contains(role))
+ .or_else(|| {
+ registered_role
+ .as_deref()
+ .filter(|role| crate::config::WORKLOAD_ROLES.contains(role))
+ })
+ .unwrap_or("chat");
if let Some(custom) = ctx.host_overrides().and_then(|local| {
local
.role_models