Skip to content

feat(runtime): upgrade Vercel AI SDK to v7 - #1198

Merged
likun666661 merged 2 commits into
apache:mainfrom
YayoiNanoka:upgrade/vercel-ai-sdk-7
Jul 18, 2026
Merged

feat(runtime): upgrade Vercel AI SDK to v7#1198
likun666661 merged 2 commits into
apache:mainfrom
YayoiNanoka:upgrade/vercel-ai-sdk-7

Conversation

@YayoiNanoka

Copy link
Copy Markdown
Contributor

Summary

Upgrade Maka from Vercel AI SDK 6 to AI SDK 7 while preserving the existing multi-provider model integration, Tool Calling Agent Loop, permission handling, context management, retries, and usage accounting.

This PR also removes obsolete archived sandbox development plans and updates the archive index.

Changes

  • Upgrade ai from 6.0.185 to 7.0.31.
  • Upgrade the provider packages:
    • @ai-sdk/openai to 4.0.16
    • @ai-sdk/anthropic to 4.0.16
    • @ai-sdk/google to 4.0.18
    • @ai-sdk/cohere to 4.0.11
    • @ai-sdk/openai-compatible to 3.0.12
  • Migrate provider contracts from LanguageModelV3 to LanguageModelV4.
  • Replace createGoogleGenerativeAI with createGoogle.
  • Migrate AI SDK APIs:
    • systeminstructions
    • stepCountIs()isStepCount()
    • fullStreamstream
    • experimental_repairToolCallrepairToolCall
    • experimental_contextruntimeContext / toolsContext
  • Adapt Maka's prepareStep composition to AI SDK 7's carry-forward semantics.
  • Prevent steering messages, compact results, and tool-result pruning from being applied more than once across steps.
  • Update usage accounting for AI SDK 7's cumulative usage semantics.
  • Preserve per-step input-token tracking for context-window reporting.
  • Migrate user images, MCP images, and Computer Use screenshots from image-data to V7 file content parts.
  • Migrate standalone generateText() consumers in runtime, headless, and desktop.
  • Upgrade test infrastructure to MockLanguageModelV4 and V4 stream/usage contracts.
  • Add an upgrade checklist documenting completed work and remaining live-provider coverage.

Agent Loop compatibility

Maka continues to use AI SDK's streamText() Tool Calling loop while retaining Maka-owned tool registration, permission checks, dynamic tool activation, context compaction, retries, persistence, and telemetry.

The migration specifically verifies:

  • explicit and unbounded step stopping;
  • deferred tool activation;
  • prepareStep message carry-forward;
  • permission allow/deny/wait/abort;
  • overflow and transport retry behavior;
  • prevention of side-effect replay;
  • cumulative usage and cost accounting.

Validation

The following completed successfully:

  • npm ci
  • npm run clean
  • npm run build
  • npm run typecheck
  • npm run lint
  • npm test
  • Runtime full test suite
  • All workspace test suites
  • Deprecated V3/V6 API scan
  • git diff --check
  • Pinned cua-driver v0.7.1-maka.2 artifact integrity check

Live provider smoke tests

DeepSeek official API through the OpenAI-compatible adapter:

  • deepseek-chat
    • text streaming passed;
    • two-step Tool Calling passed.
  • deepseek-v4-pro
    • text streaming passed;
    • reasoning streaming and reasoning usage passed;
    • two-step Tool Calling passed;
    • cumulative usage and cached-input usage were observed.

Known validation gaps

  • The configured tokenhub/OpenAI gpt-5.5 request reached /v1/responses, but the provider returned HTTP 402 due to insufficient account quota.
  • Anthropic, Google, and Cohere live smoke tests were not run because no credentials were available.
  • The isolated Electron Computer Use observe-only E2E was executed, but deepseek-v4-pro is classified as a non-vision model. Maka therefore intentionally removes the screenshot-returning maka_computer tool before the request, so this model cannot satisfy the Computer Use qualification gate.
  • npm ci reports 4 audit findings (2 low and 2 high). No forced audit upgrade is included in this PR.

Documentation cleanup

Remove obsolete archived sandbox implementation plans that no longer describe the current architecture, and update docs/archive/README.md accordingly.

@likun666661
likun666661 merged commit 5361541 into apache:main Jul 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants