Skip to content

Comments

updates AI SDK to beta 5#1868

Closed
adamghaida wants to merge 3 commits intostagingfrom
07-28-update-AI-sdk
Closed

updates AI SDK to beta 5#1868
adamghaida wants to merge 3 commits intostagingfrom
07-28-update-AI-sdk

Conversation

@adamghaida
Copy link
Member

@adamghaida adamghaida commented Jul 29, 2025

Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature with breaking changes)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔒 Security enhancement
  • ⚡ Performance improvement

Areas Affected

Please check all that apply:

  • Email Integration (Gmail, IMAP, etc.)
  • User Interface/Experience
  • Authentication/Authorization
  • Data Storage/Management
  • API Endpoints
  • Documentation
  • Testing Infrastructure
  • Development Workflow
  • Deployment/Infrastructure

Testing Done

Describe the tests you've done:

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Cross-browser testing (if UI changes)
  • Mobile responsiveness verified (if UI changes)

Security Considerations

For changes involving data or authentication:

  • No sensitive data is exposed
  • Authentication checks are in place
  • Input validation is implemented
  • Rate limiting is considered (if applicable)

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • All tests pass locally
  • Any dependent changes are merged and published

Additional Notes

Add any other context about the pull request here.

Screenshots/Recordings

Add screenshots or recordings here if applicable.


By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.


Summary by cubic

Upgraded the AI SDK and related dependencies to beta 5, updating Zero Agent code to match new APIs.

  • Dependencies

    • Updated packages in mail and server apps to the latest AI SDK beta versions.
    • Updated agents and hono-agents packages for compatibility.
  • Refactors

    • Updated Zero Agent to use new message conversion and API methods from the latest SDK.

Summary by CodeRabbit

  • Chores

    • Updated several AI-related dependencies to newer beta versions for improved compatibility and features.
    • Upgraded supporting packages to the latest versions.
  • Bug Fixes

    • Improved message handling in agent responses to ensure better formatting and reliability.

@jazzberry-ai
Copy link

jazzberry-ai bot commented Jul 29, 2025

This repository is associated with MrgSub whose free trial has ended. Subscribe at jazzberry.ai.
If this is an error contact us at support@jazzberry.ai.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

Dependency versions for AI SDKs were updated in apps/mail/package.json and apps/server/package.json. The ZeroAgent class in apps/server/src/routes/agent/index.ts now wraps messages with convertToCoreMessages before streaming, altering the message formatting for AI text generation.

Changes

Cohort / File(s) Change Summary
Mail App AI SDK Dependency Updates
apps/mail/package.json
Upgraded ai and @ai-sdk/react to beta versions; added @ai-sdk/openai at beta version.
Server Dependency Updates
apps/server/package.json
Updated agents and hono-agents packages to newer versions.
ZeroAgent Message Formatting
apps/server/src/routes/agent/index.ts
Imported convertToCoreMessages and used it to wrap messages before passing to streamText.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ZeroAgent
    participant AI_SDK

    Client->>ZeroAgent: Request data stream
    ZeroAgent->>ZeroAgent: Process messages
    ZeroAgent->>ZeroAgent: convertToCoreMessages(processedMessages)
    ZeroAgent->>AI_SDK: streamText(messages=coreMessages)
    AI_SDK-->>ZeroAgent: Streamed text response
    ZeroAgent-->>Client: Return streamed response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

content

Poem

🚀 Upgrading code, the future’s in sight,
New betas installed, dependencies light.
Messages converted, the stream flows anew—
AI’s in motion, with a fresh point of view.
ZeroAgent’s ready, let’s launch and ignite!

(To Mars and beyond, one commit at a time!)

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 07-28-update-AI-sdk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 3 files. Review in cubic

@coderabbitai coderabbitai bot added the content label Jul 29, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 762895a and b8b7d31.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/mail/package.json (2 hunks)
  • apps/server/package.json (2 hunks)
  • apps/server/src/routes/agent/index.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/package.json

📄 CodeRabbit Inference Engine (AGENT.md)

Workspace packages use catalog versioning for shared dependencies

Files:

  • apps/server/package.json
  • apps/mail/package.json
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (AGENT.md)

**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes
Limit lines to 100 characters in width
Semicolons are required

Files:

  • apps/server/src/routes/agent/index.ts
