The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(credentials): handle missing credential file gracefully
Steven Enamakelefc13795f867
diff --git a/crates/openhuman-core/src/security/credentials/ops/credential.rs b/crates/openhuman-core/src/security/credentials/ops/credential.rsindex 563f3cc8bf..9d25e4476d 100644--- a/crates/openhuman-core/src/security/credentials/ops/credential.rs+++ b/crates/openhuman-core/src/security/credentials/ops/credential.rs@@ -205,6 +205,7 @@ pub async fn set_credential("{LOG_PREFIX} api key stored");let state = build_session_state(config)?;+ publish_credential_changed(CredentialKind::ApiKey.as_str());return Ok(RpcOutcome::single_log(state, "api key stored"));}@@ -336,6 +337,7 @@ pub async fn set_credential();let state = build_session_state(&effective_config)?;+ publish_credential_changed(resolved.kind.as_str());Ok(RpcOutcome::new(state, logs))}@@ -452,6 +454,9 @@ pub async fn clear_credential(logs.push("credential-gated services restarted for api key".to_string());}+ if removed_session || removed_api_key {+ publish_credential_changed("cleared");+ }Ok(RpcOutcome::new(json!({"removed": removed_session || removed_api_key,@@ -542,3 +547,12 @@ pub async fn store_session(pub async fn clear_session(config: &Config) -> Result<RpcOutcome<Value>, String> {clear_credential(config, Some(CredentialKind::Session)).await}++/// Tell credential-derived caches (the search module's managed routes) to+/// refresh. Carries only the kind, never the credential.+fn publish_credential_changed(kind: &str) {+ tracing::debug!(kind, "{LOG_PREFIX} publishing CredentialChanged");+ crate::core::bus::BUS.publish(crate::core::events::DomainEvent::CredentialChanged {+ kind: kind.to_string(),+ });+}