fix(cli): fallback upgrade release selection to built assets#2797
fix(cli): fallback upgrade release selection to built assets#2797
Conversation
Handle cases where the newest @composio/cli release tag exists before CI has uploaded platform binaries by selecting the latest release that includes required assets for the current platform. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The Please review and fix the vulnerabilities. You can try running: pnpm audit --fix --prodAudit output |
- Replace O(n²) selection sort with O(n) linear scan in fetchLatestReleaseWithRequiredAssets; tracks the best candidate with the required platform asset in a single pass - Remove unreachable onNone branch from fetchLatestRelease; function is only ever called from the onSome branch of githubConfig.TAG Option.match, so the dead code is eliminated and tag is now passed as a parameter instead of re-read from config - Expand upgrade-binary test suite from 3 to 21 tests with synthetic GitHub API response fixtures covering: release filtering (prerelease, draft, non-CLI packages), platform binary selection, O(n) scan correctness, version comparison, tagged release fetching, runtime path detection, and download error handling Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| } | ||
|
|
||
| yield* Effect.logDebug( | ||
| `Resolved latest CLI release with required assets: ${release.tag_name}` |
There was a problem hiding this comment.
Duplicated binary name construction not using new helper
Low Severity
The new getBinaryAssetName helper constructs the binary name string, but downloadBinary still builds the identical string inline at line 230. If the naming convention ever changes, one site could be updated while the other is missed, causing a silent mismatch between the asset-filtering logic and the download logic.


Summary
composio upgradeselect the newest@composio/clirelease that includes the required platform binary assetTest plan
pnpm --filter @composio/cli typecheckcomposio upgradeagainst a release stream where newest tag is missing assets and verify it upgrades to the previous valid releasecomposio upgradewhen already on latest valid release and verify it reports no upgrade neededMade with Cursor