continue-custom/core/config
Dallin Romney 9396142fb0
fix: allow correcting API key after entering an invalid one for xAI/Gemini (#11854)
* fix: update existing model API key instead of creating duplicate when re-adding

When a user enters an invalid API key for a provider (e.g. xAI or Gemini)
and later tries to add the same model again with a correct key, the
addModel function previously either skipped (exact match) or created a
duplicate with a numbered suffix. Now it detects models with the same
provider and model name and updates the existing entry in-place, allowing
users to correct their API key by re-adding the model.

Closes #9995

* fix: update existing provider models in setupProviderConfig instead of appending duplicates

When re-entering an API key through the onboarding flow, setupProviderConfig
previously appended new model entries without removing the old ones with
the invalid key. Now it filters out existing models with the same hub slug
before adding the new ones, ensuring the user ends up with a single set
of correctly-configured models.

* fix: narrow addModel update to only change apiKey on existing models

Avoid overwriting user-customized fields (apiBase, completionOptions,
title, etc.) when updating an existing model. Only the apiKey is changed.

* fix: merge API key into existing models instead of replacing or duplicating

Address review feedback: update only the API key on existing model entries
to preserve user-customized fields (roles, options, etc.).

- setupProviderConfig: merge `with` into existing hub-slug models, only
  append entries for slugs not yet in config
- addModel: narrow update to only set apiKey on matching provider+model

* fix: resolve TS2339 error for apiKey on YAML config model union type

The YAML config model type is a union that includes uses-based models
without an apiKey property. Use 'provider' in m guard and cast to any
for the assignment.

* style: fix prettier formatting

* fix: show toast and open config when model already exists, merge API keys in onboarding

When a user tries to add a model that already exists (e.g. after entering
an invalid API key), show a warning toast and open the config file so they
can update the key directly. Also fix setupProviderConfig to merge API
keys into existing models instead of creating duplicates.

Closes #9995

* refactor: remove all :any type annotations from changed code

Use 'uses' in m type guards to narrow the union type instead of
casting to any.

* fix: use modelsByRole instead of non-existent models property on ContinueConfig
2026-03-25 21:32:35 -07:00
..
json fix: move rc loading to separate file, fix core imports issue 2025-07-21 17:31:35 +02:00
markdown support relative path for workspace dirs 2026-01-15 19:00:09 +05:30
profile fix: use config.yaml name for default Local Config profile (#11110) 2026-03-24 13:37:52 -07:00
workspace Remove Gemini 2.0 Flash from defaults and update Claude defaults to 4.6 (#11782) 2026-03-24 17:03:52 -07:00
yaml fix: respect contextLength from YAML model config (#11807) 2026-03-25 12:26:52 -07:00
ConfigHandler.ts fix: "No chat model selected" error on startup (#11672) 2026-03-24 13:05:10 -07:00
ConfigHandler.vitest.ts feat: Respect Org Policies (#7087) 2025-08-11 19:20:07 -07:00
createNewAssistantFile.ts Rename "agent" terminology to "config" throughout the codebase (#8229) 2025-10-13 22:25:42 -07:00
default.ts Rename "agent" terminology to "config" throughout the codebase (#8229) 2025-10-13 22:25:42 -07:00
getWorkspaceContinueRuleDotFiles.ts ruleFile -> sourceFile 2025-09-29 16:05:05 -07:00
load.ts fix: harden system message tools and wire toolOverrides to system message path (#10485) 2026-03-13 12:52:05 -07:00
loadContextProviders.ts fix: unknown context provider file 2025-08-21 18:04:18 -07:00
loadContextProviders.vitest.ts fix: exclude problems and terminal on jetbrains 2025-08-18 18:22:13 -07:00
loadLocalAssistants.ts feat: better settings page and open settings fixes 2025-09-29 15:59:46 -07:00
loadLocalAssistants.vitest.ts fix: HOTFIX local assistant loading (#7354) 2025-08-25 11:52:07 -07:00
migrateSharedConfig.ts feat: remove auto-accept edits setting (#8310) 2025-10-27 16:21:34 -07:00
onboarding.ts fix: allow correcting API key after entering an invalid one for xAI/Gemini (#11854) 2026-03-25 21:32:35 -07:00
ProfileLifecycleManager.ts feat: implement Sentry error tracking with privacy-first anonymization (#6881) 2025-08-14 16:54:21 -07:00
selectedModels.ts feat: remove models property 2025-04-08 19:28:48 -07:00
sharedConfig.ts feat: remove auto-accept edits setting (#8310) 2025-10-27 16:21:34 -07:00
types.ts feat: add useResponsesApi option to opt out of Responses API (#11809) 2026-03-25 16:09:46 -07:00
usesFreeTrialApiKey.ts fix: only show free trial dialog for freetrial secrettype 2025-10-14 19:29:07 +05:30
usesFreeTrialApiKey.vitest.ts fix more lints 2026-01-07 20:40:03 +05:30
util.ts fix: remove add model system message 2025-08-08 11:42:06 +05:30
util.vitest.ts rename to vitest 2025-06-23 18:46:59 +05:30
validation.ts feat: insert prompt into input on click 2025-03-20 14:45:57 -07:00