tinyhumansai/openhuman · error

composio direct mode selected but no api key is configured (

Error message

composio direct mode selected but no api key is configured (set via composio.set_api_key RPC or config.composio.api_key)

What it means

Direct mode was selected in config.composio.mode but neither the keychain nor config.toml holds a non-empty Composio API key, so no direct client can be constructed. The keychain is checked first; config.toml is the power-user fallback.

Source

Thrown at src/openhuman/integrations/composio/client.rs:833

            })?;
            tracing::debug!("[composio-factory] resolved backend variant");
            Ok(ComposioClientKind::Backend(client))
        }
        MODE_DIRECT_PAT => {
            // Prefer keychain-stored key; fall back to `config.toml`.
            let stored = crate::openhuman::security::credentials::get_composio_api_key(config)
                .map_err(|e| anyhow::anyhow!("failed to read stored composio api key: {e}"))?;
            let api_key = stored
                .or_else(|| {
                    config
                        .composio
                        .api_key
                        .as_ref()
                        .map(|k| k.trim().to_string())
                        .filter(|k| !k.is_empty())
                })
                .ok_or_else(|| {
                    anyhow::anyhow!(
                        "composio direct mode selected but no api key is configured \
                         (set via composio.set_api_key RPC or config.composio.api_key)"
                    )
                })?;

            let tool = create_direct_composio_tool_for_api_key(config, &api_key)?;
            tracing::debug!(
                key_len = api_key.len(),
                "[composio-factory] resolved direct variant (key redacted)"
            );
            Ok(ComposioClientKind::Direct(tool))
        }
        unknown => {
            tracing::warn!(mode = %unknown, "[composio-factory] unknown composio mode");
            Err(anyhow::anyhow!(
                "unknown composio mode: \"{unknown}\". Supported: \"backend\", \"direct\""
            ))
        }

View on GitHub (pinned to 7491200858)

Solutions

  1. Set the key via the composio.set_api_key RPC (stores it in the encrypted keychain)
  2. Or set config.composio.api_key in config.toml
  3. Or switch mode back to "backend" and sign in instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/integrations/composio/client.rs:833 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/a719fd7d9e999891. Report an issue: GitHub.