Skip to content

feat: use env variable to enable ai sdk#10775

Draft
uinstinct wants to merge 4 commits intocontinuedev:mainfrom
uinstinct:env-var-ai-sdk
Draft

feat: use env variable to enable ai sdk#10775
uinstinct wants to merge 4 commits 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 use the Vercel AI SDK for OpenAI and Anthropic by setting CONTINUE_USE_AI_SDK=1. Updates adapters, tool/message conversions, and streaming to the SDK’s v6 formats.

  • 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. Only openai and anthropic are routed through the SDK.
    • 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 87d99de. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant