Commit graph

6283 commits

Author SHA1 Message Date
Dallin Romney
e1d37af825 feat: add Inception Labs mercury-2 model support
Register mercury-2 (128k context, tool-calling) and mercury-edit-2 in
llm-info, add Inception Labs provider to the GUI Add Chat Model form,
and flag mercury-2 as tool-capable in PROVIDER_TOOL_SUPPORT.
2026-04-16 18:12:01 -07:00
Dallin Romney
294ba934db
fix: redirect Winston logger to stderr to prevent IPC stream corruption + fix binary tests (#11914) 2026-03-27 14:03:06 -07:00
Nate Sesti
a3dbeb346b
Merge pull request #11935 from continuedev/configs-support 2026-03-27 14:02:49 -07:00
Dallin Romney
8747c5f528 fix: use Promise.all instead of Promise.allSettled to propagate errors 2026-03-27 13:49:10 -07:00
Matt Van Horn
ae32a1b865
feat: filter session history by workspace directory (#11813)
* feat: filter session history by workspace directory

Add optional workspaceDirectory field to ListHistoryOptions so callers
can scope session lists to a specific workspace. Filtering is
case-insensitive and applied before pagination. Omitting the field
preserves the existing behavior of returning all sessions.

Fixes #9936

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

* fix: address bot review - typeof guard and test coverage

- Use typeof check instead of truthiness for workspaceDirectory to
  handle malformed session metadata safely
- Rename test to match actual coverage (limit only)
- Add separate test for combined limit+offset with workspace filter

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 13:41:29 -07:00
dependabot[bot]
8c3f321c51
chore(deps-dev): bump brace-expansion from 1.1.12 to 1.1.13 in /core (#11931)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.13.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.13)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 13:38:06 -07:00
dependabot[bot]
0044c9c682
chore(deps): bump handlebars from 4.7.8 to 4.7.9 in /core (#11911)
Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.8 to 4.7.9.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.9/release-notes.md)
- [Commits](https://github.com/handlebars-lang/handlebars.js/compare/v4.7.8...v4.7.9)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-version: 4.7.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 13:35:16 -07:00
Dallin Romney
9080d5b5b4 refactor: use Promise.allSettled for parallel config directory loading 2026-03-27 13:02:58 -07:00
Dallin Romney
890fe91d6d feat: add .continue/configs as a third config directory
Add support for loading local profiles from .continue/configs/ alongside
the existing .continue/agents/ and .continue/assistants/ directories.
2026-03-27 12:59:32 -07:00
Dallin Romney
fd7ade8f3f
fix: ensure config.yaml exists and is populated when accessed (#11915)
* fix: ensure config.yaml exists and is populated when accessed

- Opening a config profile (gear icon) now creates config.yaml with
  defaults if the file is missing, matching startup behavior
- Empty config.yaml files are detected and populated with default config
  instead of causing parse errors

* refactor: improve readability of config existence check
2026-03-26 18:19:54 -07:00
Dallin Romney
16a540c337
fix: remove Ollama template-based tool support gate (#11905)
* fix: let explicit capabilities.tools override Ollama template tool detection

The Ollama provider checks the model template from /api/show for a
`.Tools` placeholder to decide whether to pass tools to the API. For
newer models (e.g. qwen3.5) whose templates may not yet include
`.Tools`, this silently strips tools from the request — even when the
user explicitly sets `capabilities: tools: true` in config.yaml.

Use nullish coalescing so an explicit capabilities.tools setting always
wins, with the template heuristic as a fallback.

* remove verbose comments

* remove templateSupportsTools check; trust upstream tool support detection

* fix: remove extra blank line to pass prettier check
2026-03-26 16:52:20 -07:00
Dallin Romney
c71acb8e4b
fix: resolve critical and high security vulnerabilities (#11848)
* fix: resolve critical and high security vulnerabilities across packages

Bump vulnerable dependencies and remove unused `request` package to
address ~351 of ~394 npm audit vulnerabilities reported by GitHub.

* fix: handle nullable textContent from @mozilla/readability v0.6.0

readability.textContent can be undefined in v0.6.0, add nullish
coalescing to satisfy ArticleComponent.body type constraint.
2026-03-26 10:46:44 -07:00
1bcMax
becda53a17
feat: add ClawRouter as a provider for cost-optimized model routing (#11751)
* feat: add ClawRouter as a provider for cost-optimized model routing

ClawRouter is an open-source LLM router that automatically selects the
cheapest capable model for each request based on prompt complexity,
providing 78-96% cost savings on blended inference costs.

Changes:
- Add ClawRouterApi class extending OpenAI adapter
- Add 'clawrouter' provider to the type system
- Add ClawRouter models (auto, free, eco)
- Add ClawRouter provider config with UI setup
- Add ClawRouter logo
- Add documentation (clawrouter.mdx)

Closes #10843

* docs: enhance ClawRouter documentation

- Add ClawRouter to providers overview
- Expand documentation with:
  - Model capabilities configuration
  - Multiple roles setup
  - Troubleshooting section
  - Cost monitoring
  - Comparison with OpenRouter
  - Complexity dimensions explanation

* feat: add ClawRouter to core/llm/llms

- Add ClawRouter.ts extending OpenAI base class
- Register ClawRouter in llms/index.ts

* feat: add User-Agent headers for ClawRouter integration tracking

- Add 'User-Agent: Continue/IDE' header to identify Continue requests
- Add 'X-Continue-Provider: clawrouter' header for routing analytics
- Enhanced documentation with features list

This helps ClawRouter optimize routing decisions based on integration
source and enables better analytics for the Continue community.

* feat: complete ClawRouter integration with full provider support

- Add clawrouter to PROVIDER_HANDLES_TEMPLATING (autodetect.ts)
- Add clawrouter to PROVIDER_SUPPORTS_IMAGES (autodetect.ts)
- Add clawrouter tool support function (toolSupport.ts)
- Add supportsReasoningField and supportsReasoningDetailsField
- Add promptTemplates with osModelsEditPrompt
- Match OpenRouter implementation patterns

* feat: add ClawRouter to VS Code schema, docs nav, and AI SDK

- Add clawrouter to VS Code config_schema.json provider enum
- Add ClawRouter description in config_schema.json
- Add clawrouter to docs.json navigation (top-level providers)
- Add clawrouter to AI SDK PROVIDER_MAP

* docs: add wallet setup and x402 payment documentation

- Add Wallet & Payment Setup section to clawrouter.mdx
- Document payment tiers (free/eco/auto)
- Add wallet funding instructions (Solana/Base USDC)
- Add spend control configuration
- Update VS Code schema description with wallet info
- Update provider longDescription with payment options

* feat: add premium tier and enhanced ClawRouter features

- Add blockrun/premium routing profile (mission-critical tasks)
- Add dual-chain wallet support docs (Base EVM + Solana)
- Add model exclusion documentation
- Update routing profiles table with savings percentages
- Update comparison table with auth/payment differences
- Total 44+ models, 4 routing tiers

* test: add ClawRouter unit tests

- Add ClawRouter.vitest.ts (core/llm/llms)
  - Provider name verification
  - Default options validation
  - Reasoning field support
  - User-Agent header verification
  - Routing profiles acceptance

- Add ClawRouter.test.ts (openai-adapters)
  - Default apiBase
  - Custom apiBase override
  - Continue headers
  - OpenAI standard headers

- Add clawrouter tests to toolSupport.test.ts
  - blockrun/* routing profiles
  - Tool-supporting model patterns

* docs: add routing profile switching and enhanced error handling docs

- Add 'Switching Between Routing Profiles' section with full examples
- Add /model command tip for quick switching
- Add 'Error Handling' section comparing Continue vs ClawRouter
- Document automatic error recovery (429, 402, 500+, timeout)
- Add response header documentation for diagnostics
- Add AI-powered doctor command for troubleshooting

* fix: address PR review feedback - move docs to /more, resize logo, add provider constants, fix docs example

* fix: replace clawrouter logo with higher-res brand kit version (128x128)
2026-03-26 10:26:12 -07:00
Dallin Romney
f7907fff08
fix: vLLM provider should respect user-configured contextLength and model (#11868)
* fix: respect user-configured maxTokens and contextLength for autocomplete

Two fixes for autocomplete's maxTokens not being respected (#6003):

1. vLLM provider: _setupCompletionOptions() unconditionally overwrote
   the user's contextLength and model with server-reported values. Now
   user-explicit settings take priority over auto-detected values.

2. Autocomplete pipeline: renderPromptWithTokenLimit() returned
   completionOptions without maxTokens, relying on an implicit merge
   deeper in the call stack. Now maxTokens is explicitly included in
   the returned completionOptions so the value flows through to the
   API request reliably.

* remove verbose comments from Vllm provider

* style: fix prettier formatting

* fix: only set maxTokens when llm provides a value

* remove defensive-only maxTokens pass-through from autocomplete pipeline
2026-03-25 22:21:11 -07:00
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
3a997fe10c
fix: preserve tool calls when thinking models return no text content (#11866)
* fix: preserve tool calls when Qwen3-Coder returns thinking content without text

Two bugs caused Qwen3-Coder (and similar thinking models) to silently
drop tool calls:

1. Ollama: When the model produces thinking content and tool calls but
   no text content, the early return in convertChatMessage only yielded
   the thinking message, discarding tool calls entirely.

2. OpenAI/vLLM: fromChatCompletionChunk used an if/else chain where
   content was checked before tool_calls, so any chunk with both fields
   would lose its tool calls.

Fixes #8744

* revert: remove speculative openaiTypeConverters change

The vLLM "list index out of range" error is server-side (Python), not
fixable by reordering client-side chunk parsing. Keep only the Ollama
fix which addresses the confirmed bug.
2026-03-25 21:11:14 -07:00
Dallin Romney
41b3b65a5c
fix: fix listener leaks and redundant file read in autocomplete (#11863)
- statusBar.ts: onDidChangeConfiguration was registered on every
  setupStatusBar() call, accumulating unbounded listeners on each
  config change or autocomplete toggle
- NextEditWindowManager: 4 event listeners in setupListeners() were
  not added to this.disposables, surviving dispose() and accumulating
  across Next Edit toggle cycles
- constructPrefixSuffix: accept pre-loaded file contents instead of
  calling ide.readFile(), eliminating a redundant file read per
  completion (the caller already has the contents loaded)
2026-03-25 21:04:20 -07:00
Dallin Romney
a33cd37041
fix(openrouter): Gemini 3 tool support, suffix stripping, thought_signature, autocomplete endpoint (#11856)
* fix: multiple OpenRouter provider improvements

- Add google/gemini-3 to tool support prefixes so Gemini 3 models are
  detected as supporting tools via OpenRouter (#8980)
- Strip :free/:extended/:beta suffixes before matching in OpenRouter
  tool support, fixing models like meta-llama/llama-3.2-3b-instruct:free
  not being recognized (#11095)
- Add thought_signature fallback for Gemini models via OpenRouter to
  prevent 400 errors when tool calling (#8980)
- Fix autocomplete/next-edit forcing legacy /completions endpoint on
  OpenRouter, which only supports /chat/completions (#3648)
- Enrich OpenRouter error messages with provider metadata details
  instead of showing generic "Provider returned error" (#11262, #11577)

* fix: remove error enrichment, add TODO for OpenRouter error extraction

* chore: clean up verbose comments and add OpenRouter tool support tests

* style: fix prettier formatting in toolSupport.ts
2026-03-25 20:31:53 -07:00
Dallin Romney
7463037f4a
fix: remove inline backtick fences from tool instruction prose (#11869)
fix: remove inline backtick fences from tool instruction prose (#11674)

The system prompt prefix and suffix contained raw triple-backtick
sequences in prose text, producing an odd number of fence markers.
This made it ambiguous for models to distinguish actual tool-call
code fences from inline mentions of the syntax. Remove inline fence
syntax from prose, relying on the adjacent examples to convey the
format.
2026-03-25 18:56:15 -07:00
Dallin Romney
ff89a88299
fix: coerce MCP tool args to match schema string types (#11852)
* fix: coerce MCP tool args to match schema string types

When tool call arguments are parsed via JSON.parse(), string-typed
parameters containing valid JSON (e.g. file content for .json files)
get deeply parsed into objects. Built-in tools handle this via
getStringArg(), but MCP tools with dynamic schemas had no equivalent
fix, causing write_file and similar tools to receive objects instead
of strings.

Add coerceArgsToSchema() that checks the tool's inputSchema and
re-stringifies any values that should be strings before passing
args to the MCP client.

Fixes #8510

* fix: narrow coercion to only objects/arrays, not numbers/booleans

Only re-stringify values that are objects or arrays (the actual
deep-parsing issue). Numbers and booleans passed to a string-typed
parameter are left as-is so they surface as type errors rather than
being silently converted.
2026-03-25 16:39:01 -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
8b9f4ab625
fix: lazy-load Ollama /api/show to reduce unnecessary requests (#11836)
* fix: lazy-load Ollama /api/show to reduce unnecessary requests

Move the /api/show call from the Ollama constructor to a lazy
ensureModelInfo() method that is only invoked on first actual model
usage (_streamComplete, _streamChat, _streamFim). The promise is
cached so subsequent calls reuse the same result.

This fixes the issue where AUTODETECT with many models caused hundreds
of /api/show requests on every config reload, since each model
instantiation fired a request in the constructor.

Additional fixes:
- Null-check regex match result to prevent runtime errors
- Use const instead of let for immutable bindings
- Don't override explicitly configured contextLength with /api/show value
- Silently ignore unparseable stop parameters
- Return empty array from listModels() on failure instead of throwing

Closes #8765

* revert silent error handling, remove verbose comments
2026-03-25 15:37:03 -07:00
Dallin Romney
1dca5bd116
fix(gemini): merge consecutive same-role messages to fix ordering errors (#11805)
* fix(gemini): merge consecutive same-role messages to fix ordering errors

Gemini API requires strict role alternation between "user" and "model".
When multiple tool responses (mapped to "user" role) appear consecutively,
or when consecutive assistant messages exist, the alternation breaks causing:
- "function call turn comes immediately after a user turn or after a function response turn"
- "number of function response parts is equal to the number of function call parts"

Fix: merge consecutive messages with the same role by combining their parts
arrays, applied as a post-processing step after message conversion in both
the core Gemini LLM and the openai-adapters Gemini API.

Fixes #11047, fixes #9562

* chore: remove verbose comments

* refactor: deduplicate mergeConsecutiveGeminiMessages into openai-adapters

Export from openai-adapters gemini-types and import in core, removing
the duplicate private method from both Gemini classes.

* fix: resolve TS2345 by removing explicit nullable type annotation on contents

* fix: keep mergeConsecutiveGeminiMessages in each package's own gemini-types

The core test suite mocks @continuedev/openai-adapters entirely, which
replaces the imported function with a no-op returning undefined. Define
the function in both packages' gemini-types to avoid this coupling.
2026-03-25 12:27:06 -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
3fdf35e0c1
fix(moonshot): add reasoning_content field support for Kimi models (#11806)
Kimi-K2.5 returns 400 errors when thinking is enabled because
reasoning_content is missing from assistant tool call messages.
This adds the supportsReasoningContentField flag (as a getter gated
on kimi-* models) matching the existing DeepSeek fix, so legacy
moonshot-v1-* models are unaffected.

Fixes #11600
Fixes #11711
2026-03-25 10:29:40 -07:00
Dallin Romney
f7437593fd
fix(llama.cpp): include model name in completion request body (#11803)
The llama.cpp provider was not sending the `model` field in the
request body, causing 400 errors ("model name is missing from the
request") when using llama-server's model router feature.

Fixes #11244
Fixes #10846
2026-03-25 10:29:26 -07:00
shanevcantwell
c79e6489a7
fix: restrict terminal childProcess.spawn to local-only environments (#10538)
fix: restrict childProcess.spawn to local-only environments

childProcess.spawn executes on the extension host machine. With
extensionKind: ["ui", "workspace"], the extension host almost always
runs locally. For any remote workspace (SSH, WSL, Dev Container,
Codespaces, tunnel), spawning locally either runs commands on the wrong
machine or fails with ENOENT when the local shell doesn't exist in the
extension host context.

Replace ENABLED_FOR_REMOTES (which listed all remote types) with
LOCAL_ONLY (just "" and "local"). All remote types now fall through to
ide.runCommand() which delegates to VS Code's integrated terminal and
executes in the correct remote environment.

The isWindowsHostWithRemote guard is removed as it is now redundant —
the platform-agnostic check handles all cases.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 20:33:04 -07:00
Dallin Romney
cf48e74084
feat(bedrock): support Bedrock API key authentication (#11798)
Add bearer token authentication for Bedrock API keys as an alternative
to IAM credentials, enabling users to authenticate without exposing
AWS access keys.

Closes #6645
2026-03-24 20:27:39 -07:00
Dallin Romney
1aac783c49
fix: handle thinking/assistant messages at end of chat history (#11791)
* fix: handle thinking/assistant messages at end of chat history

extractToolSequence threw "no user/tool message found" when the last
message was thinking or assistant (common with reasoning models when
assistant content is empty after thinking and gets filtered out).

* fix: guard against non-string NO_PROXY env value in getEnvNoProxyPatterns

Add typeof check before calling .split() on the NO_PROXY environment
variable to prevent "envValue.split is not a function" errors when the
value is not a string.
2026-03-24 20:26:51 -07:00
Dallin Romney
afa6bab1ba
fix: expand tool support to reduce 'Invalid tool name' errors (#11792)
fix: expand tool support to prevent "Invalid tool name" errors

Models not recognized in PROVIDER_TOOL_SUPPORT fall back to a text-based
tool calling format injected into the system message. When models don't
follow this format exactly, the parser throws "Invalid tool name". This
was affecting many models that actually support native tool calling but
weren't listed.

Changes:
- Azure: add gpt-5, gpt-4.1, o1, o4 (was only gpt-4, o3)
- Ollama: add glm-4/5, deepseek, dolphin families
- DeepSeek provider: add deepseek-coder (was only chat/reasoner)
- OpenRouter: add deepseek/deepseek-v3, deepseek/deepseek-coder

Fixes #10678, #11594, #11431, #11218, #10900, #10272, #10156, #10143,
#10050, #9891, #9839
2026-03-24 20:23:07 -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
02525d119b
fix(openai): fix Responses API 400 errors for reasoning, tool calls, and ID handling (#11785)
* fix(openai): fix Responses API 400 errors for reasoning, tool calls, and ID handling

Three categories of OpenAI Responses API 400 errors are addressed:

1. "No tool call found for function call output with call_id" — function_call
   items are now always emitted when tool calls exist (even without fc_ IDs),
   and orphaned function_call_output items are removed in post-processing.

2. "Item provided without its required 'reasoning' item" — reasoning items
   without encrypted_content (e.g. from saved sessions) are removed, and the
   id is stripped from subsequent function_call items so the API doesn't
   reject them for referencing a missing reasoning item. Trailing reasoning
   items not followed by a valid successor are also removed.

3. "Expected an ID that begins with 'fc'" — responsesOutputItemIds (which
   accumulates both msg_ and fc_ IDs during streaming) is now filtered to
   only fc_-prefixed IDs for function_call items, preventing msg_ IDs from
   being used where fc_ IDs are required.

Co-authored-by: Luna <20552038+xxsLuna@users.noreply.github.com>
Co-authored-by: Robert Benko <10097827+Quazistax@users.noreply.github.com>
Co-authored-by: pallaprolus <162944051+pallaprolus@users.noreply.github.com>

* fix(openai-adapters): don't duplicate tool call args in Vercel stream converter

The tool-call event was re-emitting the full arguments that were already
streamed via tool-input-start/delta, causing JSON.parse failures in
consumers. Now tool-call only emits extra_content when a Gemini
thoughtSignature is present, and returns null otherwise.

---------

Co-authored-by: Luna <20552038+xxsLuna@users.noreply.github.com>
Co-authored-by: Robert Benko <10097827+Quazistax@users.noreply.github.com>
Co-authored-by: pallaprolus <162944051+pallaprolus@users.noreply.github.com>
2026-03-24 18:55:06 -07:00
Aditya Mitra
6e0045e204
feat: support gemini through ai sdk (#10671)
* add support for gemini in ai sdk

* support thought signature conversion

* capture extra_content in assistasnt tool calls

* fix: update vercelStreamConverter tests for tool-call chunk emission

The tool-call case now returns a chunk (for Gemini thoughtSignature
support) instead of null, so tests need to expect the new behavior.

---------

Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-03-24 17:14:19 -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
Rezky Hamid
2874981435
feat(autocomplete): Add Qwen multi-file FIM template for repository-level autocompletion (#10612)
- Add qwenMultifileFimTemplate supporting repository-level context
- Uses <|repo_name|>, <|file_sep|> tokens for multi-file context
- Falls back to basic FIM when no snippets provided
- Resolves issue #3589
2026-03-24 13:50:22 -07:00
Joaquin Hui
3c12dab7aa
fix: Ollama MCP tool calling for Mistral and Gemma3 models (#11523)
* fix: Ollama MCP tool calling for Mistral and Gemma3 models (#9249)

Fix two issues with Ollama tool calling:

1. Mistral/Ministral: reorder messages so system messages never follow
   tool messages (causes "Unexpected role 'system' after role 'tool'")

2. Gemma3: strip unsupported fields (index, id, type) from tool_calls
   when converting assistant messages to Ollama format (causes "unknown
   variant 'index'")

Also forward assistant toolCalls to Ollama's tool_calls format for
proper multi-turn tool calling conversations.

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

* fix: resolve CI failures in prettier and jest module resolution

Remove .js extensions from jest.mock paths so the moduleNameMapper
resolves ollamaHelper and url modules correctly. Apply prettier
formatting to both changed files.

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

* fix: remove relative-path jest.mock calls that break ESM resolution

The jest ESM config resolves relative mock paths from the setup file
context, not the test file, causing 'Cannot find module' errors.
These mocks are unnecessary since the test bypasses the constructor
via Object.create() and only tests pure transformation methods.

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

* fix: guard unprotected JSON.parse calls in Ollama.ts

Wrap JSON.parse of tool-call arguments in _convertToOllamaMessage and
pull-progress lines in installModel with try/catch to prevent unhandled
exceptions from aborting the request flow.

Addresses Cubic review feedback on PR #11523.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>

* fix: add missing type cast through unknown for ToolCall arguments

TypeScript rejects a direct cast from string to JSONSchema7Object.
Cast through unknown first to satisfy the type checker.

Signed-off-by: Joaquin <joaquin@users.noreply.github.com>

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

* fix: guard undefined arguments before JSONSchema7Object cast

---------

Signed-off-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>
Co-authored-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:49:32 -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
Matt Van Horn
9c08e5917a
fix: preserve indentation when applying code edits to Python files (#11289)
* fix: preserve indentation when applying code edits via fuzzy matching

When fallback matching strategies (trimmedMatch, whitespaceIgnoredMatch)
find a match with different indentation than the LLM-provided old_string,
the replacement new_string now has its indentation adjusted to match the
actual indentation level in the file. This fixes incorrect indentation in
Python code edits where the LLM provides unindented search/replace strings
that match indented code blocks.

Fixes #11282

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

* fix(core): adjust indentation when fallback match strategies splice replacements

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

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:12:00 -07:00
Octopus
4714bae00a
feat: add MiniMax as a new LLM provider with M2.7 default (#11367)
* feat: add MiniMax as a new LLM provider

Add MiniMax (https://platform.minimax.io) as a new LLM provider with
OpenAI-compatible API support.

Changes:
- Add MiniMax LLM provider class extending OpenAI with temperature
  clamping (must be in (0, 1]) and response_format removal
- Register provider in LLMClasses, openai-adapters, and config-types
- Add model info for MiniMax-M2.5 and MiniMax-M2.5-highspeed
  (204K context, 192K max output)
- Add GUI model selection entries and provider configuration
- Add provider documentation page

* fix: use dedicated MiniMaxApi adapter instead of generic OpenAIApi

The minimax provider was wired to the generic OpenAIApi via
openAICompatible(), which skips MiniMax-specific request fixes.
This creates a dedicated MiniMaxApi adapter class that overrides
modifyChatBody to apply temperature clamping (MiniMax requires
temperature in (0.0, 1.0]) and response_format removal, matching
the adaptations already present in core/llm/llms/MiniMax.ts.

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

* feat: upgrade MiniMax default model to M2.7

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model
- Keep all previous models (M2.5, M2.5-highspeed) as alternatives
- Update docs and GUI model selection

* fix: add minimax to PROVIDER_HANDLES_TEMPLATING and PARALLEL_PROVIDERS

MiniMax uses an OpenAI-compatible chat completions API, so it handles
templating natively. MiniMax also supports parallel tool calls.

Not added to PROVIDER_SUPPORTS_IMAGES since MiniMax M2.7 is text-only.

* style: fix prettier formatting in MiniMax provider files

---------

Co-authored-by: PR Bot <pr-bot@minimaxi.com>
Co-authored-by: octo-patch <octo-patch@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-03-24 13:06:19 -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
Dallin Romney
ced1e3c86b
fix(ollama): check model template for tool support via /api/show (#11670)
fix(ollama): check model template for tool support before sending tools

Ollama models only support tool calling if their template includes
.Tools. The heuristic in toolSupport.ts was too broad, causing 400
errors for models whose templates lack tool support.

Two changes:
- Query /api/show template for .Tools (same pattern as existing .Suffix
  FIM check) and skip sending tools when the template says no
- Exclude Ollama cloud models (:cloud tag) in the heuristic, since
  cloud tool calling is unreliable

Fixes #9639 #9646 #9875 #10304 #10461 #10539 #10561 #10593 #10640
Fixes #10672 #10833 #10876 #11308 #11382 #11402
2026-03-24 12:45:42 -07:00
Dallin Romney
93c437cb0b
Improve error handling UX and move stream retry to BaseLLM (#11773)
* Improve error handling UX and move stream retry to BaseLLM

- Remove issue reporting buttons (GitHub/Discussions) from stream error dialog
- Add error detection for invalid API keys, OpenAI org verification,
  insufficient balance (402), and failed secret templating
- Update out-of-credits copy to match current messaging
- Add sk- prefix validation for OpenAI/Anthropic keys in add model form
- Update OpenRouter API key URL to workspaces/default/keys
- Move overloaded/malformed JSON retry from GUI streamThunkWrapper to
  BaseLLM _retryableStream to avoid glitchy UI from GUI-level retries
- Add overloaded/malformed JSON detection to core retry infrastructure

* fix: simplify retry architecture and make sk- validation a warning

- Remove _retryableStream from BaseLLM; overloaded/malformed JSON retry
  belongs in withExponentialBackoff at the HTTP fetch level
- Revert defaultShouldRetry/calculateDelay exports (no longer needed externally)
- Keep OpenRouter API key URL unchanged
- Make sk- prefix validation a warning instead of blocking error

* Fix stale comment referencing removed retry decorator

* Improve 402 Insufficient Balance error message clarity

* fix: improve copy - rename "View key" to "Check API key", use warning styles, simplify secret error message

* fix: use ternary for className to avoid space stripping by prettier

* style: fix prettier formatting in OutOfCreditsDialog

---------

Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com>
2026-03-24 12:40:19 -07:00
MumuTW
ffb6ea45f0
Fix system-message tools parser when tool call is non-terminal (#11092)
* fix(openai-adapters): map reasoning-delta to reasoning_content

* Fix system-message tool parser for non-terminal tool calls

* Fix duplicate predefined tools in dynamic system-message section

* fix(openai-adapters): fix TS syntax error in vercelStreamConverter test

The `as typeof X & Y` type assertion was ambiguous to the TypeScript
parser without parentheses, causing TS1005 errors across all CI checks.
Simplify to `as any` since this is a test assertion.

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

* chore: remove unrelated vercelStreamConverter changes

Per reviewer feedback — keeping this PR focused on the
system-message tools parser fix.

* fix: correct test expectations for post-tool-call content preservation

The 'preserves content after a tool call' test incorrectly consumed the
trailing newline and preserved text within the tool-call loop. Adjusted
the loop count from 6 to 4 (actual tool-call deltas) and added explicit
assertions for the trailing newline and preserved content chunks.

The 'mid-message' test was missing an assertion for the newline chunk
emitted between the closing codeblock fence and trailing text.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: MumuTW <mumu@novel98.com>
2026-03-24 11:56:43 -07:00
Peter Dave Hello
cbbe3ef11a
Update Node.js LTS to v20.20.1 (#11506)
Node.js v20 entered Maintenance LTS six months ago. Update the version
from v20.19.0 (released over a year ago) to v20.20.1, the latest LTS
release this month.

This ensures the project leverages recent Node.js improvements,
including security updates, and stays on a supported LTS track.
2026-03-24 11:36:07 -07:00
Keita A.
5d19470aa9
fix: add default timeout for terminal command tool execution (#10550)
* fix: add default timeout for terminal command tool execution

Terminal commands with waitForCompletion=true had no timeout, risking
indefinite hangs. Adds a 2-minute default timeout with graceful
SIGTERM -> 5s grace period -> SIGKILL escalation. Both streaming
and non-streaming code paths are covered. The SIGKILL timer is
properly cleared if the process exits during the grace period.

* fix: correct process running check and clear SIGKILL timer

Replace `childProc.killed` with `exitCode === null && signalCode === null`
for accurate process-state detection, and clear sigkillTimeoutId in error
handlers to prevent delayed kills after rejection.

Applied to both streaming and non-streaming paths.

---------

Co-authored-by: amabito <192487536+amabito@users.noreply.github.com>
Co-authored-by: amabito <amabito@local>
2026-03-24 11:04:28 -07:00
Matt Van Horn
4b6a09c9e7
fix: include reasoning_content field for DeepSeek Reasoner models (#11290)
* fix: include reasoning_content field for DeepSeek Reasoner models

DeepSeek Reasoner API requires the reasoning_content field on every
assistant message, even when no thinking message precedes it (e.g. in
resumed sessions). Previously, appendReasoningFieldsIfSupported returned
early when prevMessage was missing or not a thinking role, causing 400
"Missing reasoning_content field" errors. Now reasoning_content defaults
to an empty string when no thinking content is available.

Fixes #11285

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

* fix: use stripImages instead of typecast for MessageContent

Replace `as string` typecasts with stripImages() which safely handles
both string and MessagePart[] content types.

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

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 18:24:31 -07:00
dependabot[bot]
eccde962b5
chore(deps): bump flatted from 3.3.2 to 3.4.2 in /core (#11668)
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.2 to 3.4.2.
- [Commits](https://github.com/WebReflection/flatted/compare/v3.3.2...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 18:20:19 -07:00
shanevcantwell
5ddd0d37a1
fix: skip remote URIs when resolving MCP server cwd (#10844)
When the extension runs in the Local Extension Host on Windows while
connected to a remote workspace (SSH, Dev Container, etc.),
getWorkspaceDirs() returns vscode-remote:// URIs. These cannot be used
as a cwd for child_process.spawn(), causing "spawn cmd.exe ENOENT"
when starting MCP stdio servers.

Fall back to the user's home directory for non-file:// URIs so the
spawn has a valid local working directory.

Fixes #10842

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 17:12:29 -07:00
shanevcantwell
f1a2fbfb10
fix: strengthen default Apply prompt for local models (#10486)
Local models respond to the existing single-sentence Apply prompt with
prose summaries instead of code. Return ChatMessage[] with explicit
code-only instructions and assistant prefill to force code output.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 16:33:09 -07:00
dependabot[bot]
432f613310
chore(deps): bump socket.io-parser from 4.2.4 to 4.2.6 in /core (#11643)
Bumps [socket.io-parser](https://github.com/socketio/socket.io) from 4.2.4 to 4.2.6.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/socket.io-parser@4.2.4...socket.io-parser@4.2.6)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-version: 4.2.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 16:26:09 -07:00