Skip to content

fix(providers): auto-select single LiteLLM integration and preserve existing on update#246

Open
alezander86 wants to merge 1 commit intocodemie-ai:mainfrom
alezander86:EPMCDME-11736
Open

fix(providers): auto-select single LiteLLM integration and preserve existing on update#246
alezander86 wants to merge 1 commit intocodemie-ai:mainfrom
alezander86:EPMCDME-11736

Conversation

@alezander86
Copy link
Copy Markdown

Summary

Fixes EPMCDME-11736: LiteLLM project integration was not applied automatically in CLI when exactly one integration was configured. Users were forced to manually select it each time, and previously saved integrations were silently cleared on profile update failures.

Changes

  • Auto-select single integration: When exactly one LiteLLM integration is found for the selected project, it is automatically applied — no prompt shown
  • Preserve integration on update: When updating an existing profile (isUpdate=true) and 0 integrations are returned (due to fetch failure or transient API issue), the existing codeMieIntegration from the active config is preserved and reused
  • Multiple integrations: Prompt is still shown when multiple integrations are available (unchanged behavior)
  • Test fix: Updated paths.js mock in claude.plugin.statusline.test.ts to include getCodemieHome/getCodemiePath exports required by ConfigLoader static initializer

Impact

Before: User always sees "Select LiteLLM integration (Optional)" prompt defaulting to "None", even when only one integration exists. A previously saved integration could be cleared after a failed fetch on subsequent codemie setup runs.

After: Single integration is auto-selected with a confirmation message ✓ Auto-selected LiteLLM integration: <alias>. On update with fetch failure, existing integration is reused with ℹ️ Reusing saved LiteLLM integration: <alias>.

Checklist

  • Self-reviewed
  • Manual testing performed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

…xisting on update

- Auto-select the integration when exactly one is configured for the project,
  eliminating the unnecessary manual selection prompt
- Accept isUpdate parameter in getCredentials() to detect profile update flow
- Preserve existing codeMieIntegration from active config when 0 integrations
  are returned during a profile update (fetch failure or transient API issue)
- Keep prompt only when multiple integrations are available
- Fix paths.js mock in statusline test to include getCodemieHome/getCodemiePath
  needed by ConfigLoader static initializer

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants