fix(wand): remove edge runtime for wand#1132
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR removes the Edge Runtime configuration from the wand generation API endpoint (/api/wand-generate/route.ts) by deleting the line export const runtime = 'edge'. This change switches the API from running on Vercel's Edge Runtime to the standard Node.js runtime environment.
The wand generation endpoint is responsible for AI-powered workflow generation using OpenAI and Azure OpenAI clients. It implements streaming responses using ReadableStream and performs complex operations including session validation, prompt generation, and real-time response streaming to clients. The endpoint supports both OpenAI and Azure OpenAI backends based on configuration, with a maximum duration of 60 seconds and forced dynamic rendering.
This runtime change is significant because Edge Runtime operates with a restricted API surface and lacks access to Node.js APIs, while Node.js runtime provides full API access. The streaming implementation (lines 104-159) and the OpenAI/Azure OpenAI client usage likely encountered compatibility issues or limitations within the Edge Runtime constraints, necessitating this change to ensure proper functionality.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it addresses a compatibility issue
- Score reflects a straightforward configuration change to resolve runtime limitations
- Pay attention to the streaming response implementation and OpenAI client initialization
1 file reviewed, no comments
Summary
remove edge runtime for wand
Type of Change
Testing
Tested manually.
Checklist