Skip to content

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

fix(rpc): treat trailing --help tokens as option values

Steven Enamakeld3ce54122877
diff --git a/crates/openhuman-rpc/src/host.rs b/crates/openhuman-rpc/src/host.rs
index 8a37113e6d..44270a39bf 100644
--- a/crates/openhuman-rpc/src/host.rs
+++ b/crates/openhuman-rpc/src/host.rs
@@ -140,8 +140,6 @@ fn cli_command_uses_storage(args: &[String], has_cli_handler: impl Fn(&str) -> b
return false;
}
let tail: Vec<&str> = rest.collect();
- #[allow(unused)]
- let _t: Vec<&str> = rest.collect();
match command {
"run" | "serve" | "tui" | "chat" | "sentry-test" => false,
// The MCP server speaks stdio when given no function and runs agent
diff --git a/crates/openhuman-rpc/src/host_tests.rs b/crates/openhuman-rpc/src/host_tests.rs
index 5bbb37bb08..aa7ddc5e96 100644
--- a/crates/openhuman-rpc/src/host_tests.rs
+++ b/crates/openhuman-rpc/src/host_tests.rs
@@ -123,7 +123,14 @@ fn cli_storage_is_opened_for_one_shot_commands_only() {
assert!(!uses(&["call", "--help"]));
assert!(!uses(&["mcp", "-h"]));
assert!(uses(&["agent", "chat"]));
- assert!(!uses(&["cron", "list", "--format", "json", "--help"]));
+ // Later `--help` tokens are option values to the namespace parser.
+ assert!(uses(&["cron", "list", "--format", "json", "--help"]));
+ assert!(uses(&["cron", "add", "--name", "--help"]));
+ assert!(uses(&["mcp"]));
+ assert!(uses(&["mcp-server"]));
+ assert!(!uses(&["mcp", "--help"]));
+ assert!(!uses(&["--model", "--help", "cron", "list"]));
+ assert!(!uses(&["--model"]));
// `help` as an option value is not a help request.
assert!(uses(&["cron", "add", "--name", "help"]));
assert!(uses(&["--model", "help", "cron", "list"]));
diff --git a/tests/cli_storage_url_e2e.rs b/tests/cli_storage_url_e2e.rs
index 060ac088b2..292da0f0dd 100644
--- a/tests/cli_storage_url_e2e.rs
+++ b/tests/cli_storage_url_e2e.rs
@@ -62,11 +62,11 @@ fn a_second_process_reads_what_a_one_shot_wrote_to_the_backend() {
// (url, whether this build carries the driver for it)
let candidates = [
(
- format!("sqlite://{}", data.path().join("shared.db").display()),
+ format!("sqlite:{}", data.path().join("shared.db").display()),
cfg!(feature = "storage-sqlite"),
),
(
- format!("file://{}", data.path().join("shared-files").display()),
+ format!("file:{}", data.path().join("shared-files").display()),
cfg!(feature = "storage-file"),
),
];
@@ -107,6 +107,11 @@ fn a_second_process_reads_what_a_one_shot_wrote_to_the_backend() {
// And without the URL the same fresh workspace has nothing.
let workspace = tempfile::tempdir().unwrap();
let classic = core(workspace.path(), None, &["cron", "list"]);
+ assert!(
+ classic.status.success(),
+ "{}",
+ String::from_utf8_lossy(&classic.stderr)
+ );
assert!(
!String::from_utf8_lossy(&classic.stdout).contains("storage-probe"),
"the job lives in the backend, not in files"