@devries-cameron20 / composio-1 / commits / fc9745040
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat(cli): make headless composio login agent-friendly (PRDE-1138) (#3945)

## What Closes the PRDE-1138 gap: an unattended agent hitting plain `composio login` in a pipe dead-ended at browser OAuth. Now the default headless path either completes unattended or tells the agent exactly what to run — without ever auto-creating an account for a human. - **Offer**: non-interactive login instructions gain a second hint — "For unattended agents: run `composio login --agent`" — alongside the existing URL + `composio login --poll` flow. - **Perform (reuse only)**: when `~/.composio/agent.json` already holds a READY agent identity, plain headless `composio login` completes unattended by reusing it. New `getStoredReadyAgent` in `services/agents.ts` is the reuse-only counterpart of `getOrSignupReadyAgent` — it never falls back to signup. - **Guardrail** (the design constraint from the ticket): account creation stays exclusively behind the explicit `composio login --agent` / `composio signup` commands. A human piping `composio login` with no stored agent identity gets the same URL instructions as before and no account. Asserted at both unit and E2E level (`/api/signup` is never called on the default path). - `install.sh --agent` login now sets `COMPOSIO_CLI_INVOCATION_ORIGIN=installer` for analytics attribution. - Root `.dockerignore`: host `node_modules` (pnpm store symlinks that break outside the host) no longer enter the e2e image build context; without this, e2e images cannot build from a checkout that has run `pnpm install`. ## Verification - `pnpm typecheck` green; `@composio/cli` suite green — 1001 passed, 1 skipped; `validate:boundaries` clean. - New Docker E2E suite `ts/e2e-tests/cli/agent-signin` (10/10) against a mock `agents.composio.dev` (`COMPOSIO_AGENTS_BASE_URL`): unattended nothing→authenticated (`login --agent` then `whoami` in one container), headless-human guardrail (instructions printed, zero signup calls), stored-identity reuse (login completes + whoami reports `account_type: agent`). No real accounts are created. ## Notes - No VHS recordings: the visible change is piped-mode text output, which VHS interactive recordings don't demonstrate. - No changeset by design (`@composio/cli` is Changesets-ignored); human-facing note added to `ts/packages/cli/CHANGELOG.md` under 0.3.0.

Kshitij Jhunjhunwala committed Jul 28, 2026 at 13:48 UTC fc9745040ae5105e0e017a8a5327a30577cb9fdf

No changes.