Skip to content

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

docs(composio): update README to reflect refactored direct-mode architecture

Steven Enamakeld754f91694ab
diff --git a/crates/openhuman-core/src/integrations/composio/README.md b/crates/openhuman-core/src/integrations/composio/README.md
index 8d7000e8df..bd2287e54d 100644
--- a/crates/openhuman-core/src/integrations/composio/README.md
+++ b/crates/openhuman-core/src/integrations/composio/README.md
@@ -49,10 +49,10 @@ triggers) from a real transport failure.
| `crates/openhuman-core/src/integrations/composio/types.rs` | Serde domain types mirroring backend response envelopes (toolkits, connections, tools, execute, triggers, trigger events/history). Includes drift-tolerant `de_string_or_object` deserializers. |
| `crates/openhuman-core/src/integrations/composio/ops/` | RPC-facing `composio_*` operations returning `Outcome<T>`, split by concern (see [Ops layout](#ops-layout)). |
| `crates/openhuman-core/src/integrations/composio/schemas.rs` + `schemas/` (`registry.rs`, `definitions.rs`, `handlers_identity.rs`, `handlers_tools.rs`, `handlers_connections.rs`, `handlers_triggers.rs`, `params.rs`, `util.rs`) | Controller schemas + `handle_*` handlers; `all_controller_schemas` / `all_registered_controllers` (`schemas/registry.rs`). |
-| `crates/openhuman-core/src/integrations/composio/client.rs` + `client/` (`factory.rs`, `direct.rs`) | Route resolution only: `ComposioRoute` (Backend/Direct) and `resolve_composio_route` (`client/factory.rs`) keep the mode/credential decision and its user-facing errors on the host; the Composio HTTP client itself is the `tinyconnectors` module. `direct_list_connections` / `direct_list_tools` (`client/direct.rs`) are the two direct-mode v3 reads that keep `limit=200` / `toolkit_versions=latest`. |
+| `crates/openhuman-core/src/integrations/composio/client.rs` + `client/` (`factory.rs`, `direct.rs`) | Route resolution only: `ComposioRoute` (Backend/Direct) and `resolve_composio_route` (`client/factory.rs`) keep the mode/credential decision and its user-facing errors on the host; the Composio HTTP client itself is the `tinyconnectors` module. `direct_list_connections` / `direct_list_tools` (`client/direct.rs`) are the two direct-mode v3 reads: they run the `tinyconnectors` library's `DirectRoute` in-process (it owns `limit=200`, `toolkit_versions=latest`, repeated `tags=` and the v3 reshaping) behind the host's invalid-key gate (`direct_auth`). |
| `crates/openhuman-core/src/integrations/composio/module_client.rs` | The `tinyconnectors` module bridge: the one `modules`-feature `#[cfg]` switch, `methods` re-exported from `tinyconnectors_bus`, and member-failure classification (`is_unsupported_by_route`, error-prefix peeling). |
| `crates/openhuman-core/src/integrations/composio/tools.rs` + `tools/` (`authorize.rs`, `connect.rs`, `list_connections.rs`, `list_toolkits.rs`, `list_tools.rs`, `execute.rs`, `registry.rs`, `visibility.rs`) | Agent tools (`ComposioListToolkitsTool`, `ComposioListConnectionsTool`, `ComposioAuthorizeTool`, `ComposioConnectTool`, `ComposioListToolsTool`, `ComposioExecuteTool`) + `all_composio_agent_tools`; scope/visibility gating (`resolve_action_scope`, `evaluate_tool_visibility`). |
-| `crates/openhuman-core/src/integrations/composio/tools/direct.rs` + `tools/direct/` (`types.rs`, `connections.rs`, `discovery.rs`, `construction.rs`, `http_errors.rs`) | Slim direct-mode v3 reader (`DirectComposioClient`, `ComposioConnectedAccount`): `/connected_accounts` and `/tools` with the user's key. Not a `Tool`; execution, OAuth and connection management are the module's. |
+| `crates/openhuman-core/src/integrations/composio/tools/direct.rs` + `tools/direct/` (`types.rs`, `construction.rs`, `transport.rs`, `http_errors.rs`) | The host `tinyconnectors::client::Transport` for the direct route (`DirectComposioClient`): carries the user's key over reqwest with the host proxy/TLS settings, HTTPS-or-loopback guard and no redirects, and renders failures with the messages users see. Not a `Tool`; the v3 paths and reshaping are `tinyconnectors::client::DirectRoute`; execution, OAuth and connection management are the module's. |
| `crates/openhuman-core/src/integrations/composio/action_tool.rs` | `ComposioActionTool`: a `Tool` wrapping exactly one Composio action, constructed as a `ToolExposure::Deferred` tool per action of every connected toolkit (`tools/orchestrator_tools.rs`, and `agent/session_host/recorded_tools.rs` when a resumed thread rebuilds its recorded actions), reached by the orchestrator through `tool_search`. |
| `crates/openhuman-core/src/integrations/composio/contract_gate.rs` | Late-bound action contract gate (#4853): on an action's first call this turn, surfaces the full live contract (via `catalog::fetch_live_toolkit_catalog`) as a recoverable tool error before executing, so the retry has the real schema in context. |
| `crates/openhuman-core/src/integrations/composio/catalog.rs` + `catalog/` (`contract.rs`, `lookups.rs`, `probe.rs`) | Live Composio tool contracts (`fetch_live_toolkit_catalog`, `ToolContract`, in `catalog/contract.rs`): the unfiltered mode-aware `list_tools` schema (the module's `ListTools` member on the backend route, or direct v3 `direct_list_tools`) plus a bounded read-only response probe (`probe_tool_output_sample`, `catalog/probe.rs`) when a schema publishes no `output_parameters`. |
@@ -198,7 +198,7 @@ Published from `ops/` via `crate::core::bus::BUS.publish` (`crate::core::events:
## Notes / gotchas
- **`bus.rs` is a compatibility shim**, trigger/config-change subscribers still live under `crates/openhuman-core/src/memory/sync/composio/`. **`periodic.rs` and `providers/mod.rs` are not shims anymore**, read their own module docs; both were rewritten host-side or reunified from a contract crate after tinymemory v1.13.4 deleted the in-process Composio pipeline they used to glob-import.
-- **Mode-aware routing (#1710)**: the `ops/` layer calls the connector module (`module_client::call*`) for every member, and the module reconciles the backend/direct route from live config on each call, so a `composio.mode` toggle is honoured per call. Two host-side exceptions: `list_connections` in direct mode uses `create_composio_client` + `direct_list_connections` (the v3 response mapper and loopback overrides live here); execution goes through `execute_dispatch.rs`, which is a thin egress gate over the module's `EXECUTE`. Operations a route does not offer (e.g. the toolkit allowlist or triggers in direct mode) come back as a named refusal, recognised by `module_client::is_unsupported_by_route`, and are rendered as empty rather than as an outage. `ops::error_utils::resolve_client` survives only for tests.
+- **Mode-aware routing (#1710)**: the `ops/` layer calls the connector module (`module_client::call*`) for every member, and the module reconciles the backend/direct route from live config on each call, so a `composio.mode` toggle is honoured per call. Two host-side exceptions: `list_connections` in direct mode uses `resolve_composio_route` + `direct_list_connections` (the in-process `DirectRoute` over the host transport, so the host proxy/TLS settings, per-client loopback overrides and the pre-store key probe apply); execution goes through `execute_dispatch.rs`, which is a thin egress gate over the module's `EXECUTE`. Operations a route does not offer (e.g. the toolkit allowlist or triggers in direct mode) come back as a named refusal, recognised by `module_client::is_unsupported_by_route`, and are rendered as empty rather than as an outage. `ops::error_utils::resolve_client` survives only for tests.
- **`ops/` is split by concern** (see [Ops layout](#ops-layout)) rather than one large file; `pass_budget.rs` is the one piece of shared sync-pass plumbing every sync entry point calls through.
- **Error classification matters for the UI**: `execute` may return pre-classified `[composio:error:<class>] …` strings (parsed by `app/src/lib/composio/formatters.ts`); `ops/execute.rs` preserves them rather than re-wrapping.
- **Sentry funnel**: `report_composio_op_error` re-tags op-layer failures under `domain="composio"` with `failure="non_2xx"|"transport"` (+ extracted backend status) so transient 5xx leaks are dropped by `before_send` while genuine bugs surface.