Skip to content

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

fix(credentials): always carry api key forward on credential clear

Steven Enamakele354e10fc571
diff --git a/crates/openhuman-core/src/security/credentials/ops/credential.rs b/crates/openhuman-core/src/security/credentials/ops/credential.rs
index 78e3b70f11..30a1b5ddcc 100644
--- a/crates/openhuman-core/src/security/credentials/ops/credential.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/credential.rs
@@ -391,13 +391,8 @@ pub async fn clear_credential(
// an unrelated, stale key sitting at the pre-login
// workspace must never silently outrank the key that was
// the effective credential a moment ago (#6318).
- if !api_key::has_api_key(&effective_config) {
- api_key::store_api_key(&effective_config, key)
- .map_err(|e| e.to_string())?;
- logs.push(
- "api key carried forward to the signed-out workspace".to_string(),
- );
- }
+ api_key::store_api_key(&effective_config, key).map_err(|e| e.to_string())?;
+ logs.push("api key carried forward to the signed-out workspace".to_string());
}
// Either the key was just moved to the post-teardown config
// above, or `kind` is `None` and it must be removed outright.