Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
test(cli): guard the tokenizer and companion entries at startup
The startup-imports test now forbids js-tiktoken and both companion entry modules, matching the executable graph check in scripts/_shared.ts.
jkomyno committed
Sep 14, 2026 at 20:07 UTC
884951b0020c5f0a1108b2596cac291bdeaa94db
1 file changed
+7
-3
ts/packages/cli/test/src/commands/startup-imports.test.ts
+7
-3
@@ -3,9 +3,10 @@ import { describe, expect, it } from 'vitest';
3
4
/**
5
* Modules that must never be evaluated by merely building the command tree.
6
- * The TypeScript compiler and the generation pipeline cost ~165ms of module
7
- * evaluation and are only needed by `composio run` and `composio generate`,
8
- * which import them from inside their handlers. A static import anywhere on the
6
+ * The TypeScript compiler, the generation pipeline and the tokenizer ship as
7
+ * companion modules that `composio run`, `composio generate` and large
8
+ * `composio execute` responses load on demand, the same list the binary build
9
+ * guard in `scripts/_shared.ts` checks. A static import anywhere on the
10
* startup path silently puts that cost back on every invocation, so this test
11
* loads the command tree in a fresh Bun process and inspects what it pulled in.
12
*/
@@ -15,6 +16,9 @@ const FORBIDDEN_AT_STARTUP: ReadonlyArray<string> = [
16
'/packages/ts-builders/',
17
'/src/generation/',
18
'/src/commands/run-source-transforms',
19
+ '/node_modules/js-tiktoken/',
20
+ '/src/services/generation-runtime',
21
+ '/src/services/execute-output-encoder-runtime',
22
];
23
24
/**