Skip to content

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

fix(cli): seed api key from env for headless agent chat

Steven Enamakelbbd859271bec
diff --git a/crates/openhuman-core/src/core/cli.rs b/crates/openhuman-core/src/core/cli.rs
index 6b46851664..8b0836b395 100644
--- a/crates/openhuman-core/src/core/cli.rs
+++ b/crates/openhuman-core/src/core/cli.rs
@@ -418,17 +418,19 @@ fn run_call_command(args: &[String]) -> Result<()> {
.block_on(async {
let headless_agent_chat = crate::core::legacy_aliases::resolve_legacy(&method)
== crate::inference::INFERENCE_AGENT_CHAT;
- if headless_agent_chat
- && crate::agent_registry::host_definition::AgentDefinitionRegistry::global()
- .is_none()
- {
+ if headless_agent_chat {
let config = crate::config::Config::load_or_init()
.await
.map_err(|error| error.to_string())?;
- crate::agent_registry::host_definition::AgentDefinitionRegistry::init_global(
- &config.workspace_dir,
- )
- .map_err(|error| error.to_string())?;
+ if crate::agent_registry::host_definition::AgentDefinitionRegistry::global()
+ .is_none()
+ {
+ crate::agent_registry::host_definition::AgentDefinitionRegistry::init_global(
+ &config.workspace_dir,
+ )
+ .map_err(|error| error.to_string())?;
+ }
+ crate::security::credentials::seed_api_key_from_env(&config);
}
let dispatch = DispatchCtx::process_default();
let dispatch = if headless_agent_chat {