Commit graph

21300 commits

Author SHA1 Message Date
Nate Sesti
81f1016fed
Merge pull request #10937 from continuedev/nate/remove-directory-structure
Remove directory structure from system prompt
2026-03-01 12:42:10 -08:00
Nate Sesti
a45888f5c2
Merge pull request #10936 from continuedev/add-cache-telemetry-posthog
Add cache token data to PostHog telemetry events
2026-03-01 12:41:43 -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
d47cbfb436
Merge pull request #10953 from continuedev/wt-6
Add smoke tests for real API connectivity
2026-03-01 12:32:31 -08:00
Nate
310ad57b9c fix: set utf8 encoding on child process streams
Use setEncoding("utf8") on stdout/stderr streams instead of
per-chunk Buffer.toString() to avoid breaking multi-byte characters
at chunk boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:12:22 -08:00
Nate
4a0bc1e624 fix: eslint import order and continue-proxy model name format
Move execa type import before vitest to satisfy eslint import/order.
Require SMOKE_PROXY_MODEL env var for continue-proxy test since the
proxy needs a 4-part model name (owner/package/provider/model) that
depends on org-specific configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:00:45 -08:00
Nate
82672294bf fix: format smoke-api files with prettier
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:42:28 -08:00
Nate
25fe40a546 Add smoke tests for real API connectivity
Add a new smoke-api test suite that proves the CLI can complete real LLM
round-trips against the Anthropic API. Tests cover headless mode,
serve mode, and all-tools execution. Runs sequentially to avoid rate
limits, skips gracefully when API keys are missing (fork PRs), and
is wired into CI as a required check with allowed-skips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:30:41 -08:00
Nate Sesti
533fb83c3c
Merge pull request #10951 from continuedev/nate/fix-ci01
Fix stable release npm publish with OIDC trusted publishing
2026-03-01 09:42:30 -08:00
Nate
9fe15eeea8 Fix stable release npm publish by enabling OIDC trusted publishing
Add --provenance flag to npm publish so it uses the GitHub OIDC token
exchange instead of the expired NODE_AUTH_TOKEN for authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 09:40:51 -08:00
Nate Sesti
de12be19ce
Merge pull request #10874 from uinstinct/back-job-perm
feat: allow background job perm check by default
2026-03-01 09:31:12 -08:00
Nate Sesti
4c0f3b66ca
Merge branch 'main' into back-job-perm 2026-03-01 09:31:04 -08:00
Nate Sesti
b70d69ff83
Merge pull request #10845 from uinstinct/cli-quiz
feat(cli): quiz answers
2026-03-01 09:30:25 -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
60646e5dd5
Merge pull request #10950 from continuedev/sestinj-patch-1
Remove NODE_AUTH_TOKEN from stable-release workflow
2026-03-01 09:18:12 -08:00
Nate Sesti
966ffe9883
Remove NODE_AUTH_TOKEN from stable-release workflow
Removed NODE_AUTH_TOKEN environment variable from various steps in the stable release workflow.
2026-03-01 09:17:53 -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
d7aa797a94 Remove directory structure from system prompt
Remove the getDirectoryStructure() function and its embedding in the
system prompt. This was walking up to 500 files and embedding them as a
static tree in every API request, adding ~3,500-5,000 tokens per call.

The LLM already has tools (listFiles, Glob, Grep) to discover files on
demand, making the embedded tree redundant. Claude Code does not include
directory structure in its system prompt for the same reason.

This also improves prompt cache hit rates since the system prompt no
longer varies by project directory contents.

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

Co-Authored-By: Continue <noreply@continue.dev>
2026-02-28 13:17:47 -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
Nate
c28ffbf225 Add cache token data and prompt_cache_metrics to PostHog telemetry
Add cacheReadTokens and cacheWriteTokens to the existing apiRequest
PostHog event, and emit a new prompt_cache_metrics event with
cache_hit_rate, cache_read_tokens, cache_write_tokens,
total_prompt_tokens, tool_count, and model. This populates the
existing Prompt Cache Performance dashboard (ID: 1310089).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:15:50 -08:00
uinstinct
9ae00f592b move QuizService to services folder 2026-02-27 09:41:47 +05:30
uinstinct
6187143567 feat: allow background job perm check by default 2026-02-27 09:24:29 +05:30
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
uinstinct
35725099c1 remove allowCustomAnswer
- also refine the prompt
2026-02-26 12:16:10 +05:30
uinstinct
bd5a4cad9d refine prompt 2026-02-26 12:04:00 +05:30
uinstinct
dd9177fe76 add quiz prompt component 2026-02-26 11:52:40 +05:30
uinstinct
6d082f2ff7 add quiz service 2026-02-26 11:50:47 +05:30
uinstinct
fe4ec8ebcd rename to askquestion and set permission to allow 2026-02-26 11:40:27 +05:30
uinstinct
489aa49663 add quiz tool 2026-02-26 11:40:05 +05:30
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
Nate Sesti
97ff73e7bf
Merge pull request #10642 from uinstinct/ai-sdk-upgrade-2
chore: upgrade ai sdk to v6
2026-02-25 20:35:30 -08:00
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
Nate Sesti
5695cc879c
Merge pull request #10734 from continuedev/nate/blueprint-suggestions-cli
feat: pre-install suggestions CLI in devbox blueprints
2026-02-22 21:00:20 -08:00