Skip to content

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

test(tinyflows): seed backend credential for published prompt e2e

Steven Enamakel1927da7898bb
diff --git a/tests/tinyflows_published_prompt_e2e.rs b/tests/tinyflows_published_prompt_e2e.rs
index 0f8e6cf772..47fec48cfe 100644
--- a/tests/tinyflows_published_prompt_e2e.rs
+++ b/tests/tinyflows_published_prompt_e2e.rs
@@ -98,7 +98,13 @@ async fn published_module_prompts_render_through_the_normal_host_path() {
let _home_guard = EnvVarGuard::set_to_path("HOME", temp.path());
let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- let _api_key_guard = EnvVarGuard::unset("OPENHUMAN_BACKEND_API_KEY");
+ // Building a session agent resolves the managed model through a stored
+ // backend credential. Seed one into the isolated profile (file keyring, so
+ // no OS keychain is involved); the prompt-dump child reads the same store.
+ let _api_key_guard = EnvVarGuard::set("OPENHUMAN_BACKEND_API_KEY", "prompt-dump-test-key");
+ let _keyring_backend_guard = EnvVarGuard::set("OPENHUMAN_KEYRING_BACKEND", "file");
+ let _keyring_key_file_guard = EnvVarGuard::unset("OPENHUMAN_KEYRING_MASTER_KEY_FILE");
+ let _keyring_key_guard = EnvVarGuard::set("OPENHUMAN_KEYRING_MASTER_KEY", "33".repeat(32));
let _session_guard = EnvVarGuard::unset("OPENHUMAN_BACKEND_SESSION_TOKEN");
let _storage_guard = EnvVarGuard::unset("OPENHUMAN_STORAGE_URL");
let _source_guard = EnvVarGuard::unset("OPENHUMAN_MODULE_SOURCE");
@@ -129,6 +135,12 @@ async fn published_module_prompts_render_through_the_normal_host_path() {
for path in [&config_path, &local_config_path] {
std::fs::write(path, &enabled_config).expect("write enabled module override config");
}
+ for path in [&config_path, &local_config_path] {
+ let seed_config = openhuman_core::config::Config::load_from_config_path(path, &workspace)
+ .await
+ .expect("load the config to seed the test credential into");
+ openhuman_core::security::credentials::seed_api_key_from_env(&seed_config);
+ }
for (agent_id, required, invariant) in [
("workflow_builder", "propose_workflow", "propose-only"),