Skip to content

fix(vercelai): Fix Vercel AI SDK templates for vision and tool tests#95

Open
RulaKhaled wants to merge 1 commit intomainfrom
vercelai-issues
Open

fix(vercelai): Fix Vercel AI SDK templates for vision and tool tests#95
RulaKhaled wants to merge 1 commit intomainfrom
vercelai-issues

Conversation

@RulaKhaled
Copy link
Member

This PR:

  1. Fixes image format for vision tests
    • Changed image format from data URL to raw base64 + mimeType
    • Vercel AI SDK's validateDownloadUrl rejects data: URLs
  2. Adds tool support to node Vercel template
    • Added missing tool imports (tool, jsonSchema, stepCountIs)
    • Added tool definition block to create tools from agent.tools
    • Pass tools and stopWhen: stepCountIs(10) to generateText calls
    • Enables agent tests with tool calling (Tool Call Agent Test, Tool Error Agent Test, etc.)
    • Aligns node template with existing nextjs template

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

🔴 AI SDK Integration Test Results

Status: 4 regressions detected

Summary

Metric main PR Change
Total Tests 448 448
Passed 215 222 +7 ✅
Failed 220 213 -7 ✅

🔴 Regressions

These tests were passing on main but are now failing:

cloudflare/anthropic :: Basic LLM Test (blocking)

Error: Test execution failed: Wrangler exited with code 1

Test execution failed: Wrangler exited with code 1
stdout: 
 ⛅️ wrangler 4.71.0
───────────────────
Using secrets defined in .dev.vars
Your Worker has access to the following bindings:
Binding                                                                   Resource                  Mode
env.SENTRY_DSN ("http://public@localhost:42331/718036615")                Environment Variable      local
env.RUN_ID ("run-1773068426756-hh9zklz")                                  Environment Variable      local
env.OPENAI_API_KEY ("(hidden)")                                           Environment Variable      local
env.ANTHROPIC_API_KEY ("(hidden)")                                        Environment Variable      local
env.GOOGLE_GENAI_API_KEY ("(hidden)")                                     Environment Variable      local

*** Fatal uncaught kj::Exception: kj/async-io-unix.c++:945: failed: ::bind(sockfd, &addr.generic, addrlen): Address already in use; toString() = 127.0.0.1:9229
stack: /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f0a176 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f09f49 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f0862c /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1f44fcc /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1f459c8 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1f46381 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1f47b3d /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1ead534 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f3a9ff /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f3ae50 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f38cd5 /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4f38aeb /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1e96cb5 /lib/x86_64-linux-gnu/libc.so.6@2a1c9 /lib/x86_64-linux-gnu/libc.so.6@2a28a /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/cloudflare/anthropic-0.39.0-sentry-latest/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1e96024


