Composio direct mode still calls the backend list_tools route in the integrations-agent spawn path
Summary
In Composio direct mode on a signed-out local install, the integrations-agent spawn path still issues GET /agent-integrations/composio/tools?toolkits=<slug> against the TinyHumans backend, which 401s (SESSION_EXPIRED) — a mode-awareness gap.
Problem
What happened vs expected: with [composio] mode = "direct" and no cloud session, delegating a Gmail task produced:
WRN [auth] SessionExpired ignored for local offline session — re-enabling scheduler gate
source=integrations.GET:/agent-integrations/composio/tools?toolkits=gmail
reason=SESSION_EXPIRED: backend rejected session token … (401 for https://api.tinyhumans.ai/agent-integrations/composio/tools?toolkits=gmail …)
ComposioClient::list_tools (src/openhuman/integrations/composio/client.rs) is backend-only, and at least one caller in the spawn/refresh path reaches it in direct mode. The direct-mode branch in subagent_runner deliberately uses the cached catalogue ([composio-direct] … using cached catalogue, skipping backend list_tools refresh), but some path still hits the backend route. Expected: direct mode never calls api.tinyhumans.ai for Composio surfaces — either direct_list_tools or the cached catalogue.
Impact is muted (the error is classified and ignored for offline sessions) but it's noise, a needless network call, and — when the cached catalogue is empty because sync hasn't succeeded yet — the sub-agent spawns with zero toolkit actions and fails, with the backend 401 as the only breadcrumb.
Steps to reproduce:
- Direct mode, signed out of TinyHumans, working Composio key + a connected toolkit.
- Ask the assistant to use that toolkit (routes through
delegate_to_integrations_agent). - Observe the backend
GET /agent-integrations/composio/tools401 in logs.
Version/platform: v0.63.14, macOS, direct mode, local-only.
Solution (optional)
Audit list_tools/fetch_toolkit_actions call sites for mode-awareness; in direct mode route them to the v3 direct client (or explicitly to the cached catalogue) so IntegrationClient is never dialed. A maintainer call on cached-catalogue vs live direct fetch at spawn time would settle the design.
Acceptance criteria
- [ ] Repro gone — direct mode + signed out produces zero requests to
api.tinyhumans.ai/agent-integrations/composio/*. - [ ] Regression safety — a test pins the spawn path's tool discovery in direct mode.
- [ ] Diff coverage ≥ 80% — the fix PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by
.github/workflows/ci-lite.yml).
Related
—
Triage: valid — Current review confirms this is a concrete, in-scope engineering issue or request: “Composio direct mode still calls the backend list_tools route in the integrations-agent spawn path”. No complete resolution is evident in current main.