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
refactor(security): simplify master key cache lookup
Steven Enamakelbcbc3ee4e4f7
diff --git a/crates/openhuman-core/src/security/keyring/encrypted_file_backend.rs b/crates/openhuman-core/src/security/keyring/encrypted_file_backend.rsindex 52e6aca311..5c662e4b84 100644--- a/crates/openhuman-core/src/security/keyring/encrypted_file_backend.rs+++ b/crates/openhuman-core/src/security/keyring/encrypted_file_backend.rs@@ -135,9 +135,8 @@ pub(crate) fn storage_master_key() -> Result<[u8; KEY_LEN], String> {// Only a loaded key is cached: a failure (locked keychain, denied prompt)// is retried on the next call so secrets recover once access is restored.static STORAGE_MASTER_KEY: OnceLock<[u8; KEY_LEN]> = OnceLock::new();- match MASTER_KEY.get() {- Some(Ok(Some(key))) => return Ok(*key),- _ => {}+ if let Some(Ok(Some(key))) = MASTER_KEY.get() {+ return Ok(*key);}// `init_master_key` already tried the keychain this session and it// failed: reuse that outcome, do not prompt again. (`Ok(None)` alone also