* fix(intellij): handle square brackets in file paths for autocomplete
Use File.toURI() instead of URI constructor for Windows two-slash
file:// URIs to properly percent-encode special characters like [ ].
Fixes#10978.
* test(intellij): strengthen Windows URI assertions for bracket encoding
Verify that square brackets are percent-encoded and drive letter
and directory structure are preserved in parsed URI path.
* fix(intellij): make Windows bracket test cross-platform
The CI runs on Linux where C: is not a drive letter.
Assert that brackets are encoded and structure is preserved
without platform-specific path assumptions.
* fix: use cross-platform URI constructor instead of File.toURI()
File.toURI() is platform-dependent — on non-Windows hosts it treats
Windows drive paths (e.g. C:/Users/...) as relative paths, producing
corrupted URIs. The multi-arg URI(scheme, host, path, fragment)
constructor is pure RFC 2396 string manipulation and works identically
on all platforms.
Also strengthens the Windows bracket test with exact equality assertions
instead of loose contains/assertFalse checks.
* chore: remove verbose comments for minimal diff
---------
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
* fix: chunk large JCEF messages to prevent JetBrains sidebar freezes
When session data exceeds ~1MB (e.g. long conversations with many context
items), sendToWebview embeds the entire JSON payload in a single
executeJavaScript call. JCEF's JS parser/compiler cannot handle source
strings that large and freezes the IDE.
This adds a chunked sending path: payloads over 1MB are base64-encoded,
split into 512KB chunks sent as individual executeJavaScript calls that
each append to a buffer variable, then a final call decodes and dispatches
the reassembled message via window.postMessage. Each individual call is
trivial for JCEF to parse, and V8 handles the string concatenation and
final JSON.parse without issue.
Messages under 1MB (the vast majority) take the existing fast path unchanged.
* chore: trim verbose comments
* fix: clean up partial chunk buffer on failure
* fix: use array join instead of string concat for JCEF chunk reassembly
Replaces O(n²) string concatenation (+=) with O(n) array push + join
for JS-side chunk buffering. Extracts script generation into testable
buildChunkScripts() and adds unit tests for chunking logic.
* perf: increase chunk size from 512KB to 2MB
Reduces IPC round-trips by 4x (e.g. 7 calls instead of 26 for 10MB).
Safe because chunks are trivial JS with pure Base64 string literals.
* fix: decode chunked messages as UTF-8 to prevent mojibake
atob() returns Latin-1, so multi-byte UTF-8 characters (em dashes,
accented letters, CJK, emoji) were mangled. Use TextDecoder to
properly decode UTF-8 bytes after base64 decoding.
Response listeners were only removed when data contained `"done": true`,
but most message types (file events, autocomplete, nextEdit, etc.)
return responses without a `done` field. This caused every fire-and-forget
request to leak its callback lambda permanently in the map.
Over a long session with heavy autocomplete and file navigation, this
could accumulate hundreds of thousands of entries (40-100+ MB).
Fix: invert the removal logic — remove the listener by default, and
only keep it when `done == false` (i.e., a streaming response is still
in progress). This preserves existing streaming behavior while ensuring
all non-streaming responses are cleaned up immediately.
* fix: use Dispatchers.Default to avoid SideEffectNotAllowedException in JetBrains intention previews
DocumentChangeTracker and ActiveHandlerManager used Dispatchers.Main which
schedules work via INVOKE_LATER. JetBrains forbids this during intention
preview computation (autocomplete, inspections), throwing
SideEffectNotAllowedException. Neither class requires EDT for its coroutine
work, so switching to Dispatchers.Default resolves the issue.
Fixes#9463, #8035
* fix: use limitedParallelism(1) to prevent race conditions
Dispatchers.Default allows concurrent execution on a thread pool,
which breaks thread-safety for shared mutable state that was previously
serialized on the Main/EDT dispatcher. Using limitedParallelism(1)
preserves single-threaded execution while still avoiding the
SideEffectNotAllowedException from Dispatchers.Main.
fix: add missing pass-through message types for JetBrains
Three message types sent by the GUI were missing from JetBrains'
PASS_THROUGH_TO_CORE list, causing them to be misrouted to the IDE
protocol handler instead of core:
- history/loadRemote (loading remote sessions)
- controlPlane/getEnvironment
- controlPlane/getCreditStatus
* fix: add guard for disposed JCEF browser in sendToWebview
Before calling executeJavaScript, check if the browser is already closed
to prevent NPE propagation from deeper in JCEF. Also broadens the catch
from IllegalStateException to Exception to handle NPE and other errors
that can occur when the browser is in a disposed state.
Fixes#8085, #9159
* fix: add log warning when sending to disposed browser
Log the message type before early-returning on a closed JCEF browser
to aid debugging silent message drops during project disposal.
* fix: resolve crashes in DiffStreamHandler — unsafe cast and negative line numbers
- Use safe cast (as?) for TextEditor in undoChanges() to prevent ClassCastException
- Add early return for empty documents and clamp line numbers to prevent IndexOutOfBoundsException in initUnfinishedRangeHighlights()
- Remove redundant .toList() call in rejectAll()
Fixes#4267
* refactor: inline lineNum variable in initUnfinishedRangeHighlights
fix: update binary test to expect rg instead of esbuild
The build produces a ripgrep (rg) binary, not esbuild. Also guard
against subprocess being undefined in afterAll when beforeAll fails.
Remove Sentry error reporting from the sync catch block — the
service<ContinueSentryService>() call could itself throw from the
background thread, letting the original exception escape and silently
killing all future scheduled runs of the sync task.
Replace with IDEA Logger warnings so failures are visible in the IDE
log. Add explicit connect/read timeouts (5s) to prevent a hung server
from blocking the shared executor indefinitely. Early-return when the
remote config URL is not configured so no work is done at all.
Remove redundant addRemoteSyncJob() call from settings reset(), which
only restores UI fields and should not restart the sync.
Ref: https://github.com/continuedev/continue/discussions/8606#discussioncomment-15003299
DeepSeek Reasoner models require max_completion_tokens instead of max_tokens,
similar to OpenAI's o-series models. This maps the parameter automatically
when the API base is api.deepseek.com or the model name includes
"deepseek-reasoner".
Co-authored-by: Burak Bebek <BurakBebek1@users.noreply.github.com>
* 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.
* Fix StringIndexOutOfBoundsException in readRangeInFile
* fix: clamp endLine relative to startLine to ensure invariant
Ensures endLine >= startLine after clamping, preventing a potential
IllegalArgumentException from subList if both values were clamped
independently to conflicting bounds.
---------
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
* 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
* fix: show actionable error when Ollama fails to parse tool calls
When Ollama models (e.g. gpt-oss:20b) produce malformed tool call
output, Ollama returns "error parsing tool call" which previously
surfaced as an opaque "Unknown error".
Add pattern matching in analyzeError() to detect this specific error
and show a helpful message explaining the issue is transient, that the
user can resubmit, and that enabling "Only use system message tools"
in Settings > Experimental avoids Ollama's native tool call parser.
Fixes#11783, #11063, #10954, #10897, #10711, #10221, #9433
* fix: refine Ollama tool call error copy and matching
Tighten string match to "error parsing ollama response: error: error
parsing tool call" to avoid false positives. Soften settings suggestion
to "Enabling ... may reduce these errors".
* fix: match on Ollama's error string directly
* 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
* 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.
* docs: clarify where secrets are resolved from and IDE vs CLI differences
Reorganizes the secrets FAQ to lead with how to use secrets, then clearly
lists the resolution order. Adds a warning that IDE extensions cannot read
shell environment variables — the most common source of confusion.
Fixes#9081
* Use Mintlify <Warning> component instead of :::warning syntax
---------
Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com>
* docs: add troubleshooting for "model requires more system memory" in Ollama
Add guidance for users encountering memory errors when using Ollama models
with Continue. Continue's higher default context length can trigger this
error even when models work in other tools. Documents the fix of reducing
contextLength in config, with examples for both YAML and JSON formats.
Ref: https://github.com/continuedev/continue/issues/11715
* docs: make ollama memory troubleshooting more concise
* docs: remove discussion link from ollama troubleshooting
* docs: fix broken link to ollama troubleshooting section
- 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)
* 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
fix: hide thinking indicator when thinking content is empty
Check that resolved thinking content has non-whitespace characters
before rendering the ThinkingBlockPeek component, preventing empty
or whitespace-only thinking blocks from showing in the chat UI.
The Prepare Plugin Artifact step globs for continue-intellij-extension-*.zip
which matches multiple files (EAP signed/unsigned, stable signed/unsigned),
causing unzip to fail with exit code 9. Use head -1 to select only the first match.
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.
* fix(cli): gate free-trial status polling by model
* style(cli): format free-trial status changes
* fix(vscode): skip remote marketplace installs when ssh tests are disabled
* fix: remove unrelated e2e extension install changes
Address review feedback by reverting the unrelated changes to
extensions/vscode/package.json and removing the new
install-marketplace-extensions.mjs script.
* fix: clean up isModelUsingFreeTrial and remove NODE_ENV test workaround
- Add optional chaining on apiKeyLocation to prevent crash when undefined
- Remove unnecessary `as any` cast (union narrows via provider check)
- Remove process.env.NODE_ENV === "test" branch from production code;
fake timers in tests handle polling without it
* fix: remove FreeTrialStatus test file
* fix: narrow ModelConfig union before accessing apiKeyLocation
Use an if-statement so TypeScript narrows the discriminated union
to the continue-proxy variant before accessing apiKeyLocation.
* fix: use 'in' operator to narrow ModelConfig union for apiKeyLocation
The Zod schema uses z.string().refine() for the non-continue-proxy
variant, which infers as plain 'string' at the type level, preventing
TypeScript from narrowing via the provider discriminant. Use an 'in'
check to narrow instead.
---------
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
* feat(openrouter): send HTTP-Referer and X-Title headers to identify app
Adds `HTTP-Referer: https://www.continue.dev/` and `X-Title: Continue`
headers to all OpenRouter API requests, as recommended by the OpenRouter
docs. This lets OpenRouter attribute requests to Continue in their
dashboard and App Showcase.
Headers are injected via both `requestOptions.headers` (for SDK-based
requests) and `getHeaders()` (for direct fetch calls). User-configured
headers take precedence.
Closes#4049
* refactor: remove redundant getHeaders() override
The OPENROUTER_HEADERS are already injected via requestOptions.headers
in the constructor. Since fetchwithRequestOptions merges
requestOptions.headers into all requests (including direct fetch calls
like fimStream and rerank), the getHeaders() override was redundant.
The BlockDuplicationDetector used only the `provider` field as the
deduplication key for context entries, so multiple HTTP context providers
with different URLs/titles were collapsed to just the first one.
Use `name ?? params.title ?? provider` as the key instead, matching
how HTTP context providers identify themselves via params.title.
Fixes#9416
The Vercel stream converter was incorrectly mapping reasoning-delta
events to delta.content, causing reasoning/thinking content to be
treated as regular assistant content. This fix maps it to
delta.reasoning_content so downstream consumers can properly
distinguish reasoning from regular output.
Fixes#11069
Co-authored-by: MumuTW <clothl47364@gmail.com>
* 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.
* 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
* fix: don't skip installs by default and sync lock file version
- Comment out SKIP_INSTALLS=true in .vscode/tasks.json so installs run
by default (avoids issues with missing binaries like ripgrep, sqlite)
- Sync package-lock.json version to match package.json (1.3.34)
* fix: override undici-types to 7.18.1 to fix corrupted tarball
undici-types@7.18.2 has a corrupted tarball on the npm registry,
causing npm install to error in the install-all-dependencies script.
Override to 7.18.1 which is not affected.
* 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