Skip to content

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

fix(api): remove unused import in rest module

Steven Enamakel607d8ff50a82
diff --git a/crates/openhuman-core/src/api/rest.rs b/crates/openhuman-core/src/api/rest.rs
index 885c8bbcfb..60bd527d6c 100644
--- a/crates/openhuman-core/src/api/rest.rs
+++ b/crates/openhuman-core/src/api/rest.rs
@@ -124,6 +124,14 @@ pub fn flatten_authed_error(err: anyhow::Error) -> String {
Some(BackendApiError::Unauthorized { method, path }) => {
format!("SESSION_EXPIRED: backend rejected session token on {method} {path}")
}
+ // Deliberately NOT the `SESSION_EXPIRED` sentinel: this runtime
+ // authenticates with an API key, not a session, so there is no
+ // session to expire and `core/jsonrpc.rs`'s `SessionExpired` publish
+ // (clear the session, prompt re-sign-in) would be the wrong
+ // recovery. See `BackendApiError::ApiKeyRejected`.
+ Some(BackendApiError::ApiKeyRejected { method, path }) => {
+ format!("API_KEY_REJECTED: backend rejected api key on {method} {path}")
+ }
_ => format!("{err:#}"),
}
}