Skip to content

feat(ai): stabilize include setting and flip defaults to false#12686

Open
muraliavarma wants to merge 1 commit intovercel:mainfrom
muraliavarma:stabilize-include-option
Open

feat(ai): stabilize include setting and flip defaults to false#12686
muraliavarma wants to merge 1 commit intovercel:mainfrom
muraliavarma:stabilize-include-option

Conversation

@muraliavarma
Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Updated existing tests and snapshots to reflect new defaults and renamed option
  • Added codemod test with input/output fixtures

@tigent tigent bot added ai/codemod ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. feature New feature or request labels Feb 19, 2026
"reasoning": [],
"reasoningText": undefined,
"request": {},
"request": {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected? I understand this would be a breaking change but maybe I messed up.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +17 to +19
callee.type === 'Identifier' &&
aiMethods.includes(callee.name) &&
args.length > 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
@muraliavarma muraliavarma force-pushed the stabilize-include-option branch from a36b25f to 9e17692 Compare February 20, 2026 01:13
@gr2m gr2m removed the ai/codemod label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants