Skip to content

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

docs(credentials): update managed inference bearer resolution notes

Steven Enamakel187254daffe1
diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rs
index 7f349d5c46..fc7fe3c7d9 100644
--- a/crates/openhuman-core/src/core/observability.rs
+++ b/crates/openhuman-core/src/core/observability.rs
@@ -990,7 +990,7 @@ pub fn is_session_expired_message(msg: &str) -> bool {
// TAURI-RUST-N — same OpenHuman backend "Invalid token" envelope
// wrapped by the tinyagents `ProviderError::Display` format
// (`TinyAgentsError::Provider(Box<ProviderError>)`). The crate-native
- // path (`OpenHumanBackendModel`) delegates to tinyagents' `OpenAiModel`
+ // path (`TinyHumansModel` through the host adapter) delegates to TinyInference's `OpenAiModel`
// which formats errors as `"{provider} returned HTTP {status}: {body}"`,
// producing `"OpenHuman returned HTTP 401: ..."` — different from the
// `"OpenHuman API error (401"` prefix the classic `api_error` path emits.
diff --git a/crates/openhuman-core/src/security/credentials/README.md b/crates/openhuman-core/src/security/credentials/README.md
index 97feaf055d..9a4ad455d4 100644
--- a/crates/openhuman-core/src/security/credentials/README.md
+++ b/crates/openhuman-core/src/security/credentials/README.md
@@ -37,7 +37,7 @@ Credential management for the backend credential the core authenticates with and
- **`AuthService`** ([`core.rs`](./core.rs)): `from_config`, `new`, `load_profiles`, `store_provider_token`, `set_active_profile`, `remove_profile`, `get_profile`, `get_provider_bearer_token`.
- **Constants**: `APP_SESSION_PROVIDER` (`"app-session"`), `DEFAULT_AUTH_PROFILE_NAME` (`"default"`), `COMPOSIO_DIRECT_PROVIDER` (`"composio-direct"`), `api_key::API_KEY_PROVIDER` (`"api-key"`).
-- **Credential kinds**: `session_support::CredentialKind {Session, ApiKey, Local}` (wire values `"session"`, `"api-key"`, `"local"`). `session_support::resolve_backend_credential` returns `BackendCredential::ApiKey` when a key is stored (before any session classification) and `BackendCredential::Session` otherwise; `BackendClient::authed_json` sends an API key as `x-api-key` and a session as `Authorization: Bearer`, while `OpenHumanBackendModel::resolve_bearer` sends the key as the bearer for managed inference. Every backend caller goes through it (integrations, voice, channels, webhooks, hosted proxies); bearer-only seams (connector proxy route, memory-host `SessionBearer`, the Socket.IO handshake) use `backend_bearer_secret`, which returns the key first and the stored session otherwise: the backend accepts a key as `Authorization: Bearer` by its `tiny_` prefix. Cloud embeddings mirror `resolve_bearer`. `has_backend_credential` is the boot-time "signed in?" question the scheduler gate asks; `SessionExpired` is ignored for an API-key runtime and for a local session. A local session also has no managed bearer: `resolve_backend_credential` answers `LOCAL_SESSION_BACKEND_UNAVAILABLE` and `resolve_bearer` answers `LOCAL_SESSION_MANAGED_INFERENCE_UNAVAILABLE`, so neither hosted REST nor managed inference sends a token the backend will only 401 (#6932).
+- **Credential kinds**: `session_support::CredentialKind {Session, ApiKey, Local}` (wire values `"session"`, `"api-key"`, `"local"`). `session_support::resolve_backend_credential` returns `BackendCredential::ApiKey` when a key is stored (before any session classification) and `BackendCredential::Session` otherwise; `BackendClient::authed_json` sends an API key as `x-api-key` and a session as `Authorization: Bearer`, ; TinyHumans managed-inference and cloud-embedding host adapters resolve the bearer from the API key first, then the stored app session. Every backend caller goes through it (integrations, voice, channels, webhooks, hosted proxies); bearer-only seams (connector proxy route, memory-host `SessionBearer`, the Socket.IO handshake) use `backend_bearer_secret`, which returns the key first and the stored session otherwise: the backend accepts a key as `Authorization: Bearer` by its `tiny_` prefix. Cloud embeddings mirror `resolve_bearer`. `has_backend_credential` is the boot-time "signed in?" question the scheduler gate asks; `SessionExpired` is ignored for an API-key runtime and for a local session. A local session also has no managed bearer: `resolve_backend_credential` answers `LOCAL_SESSION_BACKEND_UNAVAILABLE` and the managed-inference host resolver answers `LOCAL_SESSION_MANAGED_INFERENCE_UNAVAILABLE`, so neither hosted REST nor managed inference sends a token the backend will only 401 (#6932).
- **Helpers**: `normalize_provider`, `default_profile_id`, `select_profile_id`, `state_dir_from_config`, `profile_id`.
- **Types** ([`profiles.rs`](./profiles.rs)): `AuthProfile`, `AuthProfileKind` (`OAuth`/`Token`), `TokenSet`, `AuthProfilesData`, `AuthProfilesStore`.
- **Ops/RPC** ([`ops`](./ops), re-exported as `rpc`): `set_credential`, `clear_credential`, `store_session`, `clear_session`, `SetCredentialRequest`, `seed_api_key_from_env`, `seed_session_from_env`, `auth_get_state`, `auth_get_session_token_json`, `store_provider_credentials`, `remove_provider_credentials`, `list_provider_credentials`, `list_provider_credentials_by_prefix`, `encrypt_secret`, `decrypt_secret`, `start_credential_gated_services`, `stop_credential_gated_services`.