Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(cli): report the instant charge on execute (#4857)
## Summary - `composio execute` and `composio run`'s `execute()` now return an `instantCharge` object (`amount`, `currency`, `chargedBy`) and print `instant charge: <amount> USD` in the success line when a call ran on a Composio instant account instead of a linked connection. A billed call used to look free. - Cause 1: `createToolRouterSessionContext` created Tool Router sessions without `instant.return_instant_charge`, and Apollo only returns `instant_charge` when the session asks for it (visibility only; billing and eligibility are unchanged). - Cause 2: `normalizeResponse` in `tools-executor.ts` copied only `successful`, `data`, `error` and `log_id` from the session execute and executeMeta responses and dropped `instant_charge`. - The stored-file summary and `--parallel` results carry `instantCharge` the same way, including a failed `--parallel` result: a multi-execute batch is reported as failed when any child fails but still carries the aggregate charge of the successful children. The proxy test's expected session payload gains the new `instant` field. ## Validation - `pnpm run typecheck` (CLI package): pass. - `vitest run` (full CLI suite): 134 files, 1404 tests pass after updating the proxy session payload expectation. - `pnpm run validate:boundaries`, oxlint and prettier on changed files, `git diff --check`: pass. - Manual trace on org `kj_workspace` with no exa connection linked, from source: ``` composio execute EXA_SEARCH -d '{"query":"composio"}' ◇ Execution successful (instant charge: 0.007000 USD, logId: log_b8zxaFGiu6-D) ... "instantCharge": { "amount": "0.007000", "currency": "USD", "chargedBy": "composio" } ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev>