Commit graph

1157 commits

Author SHA1 Message Date
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
Dallin Romney
15ea93dae0
feat: add useResponsesApi option to opt out of Responses API (#11809)
* feat: add `useResponsesApi` option to allow opting out of OpenAI Responses API

Add a `useResponsesApi` config option that, when set to false, forces
o-series and gpt-5 models to use /chat/completions instead of /responses.
This helps users whose organizations are not verified avoid "organization
must be verified" errors related to reasoning summaries and streaming.

The option gates both code paths where the Responses API is selected:
- `canUseOpenAIResponses()` in BaseLLM (native path)
- `shouldUseResponsesEndpoint()` in the OpenAI adapter

Closes #11772
Related: #8209, #7129

* feat: suggest `useResponsesApi: false` in org verification error messages

Update error detection to also catch "organization must be verified to
stream" errors (in addition to reasoning summaries), and update the
error message to suggest adding `useResponsesApi: false` to model config
as a workaround.

* fix: improve org verification error message copy

* fix: add useResponsesApi to LLMOptions in index.d.ts

The actual type definitions used by tsc are in core/index.d.ts, not in
the string template in config/types.ts.

* fix: also check provider name when detecting org verification errors

The error message from OpenAI's API doesn't always contain the word
"openai" — check the provider name from the model config as well.

* feat: detect missing authentication header error and suggest adding apiKey

* fix: handle missing auth error directly in 401 dialog block

The 401 status code handler in StreamError.tsx renders before the
customErrorMessage check, so detect the missing authentication error
inline within the 401 block.

* Revert "fix: handle missing auth error directly in 401 dialog block"

This reverts commit 0053957d2df7c64ddea2279982f5e07e2cee1020.

* style: fix prettier formatting in index.d.ts

* style: revert unrelated prettier reformatting in index.d.ts

* fix: handle undefined providerName in error analysis

* fix: use YAML-style formatting in useResponsesApi suggestion
2026-03-25 16:09:46 -07:00
Dallin Romney
d6259a7304
fix: respect contextLength from YAML model config (#11807)
* fix: respect contextLength from YAML model config

Three fixes for contextLength not being respected:

1. Add contextLength to YAML model schema at the model level (not just
   inside defaultCompletionOptions), matching JSON config behavior
2. Read contextLength from both model-level and defaultCompletionOptions,
   with model-level taking precedence
3. Fix GUI selector fallback using DEFAULT_MAX_TOKENS (4096) instead of
   DEFAULT_CONTEXT_LENGTH (32768)

Closes #4638
Closes #4304

* fix: reduce complexity in modelConfigToBaseLLM

Replace find callbacks with includes() to offset complexity from
contextLength nullish coalescing.

* docs: document contextLength at model level in config.yaml reference

* docs: consistently show contextLength in defaultCompletionOptions for YAML

YAML examples use defaultCompletionOptions.contextLength, JSON examples
use model-level contextLength. Also fixes ollama guide using the wrong
key name (completionOptions -> defaultCompletionOptions).

* refactor: extract env options into helper to reduce complexity

Extract the repetitive env-to-options mapping from modelConfigToBaseLLM
into a separate applyEnvOptions function, bringing complexity well under
the limit of 36.
2026-03-25 12:26:52 -07:00
Dallin Romney
09650d4a4f
fix(gemini): update model catalog for retired/new Gemini models (#11793)
* fix(gemini): update model catalog for retired/new Gemini models

Gemini 1.x models are fully retired (returning 404), gemini-3-pro-preview
was shut down March 9 2026, and new 3.1 series models were missing.

- Add gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, gemini-3.1-flash-image-preview
- Replace gemini-3-pro-preview with gemini-3.1-pro-preview everywhere
- Remove retired Gemini 1.x models (gemini-1.0-pro, gemini-1.5-pro, gemini-1.5-flash, gemini-1.5-flash-8b)
- Remove retired experimental 2.0 image gen models
- Fix default model from retired gemini-pro to gemini-2.5-flash
- Update docs, onboarding config, VSCode schema, GUI model picker, VertexAI provider
- Update isRecommendedAgentModel regex and tests

Fixes #10996, #10998

* fix: address review comments

- Add missing gemini-3.1-flash-image-preview to VS Code schema enum
- Tighten isRecommendedAgentModel regex to match 3-flash-preview (not bare 3-flash)
- Update case-insensitivity tests for new model names

* fix: fix misleading test description and inconsistent doc heading

- Rename test to "Gemini 3.1 Pro and 3 Flash Preview models" to match assertions
- Update chat.mdx heading from "Gemini 3 Pro" to "Gemini 3.1 Pro"
2026-03-24 20:22:47 -07:00
Dallin Romney
ceb3bbbd9f
Remove Gemini 2.0 Flash from defaults and update Claude defaults to 4.6 (#11782)
chore: remove Gemini 2.0 Flash from defaults/UI/docs and update Claude defaults to 4.6

Gemini 2.0 Flash is no longer supported for new Gemini users. Remove it
from the add model form, onboarding defaults, config schema, docs, and
CometAPI supported models list. Replace with Gemini 2.5 Flash where
appropriate. Gemini 2.0 Flash remains in llm-info for existing users.

Update Claude model defaults to 4.6 series (Sonnet 4.6 and Opus 4.6) in
onboarding config, workspace block templates, and documentation examples.
2026-03-24 17:03:52 -07:00
MumuTW
bcd514aa55
fix: use config.yaml name for default Local Config profile (#11110)
* fix(core): pass config name through ConfigResult instead of re-reading file

Rework per reviewer feedback: instead of reading config.yaml separately
in LocalProfileLoader's constructor, propagate the name field through
ConfigResult from the existing config loading pipeline.

Changes:
- Add optional configName to ConfigResult interface
- Populate configName in unroll.ts where AssistantUnrolled is built
- Propagate through loadContinueConfigFromYaml → doLoadConfig
- LocalProfileLoader now reads configName from doLoadConfig result
- Remove duplicate fs.readFileSync + parseConfigYaml from constructor
- Works in WSL and other environments where file paths may differ

Addresses: https://github.com/continuedev/continue/issues/11061

* style: fix prettier formatting in doLoadConfig.ts

---------

Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-03-24 13:37:52 -07:00
Dallin Romney
92c4d19813
fix: "No chat model selected" error on startup (#11672)
* fix: resolve "No chat model selected" error and GUI/core model mismatch

Three fixes for the model selection bugs reported in #11656 and 12+ related issues:

1. Fix loadConfig() init ordering: await isInitialized before checking
   currentProfile, consistent with getSerializedConfig(). Prevents
   returning config: undefined during initialization race.

2. Avoid full config reload on model selection: The config/updateSelectedModel
   handler now updates the model in the cached config in-place instead of
   doing a full reloadConfig(). This eliminates the window where
   selectedModelByRole.chat is null during reload, and prevents the
   configUpdate from core overwriting the GUI's optimistic selection.

3. Guard against undefined config in GUI: handleConfigUpdate now also
   checks !configResult.config alongside configLoadInterrupted, preventing
   EMPTY_CONFIG (with chat: null) from being applied.

* fix: resolve "No chat model selected" error on startup

Two fixes for the "No chat model selected" error reported in #11656 and
12+ related issues across all providers:

1. Fix loadConfig() init ordering (ConfigHandler.ts): Move
   `await this.isInitialized` before the `!this.currentProfile` check,
   matching the pattern already used in getSerializedConfig(). Without
   this, loadConfig() called during initialization returns
   config: undefined because currentProfile hasn't been set yet.

2. Guard against undefined config in GUI (ParallelListeners.tsx):
   handleConfigUpdate now also checks `!configResult.config` alongside
   configLoadInterrupted, preventing EMPTY_CONFIG (with
   selectedModelByRole.chat: null) from being applied.

* fix: provide valid mock config to fix GUI test failures

The added `!configResult.config` guard in ParallelListeners caused tests
to bail early since MockIdeMessenger returned `config: undefined`.
2026-03-24 13:05:10 -07:00
shanevcantwell
df8ef7ad56
fix: harden system message tools and wire toolOverrides to system message path (#10485)
fix: harden system message tools instructions and wire toolOverrides to system message path

The system message tools path (used when models don't support native tool
calling) had two issues:

1. Weak format instructions - the prefix/suffix used vague prose that local
   models often ignored, reverting to XML or JSON tool call formats from
   their training priors. Replaced with explicit numbered rules that
   prohibit alternative formats.

2. toolOverrides silently ignored - applyToolOverrides() existed and ran on
   the native tools path (in BaseLLM.streamChat), but was never called on
   the system message path. Config YAML toolOverrides for disabled and
   description had no effect when tools were injected via system message.

Fixed by:
- Strengthening systemMessagePrefix/Suffix in toolCodeblocks framework
- Adding toolOverrides to ModelDescription interface and serialization
- Calling applyToolOverrides() in streamNormalInput before both paths

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:52:05 -07:00
Aditya Mitra
971da8b108
fix: load config in project with no dirs (#10737) 2026-03-13 12:14:22 -07:00
shanevcantwell
4b756d32bc
fix: pass pre-read content to bypass fs.existsSync for WSL agent configs (#10451)
When VS Code runs on Windows host with a WSL remote workspace, selecting
an agent config from .continue/agents/ fails because localPathOrUriToPath
cannot resolve the vscode-remote:// URI to a local path, causing
fs.existsSync to return false and falling through to the deprecated JSON
config loader.

The fix passes pre-read content (already available in
overrideAssistantFile.content) through the PackageIdentifier, and checks
for it before the fs.existsSync gate. This reuses the content bypass
added to RegistryClient in PR #9739.

Fixes #10450

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:21:47 -07:00
Dallin Romney
a7a5351b9c
feat: limited MCP App support (#10132)
* feat: MCP apps part 1

* feat: MCP app support part 3

* chore: cleanup PR

* chore: clean up mcp ui app types

* fix: address cubic feedback
2026-02-05 19:07:44 -08:00
Dallin Romney
f14a2ff90a
Merge pull request #9716 from sarthakNITT/#9548
fix: improve error messages for invalid rule files
2026-02-03 15:46:05 -08:00
Dallin Romney
5a5f5f8908 fix: don't crash config loading for one block failure 2026-02-03 00:15:32 -08:00
shanevcantwell
d80845c403
feat: add tool prompt override support in .continuerc.json (#9314)
* feat: add tool prompt overrides support in YAML model config

Adds per-model tool prompt overrides under chatOptions in YAML config:

```yaml
models:
  - name: my-model
    chatOptions:
      toolPromptOverrides:
        run_terminal_command:
          description: "Custom description"
        view_diff:
          disabled: true
```

This replaces the JSON-only implementation with YAML-only support as
requested by maintainers. The JSON implementation is preserved on the
`feature/tool-prompt-overrides-json` branch for reference.

Changes:
- Add toolOverrideSchema to chatOptionsSchema (packages/config-yaml)
- Add ToolOverride interface and toolPromptOverrides to LLMOptions (core)
- Store and apply overrides in BaseLLM.streamChat()
- Add applyToolOverrides utility with comprehensive tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(cli): add tool prompt overrides support for CLI parity

Apply toolPromptOverrides from YAML model config in CLI,
ensuring feature parity with VS Code extension.

- Add applyChatCompletionToolOverrides helper for CLI tool format
- Apply overrides in streamChatResponse before LLM calls
- Support description changes and disabling tools
- Add unit tests for override logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: package lock update

* ci: retrigger after hub 502

* refactor: rename toolPromptOverrides to toolOverrides

- Rename property across core, config-yaml, and CLI
- Consolidate ToolOverride type to extend ToolOverrideConfig from
  config-yaml instead of duplicating 7 fields
- Inline record-to-array conversion to match file patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: retrigger CI (clean run)

* chore: revert gui package-lock to main

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-02-02 21:55:21 -08:00
shanevcantwell
38aae62e56
fix: pass pre-read content to RegistryClient for WSL compatibility (#9739)
Fixes #6242, #7810

When Windows VS Code connects to WSL, workspace files are accessed via
vscode-remote:// URIs. Previously, getAllDotContinueDefinitionFiles()
correctly read content via ide.readFile(), but loadYaml.ts discarded
the content and passed only the URI path to RegistryClient, which then
tried to re-read using fs.readFileSync() - failing for remote URIs.

Changes:
- Add optional content field to FileIdentifier (non-breaking)
- RegistryClient.getContent() returns pre-read content when present
- loadYaml.ts passes content along with file identifiers

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:19:25 -08:00
sarthakNITT
ad1578e073 fix: improve error messages for invalid rule files 2026-01-21 02:17:47 +05:30
uinstinct
f5c345254d support relative path for workspace dirs 2026-01-15 19:00:09 +05:30
uinstinct
b9bcd33cce add supporting files for skill tool 2026-01-15 13:05:03 +05:30
uinstinct
85759451cb load skills from .claude directory
also put skills inside skills/ directory
2026-01-15 12:42:45 +05:30
uinstinct
2ecccb0fa5 Merge branch 'main' into agent-skills 2026-01-15 11:39:22 +05:30
Nate Sesti
4110496b22
Merge pull request #9128 from uinstinct/sub-agents
feat: subagents
2026-01-14 20:38:00 -08:00
RomneyDa
529d50a9be Filter out .md files when loading agent configs
During config loading in core, if any non-YAML files are in .continue/agents
or .continue/assistants directories, it tries to load them as configs. This
change filters out .md files by explicitly setting fileExtType to 'yaml' when
loading agent and assistant config profiles.

The getAllDotContinueDefinitionFiles function already supports filtering by
file extension type, but it wasn't being used in ConfigHandler. This ensures
only .yaml and .yml files are loaded as config profiles, preventing errors
when markdown documentation files exist in the agents/assistants directories.

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-01-14 22:16:59 +00:00
uinstinct
a48bb94c09 fix more lints 2026-01-07 20:40:03 +05:30
uinstinct
c366fa89ab fix lint 2026-01-07 20:24:42 +05:30
uinstinct
27ac8cc23b include model roles subagent 2026-01-07 18:24:28 +05:30
uinstinct
e0753f5be2 simplify tool frontmatter validation 2026-01-06 18:16:45 +05:30
uinstinct
cef4b8ded2 get config dependent tool definitions async 2026-01-06 17:30:19 +05:30
uinstinct
d7543312c2 prevent loading in system message 2026-01-06 17:22:59 +05:30
uinstinct
b6eddec2f4 add read skill tool 2025-12-30 12:51:16 +05:30
uinstinct
207469af85 read and inject skills to system message 2025-12-29 20:04:50 +05:30
uinstinct
08465a6400 add subagent in model roles 2025-12-19 21:27:36 +05:30
Dallin Romney
7b036c66a2 chore: sonnet 4.5 preference 2025-12-02 12:35:27 -08:00
Dallin Romney
886c0a4741 merge main 2025-12-02 12:25:02 -08:00
Aditya Mitra
fc5606cc3a
feat: select org profile on sign in (#8859)
* feat: select org profile on sign in

* reset inside cascade init

* reset only when personl
2025-11-27 01:44:55 -08:00
Dallin Romney
ff335487aa merge: main 2025-11-25 20:39:59 -08:00
uinstinct
ba64c1a2dc refactor duplicate condition 2025-11-25 09:19:40 +05:30
uinstinct
450b6470b3 Merge branch 'main' into rule-add-dialog 2025-11-25 09:10:44 +05:30
Dallin Romney
8e888f1ef3
Merge pull request #8809 from continuedev/dallin/local-secret-failures
fix: HOTFIX make errors fetching secrets nonblocking for local configs
2025-11-21 14:46:58 -08:00
Dallin Romney
d8021f5c5a fix: notify config listeners when no config available
Otherwise GUI gets out of sync with core
2025-11-20 00:55:18 -08:00
Dallin Romney
d9f577d9ed fix: errors fetching secrets are nonblocking for local configs 2025-11-19 18:32:29 -08:00
Dallin Romney
05cce29d20
fix: remove dead isTelemetryEnabled code for jetbrains (#8799) 2025-11-19 15:27:29 -08:00
uinstinct
b7996a509d Merge branch 'main' into rule-add-dialog 2025-11-19 16:35:16 +05:30
uinstinct
0e5fce911f feat: allow renaming rule before creation 2025-11-19 16:34:09 +05:30
Dallin Romney
d8be841d11 Merge branch 'main' of https://github.com/continuedev/continue into dallin/error-untemplated-mcp-secrets 2025-11-18 16:51:31 -08:00
lixiaoyang1992
71e22ab977 fix: update global directory path conversion to use localPathToUri 2025-11-11 14:18:14 +08:00
Dallin Romney
2688fc9f6d fix: CLI warnings/errors for unresolved MCP secrets 2025-11-09 19:54:36 -08:00
Nate Sesti
5519f27b6c
Add x-continue-unique-id header to LLM requests and normalize header casing (#8589)
* Add x-continue-unique-id header to LLM requests and normalize header casing

* fix: tests

* fix: tests
2025-11-04 12:05:37 -08:00
Aditya Mitra
1c7a816657
feat: remove auto-accept edits setting (#8310)
* feat: automatically accept file edit tools

* remove edit tools from tool policies ui

* remove checking for edit tool in tool policy section

* remove hiding of edit policies

* remove auto accept edit tool diffs

* fix tests

* re-run tests

* re-run tests

---------

Co-authored-by: Nate <sestinj@gmail.com>
2025-10-27 16:21:34 -07:00
Aditya Mitra
cc2a6c3f16
fix: show md rules and prompts in respective sections (#8178)
* fix: show md rules and prompts in respective sections

* Update core/config/markdown/loadMarkdownRules.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Revert "Update core/config/markdown/loadMarkdownRules.ts"

This reverts commit cf0fabaf71eaf7f8c9456eb737dcb08c365c04c0.

* Revert "fix: show md rules and prompts in respective sections"

This reverts commit b19726baf78d35e9cf4c2fb5c1549127af66f868.

* fix: skip invokable prompt files

also read .md files from prompt folders

* remove debug statements

* simplify if block

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-10-27 15:25:03 -07:00
Dallin Romney
7a5731eb23 feat: sonnet 4 5 updates and 3 5 deprecation 2025-10-18 01:33:39 -07:00