stderr: �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mAddress already in use (127.0.0.1:9229). Please check that you are not already running a server on this address or specify a different port with --port.�[0m


🪵  Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2026-03-09_15-07-05_458.log"

node/google-genai :: Multi-Turn LLM Test (blocking)

Error: 3 check(s) failed:

3 check(s) failed:
Attribute validation failed:
  Span fe8a0a07: Attribute 'gen_ai.usage.input_tokens' must exist but is missing
  Span fe8a0a07: Attribute 'gen_ai.usage.output_tokens' must exist but is missing
Token usage validation failed:
  input_tokens must exist
  output_tokens must exist
  total_tokens must exist
Input token progression failed: tokens should increase with each turn
gen_ai.response.model is missing (optional but recommended)
node/google-genai :: Vision LLM Test (blocking)

Error: 2 check(s) failed:

2 check(s) failed:
Attribute validation failed:
  Span fc9c432b: Attribute 'gen_ai.usage.input_tokens' must exist but is missing
  Span fc9c432b: Attribute 'gen_ai.usage.output_tokens' must exist but is missing
Token usage validation failed:
  input_tokens must exist
  output_tokens must exist
  total_tokens must exist
gen_ai.response.model is missing (optional but recommended)
python/google-genai :: Basic LLM Test (sync, blocking)

Error: 2 check(s) failed:

2 check(s) failed:
Attribute validation failed:
  Span bc256832: Attribute 'gen_ai.usage.input_tokens' must exist but is missing
  Span bc256832: Attribute 'gen_ai.usage.output_tokens' must exist but is missing
Token usage validation failed:
  input_tokens must exist
  output_tokens must exist
  total_tokens must exist
gen_ai.response.model is missing (optional but recommended)

✅ Fixed

These tests were failing on main but are now passing:

  • browser/google-genai :: Basic LLM Test (blocking)
  • browser/google-genai :: Vision LLM Test (streaming)
  • browser/openai :: Multi-Turn LLM Test (blocking)
  • cloudflare/anthropic :: Basic Error LLM Test (blocking)
  • cloudflare/google-genai :: Long Input LLM Test (blocking)
  • node/google-genai :: Vision LLM Test (streaming)
  • node/google-genai :: Conversation ID LLM Test (blocking)
  • python/google-genai :: Basic LLM Test (sync, streaming)
  • python/google-genai :: Conversation ID LLM Test (sync, streaming)
  • python/google-genai :: Conversation ID LLM Test (sync, blocking)
  • python/google-genai :: Conversation ID LLM Test (async, blocking)

Test Matrix

Agent Tests

SDK Basic Agent Test Conversation ID Agent Test Long Input Agent Test Tool Call Agent Test Tool Error Agent Test Vision Agent Test
cloudflare/langgraph
cloudflare/vercel
nextjs/mastra
nextjs/vercel blkstr blkstr blkstr blkstr blkstr blkstr
node/manual
node/mastra
node/vercel
php/laravel blkstr blkstr blkstr blkstr blkstr blkstr
python/langgraph as as as as as as
python/manual as as as as as as
python/openai-agents
python/pydantic-ai

Embedding Tests

SDK Basic Embeddings Test
browser/google-genai
browser/langchain
browser/openai
cloudflare/google-genai
cloudflare/langchain
cloudflare/openai
cloudflare/vercel
nextjs/google-genai
nextjs/langchain
nextjs/openai
nextjs/vercel
node/google-genai
node/langchain
node/openai
node/vercel
php/laravel
python/google-genai a, blks, blk
python/langchain a, blks, blk
python/litellm a, blks, blk
python/manual a, blks, blk
python/openai a, blks, blk

LLM Tests

SDK Basic Error LLM Test Basic LLM Test Conversation ID LLM Test Long Input LLM Test Multi-Turn LLM Test Vision LLM Test
browser/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
browser/google-genai blkstr ✅🔧blkstr blkstr blkstr blkstr blk ✅🔧str
browser/langchain blkstr blkstr blkstr blkstr blkstr blkstr
browser/openai blkstr blkstr blkstr blkstr ✅🔧blkstr blkstr
cloudflare/anthropic ✅🔧blkstr ❌📉blkstr blkstr blkstr blkstr blkstr
cloudflare/google-genai blkstr blkstr blkstr ✅🔧blkstr blkstr blkstr
cloudflare/langchain blkstr blkstr blkstr blkstr blkstr blkstr
cloudflare/openai blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/google-genai blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/langchain blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/openai blkstr blkstr blkstr blkstr blkstr blkstr
node/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
node/google-genai blkstr blkstr ✅🔧blkstr blkstr ❌📉blkstr ❌📉blk ✅🔧str
node/langchain blkstr blkstr blkstr blkstr blkstr blkstr
node/manual
node/openai blkstr blkstr blkstr blkstr blkstr blkstr
python/anthropic a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/google-genai a, blka, strs, blks, str a, blka, str ❌📉s, blk ✅🔧s, str ✅🔧a, blka, str ✅🔧s, blk ✅🔧s, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/langchain a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/litellm a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/manual a, blks, blk a, blks, blk a, blks, blk a, blks, blk a, blks, blk
python/openai a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str

Legend: ✅ Pass | ❌ Fail | ✅🔧 Fixed | ❌📉 Regressed | ✅🆕 New (pass) | ❌🆕 New (fail) | 🗑️ Removed | str=streaming blk=blocking a=async s=sync


Generated by AI SDK Integration Tests

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.

1 participant