Skip to content

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

fix(tests): align the claude-code and composio raw-coverage tests with host storage

M3gA-Mindd1124cc18c4d
diff --git a/crates/openhuman-core/src/inference/schemas/catalog.rs b/crates/openhuman-core/src/inference/schemas/catalog.rs
index f9ee65ebe0..7756a90c9a 100644
--- a/crates/openhuman-core/src/inference/schemas/catalog.rs
+++ b/crates/openhuman-core/src/inference/schemas/catalog.rs
@@ -295,7 +295,7 @@ pub fn schemas(function: &str) -> ControllerSchema {
"claude_code_settings" => ControllerSchema {
namespace: "inference",
function: "claude_code_settings",
- description: "Read the persisted Claude Code provider settings (currently just the full-access toggle). Self-contained per-install state kept in its own claude_code_settings.json beside config.toml in the OpenHuman config directory — not inside the central config file, and not under the internal workspace dir (config.workspace_dir).",
+ description: "Read the persisted Claude Code provider settings (currently just the full-access toggle). Kept in the workspace's host storage (its own KV namespace), not inside the central config file.",
inputs: vec![],
outputs: vec![json_output(
"settings",
diff --git a/docs/gitbooks/en/developing/providers/claude-code.md b/docs/gitbooks/en/developing/providers/claude-code.md
index 5645f65ea9..4a5ef978d4 100644
--- a/docs/gitbooks/en/developing/providers/claude-code.md
+++ b/docs/gitbooks/en/developing/providers/claude-code.md
@@ -77,7 +77,7 @@ On macOS the spawn runs inside a Seatbelt jail (`sandbox-exec`) by default when
### Permission posture and full access
-The default, `acceptEdits`, limits Claude Code to file reads and edits under `project_dir` and withholds shell, network and `Task` access through `--disallowedTools`. You can opt into full access (the whole Claude Code toolset, including Bash) with the settings toggle saved in `<workspace_dir>/claude_code_settings.json`, or with `OPENHUMAN_CLAUDE_CODE_PERMISSION_MODE=bypass|bypassPermissions|full`. This is an explicit choice. Enabling the provider alone never grants shell or network access.
+The default, `acceptEdits`, limits Claude Code to file reads and edits under `project_dir` and withholds shell, network and `Task` access through `--disallowedTools`. You can opt into full access (the whole Claude Code toolset, including Bash) with the settings toggle (saved in the workspace's host storage), or with `OPENHUMAN_CLAUDE_CODE_PERMISSION_MODE=bypass|bypassPermissions|full`. This is an explicit choice. Enabling the provider alone never grants shell or network access.
## Auth resolution order
diff --git a/tests/raw_coverage/composio_host_helpers_e2e.rs b/tests/raw_coverage/composio_host_helpers_e2e.rs
index 3fa875c1ce..ed829105fd 100644
--- a/tests/raw_coverage/composio_host_helpers_e2e.rs
+++ b/tests/raw_coverage/composio_host_helpers_e2e.rs
@@ -143,6 +143,13 @@ async fn composio_ops_mode_is_local_and_trigger_history_reads_the_module_archive
#[tokio::test]
async fn composio_action_tool_execute_reports_missing_route_without_network() {
let _module = crate::CONNECTOR_MODULE_LOCK.lock().await;
+ // Execute reads the toolkit's scope preference from the connector module's
+ // host storage before it needs a route.
+ let env_lock = ENV_LOCK
+ .get_or_init(|| tokio::sync::Mutex::new(()))
+ .lock()
+ .await;
+ let _storage = crate::HostStorage::install(&env_lock);
crate::tinyhumans_boot::boot();
let tmp = tempfile::tempdir().expect("temp config directory");
let config = Config {
diff --git a/tests/raw_coverage/inference_provider_auth_e2e.rs b/tests/raw_coverage/inference_provider_auth_e2e.rs
index 6e5d9eaed7..ae3b36fa58 100644
--- a/tests/raw_coverage/inference_provider_auth_e2e.rs
+++ b/tests/raw_coverage/inference_provider_auth_e2e.rs
@@ -880,30 +880,9 @@ async fn inference_claude_code_full_access_toggle_round_trips_through_the_worksp
payload(&enabled, "set_full_access true").get("full_access"),
Some(&json!(true))
);
- // NOTE: despite the RPC description ("stored under the workspace") and the
- // helper's name (`workspace_dir_from_config`), the file lands in the
- // **config** directory — the function returns `config.config_path.parent()`,
- // i.e. `~/.openhuman`. Asserting the real location so this test documents
- // where the toggle actually is; the wording mismatch is filed in
- // ~/tinyhuman/bugs/e2e-wave-inference-stale-vision-and-workspace-docs.md.
- let settings_file = harness
- .home()
- .join(".openhuman")
- .join("claude_code_settings.json");
- assert!(
- settings_file.exists(),
- "the toggle must land on disk at {}",
- settings_file.display()
- );
- let on_disk: Value =
- serde_json::from_str(&std::fs::read_to_string(&settings_file).expect("read settings file"))
- .expect("settings file must be JSON");
- assert_eq!(
- on_disk.get("full_access"),
- Some(&json!(true)),
- "the persisted file must agree with the reply: {on_disk}"
- );
-
+ // The toggle is persisted in the workspace's host storage (the
+ // `tinyagents-harness` / `claude_code_settings` KV namespace, e15c33a68f),
+ // not a JSON file, so persistence is proven by reading it back.
let read_back = harness
.rpc(
75_003,
@@ -940,21 +919,6 @@ async fn inference_claude_code_full_access_toggle_round_trips_through_the_worksp
Some(&json!(false))
);
- // A corrupt settings file must fail *safe* — defaults, not full access.
- std::fs::write(&settings_file, "{ this is not json").expect("corrupt the settings file");
- let corrupt = harness
- .rpc(
- 75_006,
- "openhuman.inference_claude_code_settings",
- json!({}),
- )
- .await;
- assert_eq!(
- payload(&corrupt, "claude_code_settings corrupt").get("full_access"),
- Some(&json!(false)),
- "a corrupt settings file must never fail open into bypassPermissions"
- );
-
// Failure path: `enabled` is required and must be a bool.
let missing = harness
.rpc(