feat(ai): stabilize include setting and flip defaults to false#12686
feat(ai): stabilize include setting and flip defaults to false#12686muraliavarma wants to merge 1 commit intovercel:mainfrom
Conversation
| "reasoning": [], | ||
| "reasoningText": undefined, | ||
| "request": {}, | ||
| "request": { |
There was a problem hiding this comment.
Is this expected? I understand this would be a breaking change but maybe I messed up.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a36b25fed0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| callee.type === 'Identifier' && | ||
| aiMethods.includes(callee.name) && | ||
| args.length > 0 |
There was a problem hiding this comment.
Restrict include rename to AI SDK imports
This codemod rewrites any call expression named generateText/streamText without checking whether those identifiers were imported from ai. In codebases that define local helpers (or use other libraries) with the same names, running v7 will rename experimental_include on unrelated APIs and can change behavior or break type checks. The transform should first resolve imported local names from ai (including aliases) and only mutate those call sites.
Useful? React with 👍 / 👎.
| const firstArg = args[0]; | ||
|
|
||
| // The first argument should be an object with properties | ||
| if (firstArg.type === 'ObjectExpression') { |
There was a problem hiding this comment.
Rewrite include keys in referenced option objects
The transformation only runs when the first argument is an inline object literal, so calls like const opts = { experimental_include: ... }; generateText(opts) are skipped. After this commit, experimental_include is no longer read by generateText/streamText, so skipped sites silently fall back to the new default (requestBody/responseBody excluded) and users lose retained body data they expected. Handle identifier/assignment-based option objects as done in other migration codemods.
Useful? React with 👍 / 👎.
Rename `experimental_include` to `include` and change default behavior to exclude request/response bodies from step results, reducing memory usage when processing large payloads like images.
a36b25f to
9e17692
Compare
Summary
experimental_includetoincludeingenerateTextandstreamText, stabilizing the API (addresses switch default for include setting to false #12130, move include setting to stable #12131)requestBodyandresponseBodyfromtruetofalse, reducing memory usage by default when processing large payloads like imagesrename-experimental-include) to automatically migrate existing usageTest plan