fix(wand): remove unstable__noStore and remove, add additional logs for wand generation#1133
fix(wand): remove unstable__noStore and remove, add additional logs for wand generation#1133waleedlatif1 merged 2 commits intostagingfrom
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR improves the reliability and observability of the wand generation streaming API endpoint by making several key architectural changes. The most significant change is the removal of the deprecated unstable_noStore function, which was previously used to prevent caching but is no longer needed since dynamic = 'force-dynamic' already handles this. The PR adds Edge Runtime support with export const runtime = 'edge', which should improve performance and reduce cold start times for AI generation operations.
The PR introduces comprehensive timeout and cancellation handling using AbortController, implementing a 30-second timeout to prevent hanging streams and proper client-side cancellation support. This addresses potential resource leaks and improves user experience when operations are cancelled. The streaming implementation is enhanced with detailed logging throughout the process, tracking chunk counts, usage data, and stream lifecycle events. These logs provide better visibility for debugging streaming operations and monitoring the health of AI generation requests.
The changes integrate well with the existing codebase architecture, following established patterns for API routes and leveraging the existing logging infrastructure. The Edge Runtime configuration aligns with Next.js best practices for AI/streaming endpoints that benefit from faster startup times.
Confidence score: 4/5
- This PR is safe to merge with minimal risk of breaking existing functionality
- Score reflects solid improvements to error handling and observability without touching core business logic
- Pay close attention to the streaming timeout behavior in production to ensure 30 seconds is appropriate for all use cases
1 file reviewed, no comments
…or wand generation (simstudioai#1133) * feat(wand): added additional logs for wand generation * remove unstable__noStore
Summary
remove unstable__noStore and remove, add additional logs for wand generation
Type of Change
Testing
Tested manually.
Checklist