**/*.{js,jsx,ts,tsx,css}

📄 CodeRabbit Inference Engine (AGENT.md)

Use Prettier with sort-imports and Tailwind plugins

Files:

  • apps/server/src/routes/agent/index.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (AGENT.md)

Enable TypeScript strict mode

Files:

  • apps/server/src/routes/agent/index.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: JagjeevanAK
PR: Mail-0/Zero#1583
File: apps/docs/package.json:1-0
Timestamp: 2025-07-01T12:53:32.495Z
Learning: The Zero project prefers to handle dependency updates through automated tools like Dependabot rather than immediate manual updates, allowing for proper testing and validation through their established workflow.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
Learnt from: adamghaida
PR: Mail-0/Zero#1661
File: apps/server/src/routes/organization.ts:55-69
Timestamp: 2025-07-08T20:12:26.073Z
Learning: The user adamghaida prefers to defer security and authorization implementation to later phases of development rather than addressing them immediately during initial feature development in the Zero project.
apps/server/package.json (1)

Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-07-21T20:24:46.841Z
Learning: Applies to **/package.json : Workspace packages use catalog versioning for shared dependencies

apps/mail/package.json (2)

Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-07-21T20:24:46.841Z
Learning: Applies to **/package.json : Workspace packages use catalog versioning for shared dependencies

Learnt from: JagjeevanAK
PR: #1583
File: apps/docs/package.json:1-0
Timestamp: 2025-07-01T12:53:32.495Z
Learning: The Zero project prefers to handle dependency updates through automated tools like Dependabot rather than immediate manual updates, allowing for proper testing and validation through their established workflow.

🔇 Additional comments (2)
apps/server/src/routes/agent/index.ts (2)

22-22: Excellent neural network interface upgrade! 🧠⚡

Adding the convertToCoreMessages import - this is exactly the kind of forward-thinking API adaptation we need. Like upgrading from analog to digital flight controls.


1806-1806: Perfect message transformation implementation! 🚀

This convertToCoreMessages wrapper is a brilliant adaptation to the new AI SDK beta API. It's like adding a proper interface layer between our flight computer and the new rocket engine - ensures clean data flow and compatibility.

The implementation is clean, follows the new SDK patterns, and maintains backward compatibility with the rest of the system. This is exactly how you handle major version upgrades in mission-critical software.

"machine-translate": "inlang machine translate --project project.inlang"
},
"dependencies": {
"@ai-sdk/openai": "2.0.0-beta.12",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Beta software deployment - this is like launching a Starship prototype! 🚀

These AI SDK updates to beta versions look solid for advancing our neural net capabilities, but we're essentially flying experimental software here. Beta 5 is cutting-edge stuff - like testing a new Raptor engine design.

A few engineering concerns from mission control:

  1. Beta stability risk: These are beta versions (2.0.0-beta.12, 2.0.0-beta.28, 5.0.0-beta.28) which could have unexpected behavior changes. In rocket terms, this is like using untested fuel mixtures.

  2. Catalog versioning deviation: The coding guidelines specify that workspace packages should use catalog versioning for shared dependencies, but these AI SDK packages are using explicit versions. We should either add these to the catalog or document why they're exceptions.

  3. Coordination with Dependabot: The retrieved learnings show this project prefers automated dependency updates through Dependabot. Manual beta upgrades might bypass their testing workflow.

Consider coordinating with the team on the beta rollout strategy and ensuring proper testing coverage before this reaches production.

Also applies to: 18-18, 57-57


Alright, let’s fire up the diagnostics and see what’s under the hood:


🏁 Script executed:

#!/bin/bash
echo "🔍 Searching for 'catalog' in JSON files..."
rg -l '"catalog"' -g '*.json' || echo "⚠️ No catalog entries found"

echo "🔍 Checking for Dependabot config in .github..."
if [ -f .github/dependabot.yml ]; then 
  echo "✅ Found .github/dependabot.yml"
else 
  echo "⚠️ No .github/dependabot.yml detected"
fi

echo "🔍 Scanning all YAML files for ‘dependabot’ references..."
rg -l 'dependabot' -g '*.yml' || echo "⚠️ No Dependabot mentions in YML files"

echo "🔍 Searching for @ai-sdk/openai across all package.json..."
rg -n '"@ai-sdk/openai"' -g '*.json' || echo "⚠️ No occurrences of @ai-sdk/openai found elsewhere"

echo "🔍 Checking for workspaces in root package.json..."
rg -n '"workspaces"' -g 'package.json' || echo "⚠️ No workspaces field in root package.json"

Length of output: 1206


🚀 Beta AI SDK Upgrade – Proceed with Caution

These beta bumps push us toward the edge of innovation—like testing a new Raptor engine. A few mission-control notes:

• Stability Risk: Upgrading to 2.0.0-beta.12 (and companion beta packages) can introduce breaking changes. Ensure you’ve got robust E2E and integration tests before rollout.
• Version Drift: I spotted @ai-sdk/openai at ^1.3.21 in apps/server/package.json while apps/mail is on 2.0.0-beta.12. Align or isolate those so you’re not flying two different engines simultaneously.
• Catalog/Workspace Protocol: No workspaces field or catalog entries were detected in the repo—so shared-dependency versioning rules don’t currently apply.
• Dependency Automation: There’s no Dependabot config in .github or any YAML, so these bumps are fully manual. Consider adding an automated update pipeline if you want continuous beta-feed.

Next steps:

  • Verify test coverage for all beta paths.
  • Decide whether to unify the SDK version across services.
  • Optional: introduce Dependabot (or similar) for smoother future updates.
🤖 Prompt for AI Agents
In apps/mail/package.json at line 16, the @ai-sdk/openai dependency is upgraded
to version 2.0.0-beta.12, which is a beta release and may introduce breaking
changes. To fix this, ensure you have comprehensive end-to-end and integration
tests covering all beta features before deploying. Also, check the version used
in apps/server/package.json (currently ^1.3.21) and decide whether to align both
services to the same SDK version or isolate them to avoid conflicts. Optionally,
consider adding a Dependabot or similar automation config in the .github
directory to manage future dependency updates more smoothly.

"@upstash/ratelimit": "^2.0.5",
"@upstash/redis": "^1.34.9",
"agents": "0.0.106",
"agents": "0.0.109",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Mars-level coordination issue detected! 🚀

The internal packages got bumped to newer versions, which is fantastic - like upgrading your Raptor engines. However, I'm seeing a concerning inconsistency here. The ai package is still at ^4.3.13 in the server package, but the mail package shows it updated to 5.0.0-beta.28.

This is like having different versions of the flight computer software across your rocket stages - not optimal for a successful orbital insertion, if you know what I mean.

Let me run a quick verification to check for version consistency across the workspace:

Also applies to: 63-63


🏁 Script executed:

#!/bin/bash
# Check AI SDK package versions across the workspace
echo "=== AI SDK package versions across workspace ==="
fd package.json --exec grep -H '"ai":\|"@ai-sdk' {} \;
echo ""
echo "=== Checking for version catalog usage ==="
fd package.json --exec grep -H 'catalog:' {} \;

Length of output: 2295


Align AI SDK Versions Across the Workspace

We’ve uncovered a clear version mismatch that will hamper our launch:

• apps/mail/package.json
– “ai”: 5.0.0-beta.28
– “@ai-sdk/openai”: 2.0.0-beta.12
– “@ai-sdk/react”: 2.0.0-beta.28

• apps/server/package.json
– “ai”: ^4.3.13
– “@ai-sdk/openai”: ^1.3.21
– “@ai-sdk/anthropic”: 1.2.12
– “@ai-sdk/google”: ^1.2.18

Action Items:

  1. Bump apps/server/package.json “ai” to 5.0.0-beta.28 to match apps/mail.
  2. Upgrade all @ai-sdk/* packages in apps/server to their beta-5 equivalents (e.g., openai → 2.0.0-beta.x).
  3. Switch these shared dependencies to use the root version catalog (use "catalog:"), per workspace conventions, so future bumps happen in one place.
  4. Verify root catalog defines the AI SDK beta-5 line items.

Let’s get all stages firing the same engines—smooth orbit injection awaits.

🤖 Prompt for AI Agents
In apps/server/package.json at line 47, the AI SDK versions are outdated and
inconsistent with apps/mail/package.json. Update the "ai" dependency to
"5.0.0-beta.28" and upgrade all "@ai-sdk/*" packages to their corresponding
beta-5 versions (e.g., "@ai-sdk/openai" to "2.0.0-beta.x"). Replace these
version strings with "catalog:" references to the root version catalog to
centralize version management. Ensure the root catalog includes the correct
beta-5 versions for all AI SDK dependencies.

@adamghaida adamghaida marked this pull request as draft July 30, 2025 10:06
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2025

This PR has merge conflicts and has been open for more than 3 days. It will be automatically closed. Please resolve the conflicts and reopen the PR if you'd like to continue working on it.

@github-actions github-actions bot closed this Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant