Skip to content

fix(codemod): scope reasoning property migration#15328

Closed
Kage18 wants to merge 1 commit into
vercel:mainfrom
Kage18:kage-fix-codemod-reasoning-false-positive
Closed

fix(codemod): scope reasoning property migration#15328
Kage18 wants to merge 1 commit into
vercel:mainfrom
Kage18:kage-fix-codemod-reasoning-false-positive

Conversation

@Kage18

@Kage18 Kage18 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • scope the v5 reasoning property migration to AI SDK result and step shapes instead of every property named reasoning
  • preserve unrelated React props and local objects named reasoning
  • add regression fixtures for the reported MessageReasoningProps case and valid AI SDK result/step migrations

Fixes #8340.

Kage usage

  • Recalled package context for @ai-sdk/codemod and the reasoning codemod tests/code graph.
  • Captured a repo-local memory packet documenting that the false positive came from the broad rename-reasoning-properties step, plus the verified fix and test commands.
  • Local Kage metrics for packages/codemod after refresh: 300 files, 1,354 symbols, 1,203 calls, 87 tests, 100% indexed coverage, 3 memory packets, 53 memory graph entities, 54 evidence-backed edges, 0 stale packets.

Tests

  • pnpm --filter @ai-sdk/codemod test
  • pnpm --filter @ai-sdk/codemod type-check

@Kage18

Kage18 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Kage usage for this PR:

This PR fixed #8340 by scoping the v5 reasoning-property codemod to AI SDK result/step shapes instead of renaming every property named reasoning.

How Kage helped:

  • Recalled the @ai-sdk/codemod package context and the existing reasoning codemod/test structure.
  • Kept the implementation and fixture paths together: rename-reasoning-properties.ts, codemod tests, and input/output fixtures.
  • Helped separate valid AI SDK result migrations from unrelated React/component props such as MessageReasoningProps.reasoning.
  • Captured the durable rule: only rewrite reasoning / reasoningDetails when tied to generateText / streamText results, step values, or explicit AI SDK result annotations.
  • Captured the regression evidence and verification commands: pnpm --filter @ai-sdk/codemod test and pnpm --filter @ai-sdk/codemod type-check.

Why this matters for future sessions:
A future agent editing codemods can recall the false-positive class and avoid broad AST rewrites that mutate user-defined props or local objects just because they share an AI SDK field name.

Full contribution summary and Kage metrics: kage-core/Kage#8

@lgrammel

Copy link
Copy Markdown
Collaborator

Thank you for the pull request. Issue #8340 was closed as completed. Closing this pull request.

@lgrammel lgrammel closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive in v5/rename-reasoning-to-reasoningText codemod

2 participants