Skip to content

bug(onboarding): Composio GMAIL_FETCH_EMAILS returns 400 — profile building always fails #1296

@graycyrus

Description

@graycyrus

Bug

The "Building your profile" step in onboarding always fails with a 400 Bad Request from the Composio backend, even when Gmail is connected. Users see the "Almost there!" error screen and can never get a profile built during onboarding.

Error

[onboarding:context] gmail stage failed
Error: composio execute_tool failed: Backend returned 400 Bad Request
  for POST https://staging-api.alphahuman.xyz/agent-integrations/composio/execute

The pipeline never gets past Stage 1 (Gmail search), so LinkedIn scrape and profile build are always skipped.

Reproduction

  1. Start fresh onboarding with Gmail connected via Composio
  2. Reach the "Building your profile..." step (ContextGatheringStep)
  3. Pipeline immediately fails → "Almost there!" error screen

Call trace

ContextGatheringStep.tsx:107  →  callCoreRpc({ method: 'openhuman.tools_composio_execute', params: { action: 'GMAIL_FETCH_EMAILS', params: { query: 'from:linkedin.com', max_results: 10 } } })
  ↓
src/openhuman/tools/schemas.rs:165  →  handle_composio_execute()  →  client.execute_tool(&action, action_args)
  ↓
src/openhuman/composio/client.rs:136  →  POST /agent-integrations/composio/execute  →  { "tool": "GMAIL_FETCH_EMAILS", "arguments": { "query": "from:linkedin.com", "max_results": 10 } }
  ↓
src/openhuman/integrations/client.rs:95  →  400 Bad Request

Likely causes

  1. Backend validation changed — the /agent-integrations/composio/execute endpoint may have updated its expected request schema without a corresponding core update
  2. Composio auth/connection expired — the connected Gmail account's OAuth token may have expired or been revoked
  3. Argument format mismatch — backend may now expect a different shape for arguments (e.g. rejecting certain param names or types)

Impact

  • Every new user going through onboarding with Gmail connected hits this
  • Profile is never built automatically — users must manually update later
  • The graceful fallback ("Almost there!") masks the issue, so users don't know something broke

Files involved

File Role
app/src/pages/onboarding/steps/ContextGatheringStep.tsx:107 Frontend RPC call
src/openhuman/tools/schemas.rs:165 RPC handler handle_composio_execute
src/openhuman/composio/client.rs:125-140 HTTP client building POST body
src/openhuman/integrations/client.rs:82-96 Error reporting (Sentry tags)

Next steps

  • Check Sentry for tagged errors from integrations/client.rs with path=/agent-integrations/composio/execute
  • Inspect backend logs for the 400 response body (validation error details)
  • Verify Composio OAuth connection health

Metadata

Metadata

Assignees

Labels

auth-onboardingLogin, session, onboarding, invites, and first-run UX.composioComposio-backed provider integrations, sync, and provider adapters.priority: criticalProduction-impacting or release-blocking work.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions