Skip to content

Conversation

@stonewerner
Copy link
Contributor

@stonewerner stonewerner commented Nov 20, 2025

everything seems to work fine besides agentic inline citations do not link to the proper sources. they link to the conversation page, not the parallel route that opens the drawer

nwp and others added 3 commits October 15, 2025 12:50
🚀 MAJOR UPGRADE: Migrated entire codebase from AI SDK v4 to v5

Core AI SDK Updates:
- ai: ^4.2.2 → ^5.0.71 (major version upgrade)
- @ai-sdk/anthropic: ^1.2.1 → ^2.0.29
- @ai-sdk/google: ^1.2.2 → ^2.0.23
- @ai-sdk/groq: ^1.2.7 → ^2.0.24
- @ai-sdk/openai: ^1.3.1 → ^2.0.52
- @ai-sdk/react: ^1.2.1 → ^2.0.71

Critical Breaking Changes Addressed:
✅ Message structure: content string → parts array pattern
✅ Custom UIMessage types: Created MyUIMessage & ExtendedUIMessage
✅ Message conversion: Bidirectional v4↔v5 compatibility layer
✅ Backward compatibility: Runtime message transformation system

Zod v4 Compatibility Resolution:
- zod: ^3.23.8 → ^4.1.12 (major version upgrade)
- @hookform/resolvers: ^3.9.1 → ^5.2.2 (Zod v4 support)
- react-hook-form: ^7.54.0 → ^7.65.0 (latest compatibility)
- Fixed all zod/v3 imports → zod imports across codebase
- Resolved TypeScript form resolver type inference issues

Stripe Ecosystem Updates:
- @stripe/react-stripe-js: ^3.7.0 → ^5.2.0 (Zod v4 compatible)
- @stripe/stripe-js: Added ^8.0.0 (peer dependency requirement)

Other Dependencies:
- ragie: ^1.12.0 → ^1.12.2 (eliminated zod peer dependency)

Architecture Improvements:
📁 lib/types/messages.ts - Custom AI SDK v5 message types
📁 lib/types/ai-sdk-v4-legacy.ts - Extracted v4 types (eliminated ai-legacy)
📁 lib/message-utils.ts - Backward compatibility utilities
📁 lib/convert-messages.ts - Bidirectional message conversion system

Key Files Updated:
- 43 source files updated across app/, components/, lib/
- All message.content access patterns → message parts array
- All form validation updated for Zod v4 compatibility
- Comprehensive type safety maintained throughout migration

Migration Outcomes:
✅ Zero TypeScript compilation errors
✅ Complete backward compatibility with existing data
✅ npm install works without --legacy-peer-deps
✅ All peer dependency conflicts resolved
✅ Production build successful
✅ Full AI SDK v5 feature compatibility

This migration maintains 100% backward compatibility while unlocking
all AI SDK v5 features and resolving dependency conflicts.
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.

3 participants