Commit graph

1612 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
shanemort1982
19c3f35831
feat: add Tensorix as an LLM provider (#11184)
* feat: add Tensorix as an LLM provider

Adds Tensorix (https://tensorix.ai) as a new OpenAI-compatible
provider, giving users access to DeepSeek, Llama 4, Qwen, GLM,
and other models through a single API key.

Changes:
- New LLM class (core/llm/llms/Tensorix.ts)
- Registered in LLM index and config schema
- Added to VS Code extension config schema
- Added to GUI provider selection with AUTODETECT

* Fix missing commas in config_schema.json for tensorix entries

Co-authored-by: openhands <openhands@all-hands.dev>

* feat: address reviewer feedback for Tensorix provider

- Add tensorix to openai-adapters (types.ts + index.ts)
- Add tensorix to PROVIDER_HANDLES_TEMPLATING, PROVIDER_SUPPORTS_IMAGES,
  and PARALLEL_PROVIDERS in autodetect.ts
- Add docs page for Tensorix under more providers
- Add tensorix to docs.json navigation

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-03-19 16:29:45 -07:00
Keita A.
af4383f6df
refactor: unify AbortError detection with isAbortError utility (#10551)
* refactor: unify AbortError detection with isAbortError utility

AbortError detection was scattered across 3+ patterns (string
comparison, .name check, .code check). Consolidates into a single
isAbortError() utility that handles all known patterns: "cancel"
string, DOMException, Error.name variants, ABORT_ERR code, and
plain objects. Updates call sites in core/llm/index.ts and
core/llm/utils/retry.ts.

* fix: use exact match for AbortError name, add null guard, improve tests

- Changed .includes("AbortError") to === "AbortError" to preserve
  original exact-match semantics at L505 and retry.ts call sites
- Added null/undefined early return to prevent TypeError on
  "name" in null
- Unified DOMException branch to use exact match consistently
- Tests: removed 4 redundant same-branch duplicates, added 12 new
  cases (case sensitivity, empty string, non-string name, partial
  name boundary, DOMException negative, plain object code asymmetry,
  boolean, frozen object, Error subclass, TypeError)
- Fixed DOMException test skip from expect(true).toBe(true) to
  it.skipIf

* fix: replace == null with === null || === undefined (eqeqeq)

---------

Co-authored-by: amabito <192487536+amabito@users.noreply.github.com>
Co-authored-by: amabito <amabito@local>
2026-03-13 16:10:05 -07:00
Aditya Mitra
1376be6743
fix: edit mode throwing error for xai provider (#11002)
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-03-10 00:32:52 -07:00
Nate Sesti
9b88c27373
Merge pull request #10674 from continuedev/gemini-429
fix: detect embedded 429 errors from Gemini/VertexAI APIs
2026-02-25 20:36:17 -08:00
Dallin Romney
a2c1fe6897
feat: model updates and + z.ai (#10638)
* Add latest model definitions across providers

Add new models for OpenAI (gpt-4.1, gpt-5.2, codex-mini, o1/o3/o4-mini),
Gemini (2.5 stable, 2.5-flash-lite, 3-flash-preview), Mistral (devstral,
magistral, ministral, mistral-nemo), xAI (grok-4-fast, grok-4-1-fast,
grok-3-fast), and Bedrock (Claude 4.5/4.6, Nova, Llama 4, DeepSeek).

Update tool support and reasoning detection for the new model families.

* Add Z.ai (GLM) provider, Kimi K2/K2.5 models, and fix OpenRouter tool support bug

- Add Z.ai as a new provider with GLM-5, GLM-4.7, GLM-4-plus, GLM-4.5 models
- Add Kimi K2 and K2.5 model packages to Moonshot provider
- Fix variable shadowing bug in OpenRouter tool support where loop
  variables shadowed the outer model parameter, causing specificModels
  and supportedContains checks to always return true
- Add moonshotai/kimi and zai-org/glm to OpenRouter supported prefixes
- Add Z.ai and Moonshot to docs navigation

* Clean up unnecessary import aliases for zAI

* Add Z.ai Coding Plan endpoint note to docs

* Replace placeholder zai.png icon with proper zAI.svg

* Add zAI provider to openai-adapters

* Fix Z.ai API key URL
2026-02-20 00:35:44 -08:00
Dallin Romney
9759ad657d fix: detect embedded 429 errors from Gemini/VertexAI APIs
Gemini and VertexAI can return rate-limit errors where the HTTP status
is not 429 but the error code is embedded in the response body JSON
(e.g., "code":429). Add regex-based detection of these embedded errors
in both retry paths so they trigger exponential backoff correctly.
2026-02-20 00:30:46 -08:00
continue-staging[bot]
ac2a940cd7
fix: update stale comment for Claude Opus 4.5 pricing
The comment described Claude Opus 4.5 as 'most intelligent model' but
this is now outdated since Claude Opus 4.6 was added as the new most
intelligent model. Updated to 'previous generation' for consistency.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
Co-authored-by: dallin <dallin+staging@continue.dev>
2026-02-18 01:23:22 +00:00
Dallin Romney
c006d4b231 feat: add Claude Sonnet 4.6 and Claude Opus 4.6 models
Add claude-sonnet-4-6 and claude-opus-4-6 as the new default Sonnet and
Opus models across providers, GUI configs, schemas, cost calculation,
and CLI defaults. Update display names for all >= 4.5 models to use
name-first format (e.g. "Claude Sonnet 4.5" not "Claude 4.5 Sonnet").
2026-02-17 11:49:21 -08:00
Varun Chawla
cfff26f522 fix: check exclusions against both raw and normalized model IDs for LM Studio
Extract isExcluded helper that tests a given name against each exclusion
pattern in both its original and hyphen-stripped forms.  Call it with
both the raw lowercased model name and the normalized (hyphen-stripped)
form so that e.g. "mistral-lite" is correctly caught by the
"mistrallite" exclusion regardless of which path is evaluated.
2026-02-08 12:11:01 -08:00
Varun Chawla
dc47a957d1 fix: check exclusions on both raw and normalized model names for LM Studio
The exclusion check only tested the lowercased model name, missing cases
where hyphenated names like "Mistral-Lite" normalize to "mistrallite"
which should match the exclusion pattern.
2026-02-08 10:09:33 -08:00
Varun Chawla
f83aeed254 fix: correct model ID normalization order for LM Studio
Check exclusions on both raw and normalized (hyphen-stripped) model
names before delegating to Ollama's heuristic. This ensures:

1. Hyphenated exclusions like "mistral-openorca" are caught on the raw name
2. Non-hyphenated variants like "MistralOpenOrca" are caught on the
   normalized name before the "mistral" support pattern matches
3. Hyphenated LM Studio IDs like "Meta-Llama-3.1-8B" still get detected
   via the normalized fallback to Ollama
2026-02-08 05:20:12 -08:00
Varun Chawla
61471b37f9 fix: check exclusions before early return in LM Studio tool support
The LM Studio handler was checking Ollama's full heuristic (which
doesn't match hyphenated names) before trying the normalized version.
This caused hyphenated LM Studio model IDs like
"Meta-Llama-3.1-8B-Instruct-GGUF" to be incorrectly rejected.

Now checks exclusions separately first, then falls back to the
normalized (hyphen-removed) name for Ollama's support check.
2026-02-08 05:05:33 -08:00
Varun Chawla
8b04ae1845 Fix LM Studio model ID tool support with proper hyphen normalization
Improve the LM Studio tool support check to first verify exclusions on the
original model ID before normalizing hyphens. This ensures that models like
'Mistral-Openorca-GGUF' are correctly excluded from tool support, while
allowing hyphenated variants of supported models like 'Meta-Llama-3.1-8B-Instruct-GGUF'.

The previous implementation would remove all hyphens before checking Ollama's
heuristics, which could bypass exclusion rules for models like mistral-openorca.
2026-02-08 01:24:34 -08:00
Varun Chawla
71d355ec44 fix: normalize hyphenated model IDs for LM Studio tool support
LM Studio uses hyphenated model identifiers (e.g., "Meta-Llama-3.1-8B-Instruct-GGUF"),
but the Ollama heuristic checks for non-hyphenated patterns like "llama3.1".

This fix normalizes hyphenated model names by removing hyphens before delegating to
Ollama's tool support logic, enabling agent mode for LM Studio models with hyphenated IDs.

Added comprehensive tests for hyphenated model names including:
- Meta-Llama-3.1-8B-Instruct-GGUF
- Qwen2-7B-Instruct
- Mixtral-8x7B-Instruct-v0.1
- Case insensitivity checks
- Negative tests for unsupported models like "Llama-Vision-Free"

Addresses feedback from Cubic AI bot review.
2026-02-07 20:12:08 -08:00
Varun Chawla
be5181ef31 feat: enable agent mode support for LM Studio models
Add LM Studio to PROVIDER_TOOL_SUPPORT by referencing Ollama's
tool support implementation. LM Studio uses an OpenAI-compatible
API similar to Ollama, so the same model compatibility logic applies.

Fixes #5182
2026-02-07 15:16:51 -08:00
Dallin Romney
0397a446f3
Merge pull request #9968 from continuedev/move-token-adjustment-to-core
Move getAdjustedTokenCountFromModel from CLI to core
2026-02-03 13:31:58 -08:00
Dallin Romney
998425438b
Merge pull request #10127 from uinstinct/hub-local
fix: show error for blank inputs when using hub blocks in local config
2026-02-03 00:15:04 -08:00
Dallin Romney
318cb66c5e Merge branch 'main' of https://github.com/continuedev/continue into move-token-adjustment-to-core 2026-02-02 23:47:02 -08:00
Dallin Romney
437ac08acf
Merge pull request #9989 from Aboozle1/main
feat: add Nous Research Hermes models as provider
2026-02-02 22:43:15 -08:00
Dallin Romney
6c56210f1c
fix: add reasoning content field support in chat body (#10027) 2026-02-02 22:35:49 -08:00
Dallin Romney
6c7df3540c fix: mistral model matching 2026-02-02 22:12:07 -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
Houssem Zaier
dcac6260a7
fix: OpenAI Responses API parallel tool calls losing call_ids (#9659)
When GPT-5 makes parallel tool calls, each function_call has a unique
call_id (fc_*). These IDs were being overwritten instead of accumulated,
causing the error: "No tool call found for function call output with call_id"

Changes:
- sessionSlice.ts: Accumulate IDs in responsesOutputItemIds[] array
- openaiTypeConverters.ts: Emit function_call for EACH toolCall with matching ID

Ref: https://platform.openai.com/docs/guides/function-calling
2026-02-02 21:45:48 -08:00
uinstinct
1a9ea0a29c change error name to use config.yaml instead of config.json 2026-02-02 21:53:05 +05:30
Dallin Romney
7c32e1e429 fix: mistral model matching 2026-01-31 15:42:13 -08:00
Dallin Romney
d762690510 fix: move token adjustment to separate module 2026-01-31 15:17:30 -08:00
uinstinct
ac93dd9381 fix: add reasoning content field support in chat body 2026-01-30 14:25:13 +05:30
Abhaykhanna3
1ba9a669d6
feat: add Nous Research Hermes models as provider
- Add Nous.ts LLM provider extending OpenAI
- Add Hermes 3 and Hermes 4 model entries (70B, 405B, 36B variants)
- Add Nous to providers list with API base configuration
- Add Hermes detection for ChatML template in autodetect
- Add Nous to PROVIDER_HANDLES_TEMPLATING
- Add documentation page for Nous Research

Amp-Thread-ID: https://ampcode.com/threads/T-019c0611-a43c-764f-83a5-b91821140566
Co-authored-by: Amp <amp@ampcode.com>
2026-01-28 15:48:41 -05:00
RomneyDa
8da07defb4 Move getAdjustedTokenCountFromModel from CLI to core
- Moved getAdjustedTokenCountFromModel function from CLI tokenizer to core/llm/countTokens.ts
- Updated core countTokens() to use getAdjustedTokenCountFromModel for all models
- Added comprehensive tests for getAdjustedTokenCountFromModel in core
- Updated CLI tokenizer to import getAdjustedTokenCountFromModel from core
- Removed duplicate implementation and constants from CLI

This consolidates the token adjustment logic in one place and ensures
consistent token counting across CLI and core. The llama tokenizer is
now used for all models with appropriate multipliers for Claude (1.23x),
Gemini (1.18x), and Mistral family (1.26x) models.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
Co-authored-by: dallin <dallin@continue.dev>
2026-01-28 06:27:16 +00:00