Skip to content

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

refactor(cli): use shared constant for agent chat method name

Steven Enamakelb28ac01f1081
diff --git a/crates/openhuman-core/src/core/cli.rs b/crates/openhuman-core/src/core/cli.rs
index 10ec6b4c5e..153dd86453 100644
--- a/crates/openhuman-core/src/core/cli.rs
+++ b/crates/openhuman-core/src/core/cli.rs
@@ -417,7 +417,7 @@ fn run_call_command(args: &[String]) -> Result<()> {
let value = rt
.block_on(async {
let dispatch = DispatchCtx::process_default();
- let dispatch = if method == "inference.agent_chat" {
+ let dispatch = if method == crate::inference::schemas::INFERENCE_AGENT_CHAT {
dispatch.with_headless_agent_chat()
} else {
dispatch
diff --git a/tests/cli_agent_chat_headless_e2e.rs b/tests/cli_agent_chat_headless_e2e.rs
index 4f297555d3..3fb61436ac 100644
--- a/tests/cli_agent_chat_headless_e2e.rs
+++ b/tests/cli_agent_chat_headless_e2e.rs
@@ -159,7 +159,12 @@ fn run_cli(
let params = json!({ "message": "Delegate this request to a child and report its exact result", "model_override": "e2e-mock-model" });
let mut child = ChildGuard(
Command::new(env!("CARGO_BIN_EXE_openhuman-core"))
- .args(["call", "--method", "inference.agent_chat", "--params"])
+ .args([
+ "call",
+ "--method",
+ "openhuman.inference_agent_chat",
+ "--params",
+ ])
.arg(params.to_string())
.env("HOME", home)
.env("USERPROFILE", home)