Skip to content

Fix flight alert email generation#64

Merged
punitarani merged 11 commits intomainfrom
cursor/fix-flight-alert-email-generation-1419
Nov 4, 2025
Merged

Fix flight alert email generation#64
punitarani merged 11 commits intomainfrom
cursor/fix-flight-alert-email-generation-1419

Conversation

@punitarani
Copy link
Owner

Fix AI-generated flight alerts showing 0 flights and blank emails by configuring the AI provider, adding the API key to the worker environment, and ensuring fallback rendering always displays flight data.

The previous implementation failed to properly initialize the AI provider with the necessary API key in the worker context, and its fallback mechanism replaced all content with a generic message instead of showing available flight details. This PR addresses these issues to ensure robust and informative email alerts, updates the AI model to openai/gpt-5-mini, and centralizes environment variable access via env.ts.


Open in Cursor Open in Web

cursoragent and others added 6 commits October 31, 2025 15:56
Co-authored-by: punitsai36 <punitsai36@gmail.com>
Co-authored-by: punitsai36 <punitsai36@gmail.com>
Co-authored-by: punitsai36 <punitsai36@gmail.com>
Co-authored-by: punitsai36 <punitsai36@gmail.com>
This update includes the latest version of the OpenAI SDK, ensuring compatibility and access to new features.

Co-authored-by: punitsai36 <punitsai36@gmail.com>
Co-authored-by: punitsai36 <punitsai36@gmail.com>
@cursor
Copy link

cursor bot commented Nov 1, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Nov 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
flights-tracker Ready Ready Preview Comment Nov 4, 2025 9:03pm

Co-authored-by: punitsai36 <punitsai36@gmail.com>
- Synced bun.lock with @ai-sdk/openai@^2.0.59
- Resolved lockfile frozen error
- Downgrade zod from v4.1.11 to v3.23.8 for wrangler compatibility
- Replace z.enum() with z.nativeEnum() for TypeScript enums
- Fix z.discriminatedUnion nesting in PlannerContextSchema
- Fix error message syntax in filters (error -> invalid_type_error)
- Fix PROXY_ENABLED default ordering with transform
- Fix z.url() to z.string().url() for zod v3
- Update script to handle null blueprint return values
- Clean install node_modules to resolve esbuild conflicts

This fixes build errors caused by incompatibility between wrangler 4
and zod v4, specifically with enum handling in miniflare.
- Bump @ai-sdk/openai to v2.0.62 in package.json and bun.lock
- Update @ai-sdk/provider-utils to v3.0.16 for compatibility
- Refactor email rendering code for better readability
- Clean up schema definitions in PlannerContextSchema and FlightSegmentSchema for improved clarity
@punitarani punitarani merged commit 2470f3f into main Nov 4, 2025
12 checks passed
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.

2 participants