Skip to content

Add reasoning state support and enhanced message persistence#6

Open
nezzard wants to merge 2 commits into
vercel-labs:mainfrom
nezzard:reasoning-support
Open

Add reasoning state support and enhanced message persistence#6
nezzard wants to merge 2 commits into
vercel-labs:mainfrom
nezzard:reasoning-support

Conversation

@nezzard

@nezzard nezzard commented Aug 16, 2025

Copy link
Copy Markdown

Summary

This PR enhances the message persistence system by adding comprehensive support for reasoning parts and their state management, improving compatibility with modern AI SDK features.

Changes Made

1. Enhanced Database Schema ()

  • ✅ Added import for ReasoningUIPart type from AI SDK
  • ✅ Added state column for reasoning parts with proper typing
  • ✅ Maintains backward compatibility with existing data

2. Improved Message Mapping ()

  • ✅ Added state field support for text message parts
  • ✅ Added providerMetadata field support for text parts
  • ✅ Enhanced reasoning parts with state field mapping
  • ✅ Proper bidirectional conversion (UI ↔ Database)

Key Features

  • 🔄 Complete State Management: Full support for reasoning part states
  • 📊 Enhanced Metadata: Provider metadata support for better tracking
  • 🔒 Type Safety: Proper TypeScript typing for all new fields
  • Performance: Maintains efficient database operations
  • 🔄 Backward Compatible: Existing data remains unaffected

Testing

  • All existing functionality preserved
  • New fields are optional to maintain compatibility
  • Type-safe operations throughout the codebase

Use Case

This enhancement enables better tracking of AI reasoning processes and message states, which is essential for:

  • Debugging AI responses
  • Understanding reasoning flow
  • Better user experience with state indicators
  • Enhanced metadata tracking

Ready for review and merge! 🚀

@srinathshrestha

Copy link
Copy Markdown

look like this repo is abandoned !!

@RadoslavRadoev

Copy link
Copy Markdown

look like this repo is abandoned !!

I was wondering the same thing

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