@devries-cameron20 / composio Mirror · read-only / commits / 5e7432372
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, 16:00 UTC

fix(cli): ship every codex-acp binary in release archives (#4186)

## Problem `composio upgrade` fails on every CLI currently in the field, including stable `0.3.3`: ``` 💥 services/UpgradeBinaryError • Downloaded binary package is incomplete Caused by: Missing companion module: …/extract/composio-darwin-aarch64/acp-adapters/codex/darwin-x64/codex-acp ``` `archiveCompanionRelativePaths` (added 2026-08-18 in #4134) narrows each release archive to the shared ACP assets plus only the one `codex-acp` its platform can execute. That is a sound optimisation, but it shipped writer-first: a CLI released *before* it verifies a downloaded package against `RUN_COMPANION_STATIC_ASSET_RELATIVE_PATHS` — shared assets plus **all four** codex target paths — with no parameter to relax the check, and hard-fails on any archive missing one. Stable `0.3.3` shipped 2026-08-11, a week before that change, so the entire installed stable base is affected. Recovery today means re-running `install.sh` by hand. Evidence: | Archive | codex binaries shipped | | --- | --- | | `0.3.4-beta.351` (pre-#4134) | `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64` | | `0.4.0-beta.357` (post-#4134) | `darwin-arm64` only | ## Fix The reader has to become tolerant before the writer narrows, and the already-installed reader cannot be patched retroactively. Packaging ships the full companion set again. `archiveCompanionRelativePaths` stays in place with its tests, documented as deliberately uncalled. Re-wiring it into `package-binaries.ts` is a one-line change once no supported client still validates all four paths — worth roughly 651 MB per archive. ## Why CI missed it `cli.test-installation.yml` only exercises fresh `install.sh` installs, which are unaffected: each archive is internally consistent. Nothing covers an in-place upgrade from a previously released binary. Worth closing separately — it needs a real prior-stable binary in the matrix, not a unit test. ## Verification - `vitest run test/src/scripts/release-artifacts.test.ts` — 29 passed - `pnpm --filter @composio/cli typecheck` — clean - `pnpm validate:changesets` — passes (CLI is Changesets-ignored; note lands in `ts/packages/cli/CHANGELOG.md`) - Added coverage asserting every release artifact's codex-acp binary is in the packaged set - Final check is the archive itself: the beta cut from this branch must contain all four `acp-adapters/codex/*/codex-acp` entries, and `composio upgrade` must succeed from a pre-#4134 install `@composio/cli@0.4.0-beta.357` should be abandoned rather than promoted. https://claude.ai/code/session_01JkwtxPHfobZxzvAqe53x62

Alberto Schiabel committed Aug 20, 2026 at 23:10 UTC 5e7432372acad1c39fcca1ee686232b2380324b6
4 files changed +51 -14
ts/packages/cli/CHANGELOG.md
+6
@@ -4,6 +4,12 @@
4
5 ### Patch Changes
6
7 +- `composio upgrade` works again from any previously released CLI. Release
8 + archives had been narrowed to carry only the `codex-acp` binary their own
9 + platform can run, but a CLI installed before that change verifies a downloaded
10 + package against all four platforms' binaries and rejects one that is missing
11 + any of them, failing with `Downloaded binary package is incomplete`. Archives
12 + ship the full set again.
13 - `COMPOSIO_ENVIRONMENT=staging` now opens the staging dashboard at
14 `https://staging-dashboard.composio.dev/`.
15 - `composio dev auth-configs create` now sends custom OAuth credentials and scopes
ts/packages/cli/scripts/_release-artifacts.ts
+6
@@ -68,6 +68,12 @@ export const releaseArtifactTargetFor = (
68 * An archive already carries a platform-specific `composio` binary, so a
69 * darwin-arm64 archive is unusable on linux-x64 no matter which codex-acp
70 * binaries travel with it. Shipping foreign ones only inflates the download.
71 + *
72 + * Packaging deliberately does not call this yet. A CLI released before
73 + * 2026-08-18 verifies a downloaded upgrade package against all four codex-acp
74 + * paths, so an archive narrowed this way breaks `composio upgrade` for every
75 + * client already in the field. Wire it back into `package-binaries.ts` once no
76 + * supported client still performs that check.
77 */
78 export const archiveCompanionRelativePaths = ({
79 allRelativePaths,
ts/packages/cli/scripts/package-binaries.ts
+12 -14
@@ -25,11 +25,7 @@ import {
25 collectExpectedRunCompanionAssetRelativePaths,
26 RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS,
27 } from '../src/services/run-companion-modules';
28 -import {
29 - archiveCompanionRelativePaths,
30 - ARTIFACT_NAMES,
31 - releaseArtifactTargetFor,
32 -} from './_release-artifacts';
28 +import { ARTIFACT_NAMES } from './_release-artifacts';
29
30 const BINARIES_DIR = './dist/binaries';
31 const COMPANIONS_DIR = path.join(BINARIES_DIR, 'companions');
@@ -49,8 +45,7 @@ export function packageBinaries() {
45 }
46
47 // One packaging host produces all four archives, so `COMPANIONS_DIR` must hold
52 - // every platform's codex-acp binary before packaging starts. Validate that full
53 - // set up front; each archive then receives only the slice it can execute.
48 + // every platform's codex-acp binary before packaging starts.
49 const allCompanionRelativePaths = yield* collectExpectedRunCompanionAssetRelativePaths(
50 COMPANIONS_DIR,
51 { staticAssetRelativePaths: RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS }
@@ -70,13 +65,16 @@ export function packageBinaries() {
65 yield* Console.log(`Packaging ${binaries.length} binaries...`);
66
67 for (const binary of binaries) {
73 - // An archive's `composio` binary is already platform-specific, so a foreign
74 - // codex-acp binary inside it could never run. Ship only this platform's.
75 - const target = yield* releaseArtifactTargetFor(binary);
76 - const companionRelativePaths = archiveCompanionRelativePaths({
77 - allRelativePaths: allCompanionRelativePaths,
78 - target,
79 - });
68 + // Every archive ships every platform's codex-acp, even though its own
69 + // `composio` binary can only ever execute one of them.
70 + //
71 + // A CLI released before 2026-08-18 verifies a downloaded upgrade package
72 + // against all four codex-acp paths and refuses to install one that is
73 + // missing any of them, so an archive carrying only its own binary breaks
74 + // `composio upgrade` for every client already in the field. Narrowing the
75 + // set is worth roughly 651 MB per archive, but it can only ship once no
76 + // supported client still performs that check.
77 + const companionRelativePaths = allCompanionRelativePaths;
78
79 const binaryPath = path.join(BINARIES_DIR, binary);
80 const zipPath = path.join(BINARIES_DIR, `${binary}.zip`);
ts/packages/cli/test/src/scripts/release-artifacts.test.ts
+27
@@ -138,3 +138,30 @@ describe('archiveCompanionRelativePaths', () => {
138 expect(archiveCompanionRelativePaths({ allRelativePaths: selected, target })).toEqual(selected);
139 });
140 });
141 +
142 +/**
143 + * Packaging ships {@link RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS} into every
144 + * archive rather than the narrowed slice, because a CLI released before
145 + * 2026-08-18 verifies an upgrade package against all four codex-acp paths and
146 + * refuses one that is missing any of them.
147 + */
148 +describe('published archive companion coverage', () => {
149 + it.each(RUN_CODEX_ACP_BINARY_TARGETS)(
150 + 'ships the $platform-$arch codex-acp binary in every archive',
151 + codexTarget => {
152 + expect(RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS).toContain(codexTarget.relativePath);
153 + }
154 + );
155 +
156 + it('covers one codex-acp binary per release artifact', () => {
157 + expect(codexAcpRelativePathsIn(RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS)).toHaveLength(
158 + RELEASE_ARTIFACT_TARGETS.length
159 + );
160 + });
161 +
162 + it('keeps the portable assets alongside them', () => {
163 + expect(RUN_COMPANION_ALL_STATIC_ASSET_RELATIVE_PATHS).toEqual(
164 + expect.arrayContaining([...RUN_COMPANION_SHARED_STATIC_ASSET_RELATIVE_PATHS])
165 + );
166 + });
167 +});