Skip to content

feat: use env variable to enable ai sdk#10775

Merged
sestinj merged 1 commit intocontinuedev:mainfrom
uinstinct:env-var-ai-sdk
Mar 1, 2026
Merged

feat: use env variable to enable ai sdk#10775
sestinj merged 1 commit intocontinuedev:mainfrom
uinstinct:env-var-ai-sdk

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Feb 24, 2026

Description

use CONTINUE_USE_AI_SDK=1 as environment variable to enable the ai sdk on openai or anthropic providers.

requires #10642 to be merged first

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Continue Tasks: ❌ 7 failed — View all


Summary by cubic

Adds an opt-in path to route OpenAI and Anthropic through the Vercel AI SDK when CONTINUE_USE_AI_SDK=1 and a model is set. The adapter now constructs AiSdkApi with provider/model and forwards apiKey, apiBase, and requestOptions; otherwise it uses native adapters.

  • Dependencies

    • Upgrade ai to v6 and @ai-sdk/* to v3.
    • Use createAnthropic; update params (maxOutputTokens) and usage fields (inputTokens/outputTokens).
    • Switch tool and stream formats to v6 (inputSchema, input, tool-input-*, reasoning-delta, finish.totalUsage). Embedding inputs are coerced to strings.
  • Migration

    • Set CONTINUE_USE_AI_SDK=1 to enable for openai/anthropic, and ensure a model is set in the provider config.
    • If passing tool schemas directly, the top-level schema must be type: "object".

Written for commit 3eab50f. Summary will update on new commits.

@uinstinct uinstinct requested a review from a team as a code owner February 24, 2026 09:32
@uinstinct uinstinct requested review from sestinj and removed request for a team February 24, 2026 09:32
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 24, 2026
@haystack-code-reviewer-pr-hook

Try Haystack Code Reviewer

Want AI-powered code review for this PR? Get instant analysis, interactive visualizations, and actionable insights.

Review this PR with Haystack

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

@uinstinct uinstinct marked this pull request as draft February 24, 2026 11:51
@uinstinct uinstinct marked this pull request as draft February 24, 2026 11:51
@uinstinct uinstinct marked this pull request as ready for review February 26, 2026 07:00
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 26, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@sestinj sestinj merged commit 2dba04f into continuedev:main Mar 1, 2026
51 of 59 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Mar 1, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2026
@uinstinct uinstinct deleted the env-var-ai-sdk branch March 2, 2026 02:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants