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, 18:30 UTC
fix(cli): preserve symlinked shell configs during install (#3923)
## Summary `composio install` uses a temporary file and rename so shell config updates are atomic. When the config path is a symlink, that rename replaces the symlink itself. This breaks setups that use tools such as GNU Stow to manage and sync dotfiles across machines. Fixes #3922 ## Changes - Resolve valid symlink chains before choosing the temporary file and rename target. - Keep regular shell config files on the existing write path. - Add a regression test using a relative `.zshrc` symlink. ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? - `mise exec -- pnpm --filter @composio/cli exec vitest run test/src/commands/install.cmd.test.ts` — 13 passed - `mise exec -- pnpm --filter @composio/cli typecheck` - ESLint and Prettier on the two changed files ## Screenshots (if applicable) Not applicable. ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [x] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages ## Additional context No changeset is needed because `@composio/cli` is ignored by the repository's Changesets configuration. The current `next` branch is missing the `#ssrf_guard` alias in the CLI Vitest config. I added that alias locally to run the focused test, then removed it before committing this patch. --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev>