Commit graph

1144 commits

Author SHA1 Message Date
dependabot[bot]
7eaca6a1eb
chore(deps): bump minimatch in /packages/config-yaml (#10927)
Bumps  and [minimatch](https://github.com/isaacs/minimatch). These dependencies needed to be updated together.

Updates `minimatch` from 3.1.2 to 3.1.5
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

Updates `minimatch` from 5.1.6 to 5.1.9
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
- dependency-name: minimatch
  dependency-version: 5.1.9
  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-09 11:58:16 -07:00
dependabot[bot]
b4de51d26a
chore(deps): bump minimatch in /packages/hub (#10955)
Bumps  and [minimatch](https://github.com/isaacs/minimatch). These dependencies needed to be updated together.

Updates `minimatch` from 3.1.2 to 3.1.5
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

Updates `minimatch` from 5.1.6 to 5.1.9
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
- dependency-name: minimatch
  dependency-version: 5.1.9
  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-09 11:57:55 -07:00
Nate Sesti
ec7030d20b
fix: correct cache_hit_rate calculation and fix Vercel stream tool call handling (#10994)
* fix: correct cache_hit_rate calculation and remove duplicate emission

Two bugs in prompt_cache_metrics telemetry:

1. Duplicate emission: prompt_cache_metrics was emitted twice per API
   request — once using `actualInputTokens` and again using
   `fullUsage.prompt_tokens`. This doubled all event counts in PostHog
   and produced conflicting values.

2. Wrong denominator: cache_hit_rate was calculated as
   `cacheReadTokens / prompt_tokens`, but the Anthropic adapter maps
   `prompt_tokens` to only non-cached input tokens (`input_tokens`),
   excluding cache reads and writes. When caching works well, this
   produces ratios >> 1 (observed max: 89,892). The correct total is
   `prompt_tokens + cache_read_tokens + cache_write_tokens`.

Fix: remove the first duplicate emission and compute total_prompt_tokens
as the sum of all three token types. cache_hit_rate is now a proper 0-1
ratio.

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

* fix: emit tool call id/name from tool-input-start in Vercel stream converter

The Vercel AI SDK streams tool calls as tool-input-start → tool-input-delta
→ tool-input-end → tool-call. Previously, tool-input-start was ignored (returned
null) and tool-call emitted the full tool call at the end, which meant streaming
consumers never saw the tool call id on intermediate chunks.

Now tool-input-start emits the initial chunk with id and function name (matching
OpenAI's streaming format), and tool-call returns null to avoid duplicating args
already streamed via tool-input-delta.

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

Co-Authored-By: Continue <noreply@continue.dev>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Continue <noreply@continue.dev>
2026-03-04 07:57:41 -08:00
Nate Sesti
8bc07a4960
Merge pull request #10935 from continuedev/add-anthropic-message-caching-clean
Add conversation message caching to AnthropicApi
2026-03-01 12:40:57 -08:00
Nate Sesti
5ab2368f37
Merge pull request #10784 from uinstinct/more-prov-1
feat: ai-sdk support for xai and deepseek
2026-03-01 09:28:01 -08:00
Nate Sesti
2dba04fe32
Merge pull request #10775 from uinstinct/env-var-ai-sdk
feat: use env variable to enable ai sdk
2026-03-01 09:27:08 -08:00
Nate Sesti
64d58c4d98
Merge pull request #10801 from continuedev/nate/prompt-caching
feat: add turn-level prompt caching + PostHog metrics + live API tests
2026-02-28 21:18:36 -08:00
Nate
f5f9ccbb16 Guard message caching when strategy is "none"
Skip addCacheControlToLastTwoUserMessages when cachingStrategy is "none"
so requests truly have no caching markers. Updates test to verify.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:33:28 -08:00
Nate
29f4c21e7a Fix TypeScript errors in Anthropic caching test
Add required `provider: "anthropic"` to AnthropicApi constructor calls
and use `(textPart as any)` type assertion for `cache_control` property
access, which is dynamically added and not in the ContentBlockParam type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:19:36 -08:00
Nate
13e553b930 Add conversation message caching to AnthropicApi
Cache the last two user messages in _convertBody() by calling
addCacheControlToLastTwoUserMessages() after applying the caching
strategy. This brings the direct Anthropic path to parity with
OpenRouter, which already caches user messages.

Caching the last two user messages allows Anthropic to serve ~90%
of those tokens from cache reads at 1/10th the cost, significantly
reducing per-request input token costs for multi-turn conversations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:16:58 -08:00
uinstinct
cd41f57491 fix installation package 2026-02-27 08:48:42 +05:30
uinstinct
3eab50f3d1 feat: use env variable to enable ai sdk 2026-02-26 12:30:23 +05:30
uinstinct
7fd21370ed add support for deepseek 2026-02-26 12:29:50 +05:30
uinstinct
6b693337c9 add support for xai provider 2026-02-26 12:29:50 +05:30
Nate
a754a33527 fix: spread configDefaults.exclude in vitest config
Preserve Vitest's default excludes (dist, node_modules, etc.) when
adding the live test exclusion pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:40:56 -08:00
Nate
d526941f9e fix: exclude live API tests from CI test runs
Live test files (*.live.test.ts) make real Anthropic API calls and are
intended for manual validation only. Exclude them from the default
vitest configuration to prevent flaky CI failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:26:55 -08:00
Nate
b690c89ba2 fix: address review feedback - clone messages, void async, fix test loop
- Clone message content blocks before mutating for cache_control
  (prevents mutation of original input body)
- Add `void` prefix to async posthogService.capture call
- Fix duplicate assistant messages in Scenario 3 test loop
- Add unit test verifying original body is not mutated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:18:40 -08:00
Nate
697260712b fix: update anthropic adapter tests to expect cache_control on user messages
The systemAndTools caching strategy now adds cache_control to the last
two user messages via addCacheControlToLastTwoUserMessages(). Update
existing test expectations to include the cache_control field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:08:13 -08:00
Nate
a7dcf8bd84 fix: add 'as any' casts for cache_read_tokens on PromptTokensDetails
The OpenAI PromptTokensDetails type doesn't include cache_read_tokens
(it's an Anthropic extension). Add 'as any' casts to fix TypeScript
build errors in the battle test file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:55:05 -08:00
Nate
2a1b945f2c test: add battle test suite for Anthropic prompt caching scenarios
7 distinct scenarios covering tool use round-trips, parallel tool calls,
long 8-turn conversations, large tool results (~200 lines), cache
invalidation on system message changes, identical request replays, and
multi-step agentic workflows with chained tool calls.

All scenarios validate cache hit rates >90% where expected and proper
cache misses when the system message changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:37:59 -08:00
Nate
30406a0cda feat: add turn-level caching to systemAndTools strategy + PostHog cache metrics + live API test
- Add addCacheControlToLastTwoUserMessages call in systemAndToolsStrategy
  so the CLI path caches conversation turns (matching VS Code extension behavior)
- Report prompt_cache_metrics to PostHog with cache_read/write tokens and hit rate
- Add live API integration test validating cache writes on turn 1 and 99%+ hit
  rates on subsequent turns (guarded by ANTHROPIC_API_KEY env var)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:28:06 -08:00
uinstinct
ffe90db710 fix tests 2026-02-24 15:04:50 +05:30
uinstinct
07c3750a53 upgrade vercel tool format to v6 2026-02-24 14:32:48 +05:30
uinstinct
3c140514d4 aisdk llmapi function name changes 2026-02-24 14:32:48 +05:30
uinstinct
718f48fae4 install ai sdk v6 and corresponding deps 2026-02-24 14:32:48 +05:30
Nate Sesti
98c99d3a63
Merge pull request #10622 from uinstinct/ai-sdk-standalone
chore: remove feature flagged ai sdk usage
2026-02-23 20:10:38 -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
uinstinct
85f21402be recheck expectUsage 2026-02-18 18:59:12 +05:30
uinstinct
2fc6f36a16 update tests to test on ai sdk 2026-02-18 18:48:47 +05:30
uinstinct
71830c26e2 remove vercel_ai_sdk.md 2026-02-18 18:44:08 +05:30
uinstinct
811bb12d09 remove feature flagged USE_VERCEL_AI_SDK 2026-02-18 18:36:08 +05:30
Nate Sesti
8eee3e0300
Merge pull request #10467 from uinstinct/cli-ai-sdk
feat: integrate ai-sdk provider
2026-02-17 21:23:25 -08: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
uinstinct
ec8263d029 add support for openrouter 2026-02-17 19:21:38 +05:30
uinstinct
da52388895 use openai compatible over anthropic adapter 2026-02-17 18:07:57 +05:30
uinstinct
2642558ff0 make schema openai compatible 2026-02-17 17:57:48 +05:30
uinstinct
1689ac28df remove from config yaml 2026-02-12 16:09:00 +05:30
uinstinct
73b5db9410 pass in the format of "provider/model" 2026-02-12 16:04:25 +05:30
uinstinct
73ee3e047a remove usage of aisdkprovider id 2026-02-12 15:52:35 +05:30
uinstinct
783fd2a2ce add ai sdk implementing basellmapi 2026-02-12 15:46:39 +05:30
uinstinct
bf1772a68c convert assistant tool call messages to ai sdk format 2026-02-12 15:36:08 +05:30
Dallin Romney
019a65e4c6
Merge pull request #10421 from continuedev/snyk-fix-c59e28ba618801848d5df7558a39887b
[Snyk] Security upgrade @openapitools/openapi-generator-cli from 2.27.0 to 2.28.3
2026-02-11 03:19:41 -08:00
snyk-bot
ac4816af90
fix: packages/continue-sdk/package.json & packages/continue-sdk/package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AXIOS-15252993
2026-02-11 10:54:29 +00:00
Aditya Mitra
8160711097
Update packages/config-yaml/src/validation.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-02-11 10:11:34 +05:30
uinstinct
ccd9d15fda fix: validate unicode in model apikey or headers 2026-02-10 12:18:33 +05:30
Dallin Romney
38a2ca23fe
Merge pull request #10147 from continuedev/snyk-fix-be7bc5c5ea454c48cbcfb04e4d08b90d
[Snyk] Security upgrade @aws-sdk/credential-providers from 3.943.0 to 3.974.0
2026-02-03 13:31:31 -08:00
dependabot[bot]
eb2d7671e1
chore(deps): bump @isaacs/brace-expansion in /packages/continue-sdk
Bumps @isaacs/brace-expansion from 5.0.0 to 5.0.1.

---
updated-dependencies:
- dependency-name: "@isaacs/brace-expansion"
  dependency-version: 5.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 20:09:20 +00:00
snyk-bot
a877781cc0
fix: packages/openai-adapters/package.json & packages/openai-adapters/package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-FASTXMLPARSER-15155603
2026-02-03 10:17:10 +00: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
a275968b1c
Merge pull request #10036 from micalgenus/main
Fix OpenAI timeout settings not being applied
2026-02-02 22:14:35 -08:00