@devries-cameron20 / composio Mirror · read-only / commits / f8a6483cf
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 12:15 UTC

perf(cli): store large execute output by byte size, not tokens (#4483)

This PR: - builds on top of https://github.com/ComposioHQ/composio/pull/4475 - stores `composio execute` responses over 40,000 UTF-8 bytes in a session file, replacing the check for more than 10,000 o200k tokens added in https://github.com/ComposioHQ/composio/pull/2979 - keeps `tokenCount` in the stored-output summary as an estimate (`ceil(sizeBytes / 4)`), adds `sizeBytes`, and logs `Response stored in <path> (N KB, ~M tokens)` - removes `js-tiktoken` and the `execute-output-encoder-runtime` companion from https://github.com/ComposioHQ/composio/pull/4469, with its tsdown entry, build-guard and startup-import patterns, upgrade fixture entry, and the encoder fallback and special-token tests - keeps `execute-output-encoder-runtime.mjs` in the three uninstall lists, so installs that shipped it can still remove the leftover file - behavior change: a 10–40KB response of more than 10,000 tokens now prints inline, and dense non-ASCII output (about 1–2 bytes per token) can print inline at up to ~20,000 tokens - verified: CLI typecheck, full CLI vitest (131 files, 1343 passed, 1 skipped), `test/release-workflow.test.ts`, and `build-companion-modules.ts` with the executable graph check ## Context Nothing reads `tokenCount` as a number: it appears only in the stored-output summary, the two log lines, session history, and a debug log in `run-helpers-runtime.ts`. o200k is not the tokenizer of the model that reads the output, so the exact count only moved the cutoff. It cost the 2.3MB rank table, ~330ms after large tool calls (measured in #4469, not re-measured here), and a separately shipped companion whose absence made `composio run` require a repair download after an upgrade.

Alberto Schiabel committed Sep 16, 2026 at 15:45 UTC f8a6483cfba6fcf8cf2985ebb087d92803e9d90c

No changes.