Skip to content

fix(wand): nodejs streaming#1191

Merged
Sg312 merged 2 commits intostagingfrom
fix/wand
Aug 29, 2025
Merged

fix(wand): nodejs streaming#1191
Sg312 merged 2 commits intostagingfrom
fix/wand

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 29, 2025

Summary

Switches streaming approach

Type of Change

  • Bug fix

Testing

Local testing

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Aug 29, 2025 10:47pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 29, 2025 10:47pm

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.

Greptile Summary

This PR addresses runtime compatibility issues in the wand-generate API endpoint by switching from the Edge Runtime to Node.js runtime. The wand-generate endpoint appears to be responsible for AI-powered content generation, likely using GPT-4 models through OpenAI or Azure OpenAI services.

The main changes include:

  1. Runtime Change: Modified the export from runtime = 'edge' to runtime = 'nodejs' to leverage Node.js streaming capabilities and avoid Edge Runtime limitations
  2. Timeout Removal: Eliminated AbortController-based timeout mechanisms that were causing compatibility issues in the edge environment
  3. Enhanced Error Handling: Added a safeStringify helper function to handle complex error objects that may not serialize properly with standard JSON.stringify
  4. Streaming Improvements: Added 'Transfer-Encoding': 'chunked' header to ensure proper streaming behavior in the Node.js runtime
  5. Better Logging: Enhanced error logging to provide more detailed information when requests fail

This change integrates with Sim's AI workflow system, where the wand feature likely provides intelligent content generation or suggestions within the platform's block-based workflow builder. The switch to Node.js runtime should resolve streaming and timeout issues that users may have experienced when using AI generation features.

PR Description Notes:

  • The PR template is incomplete with no specific description, issue reference, testing information, or checklist completion
  • Missing details about what specific issues this fixes or how it was tested

Confidence score: 3/5

  • This PR addresses a specific runtime compatibility issue but removes important timeout protection without replacement
  • Score reflects the runtime change being beneficial while timeout removal introduces potential hanging request risks
  • Pay close attention to the timeout mechanism removal and ensure proper request cancellation is still possible

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@Sg312 Sg312 merged commit 056dc28 into staging Aug 29, 2025
4 of 5 checks passed
@Sg312 Sg312 changed the title Fix/wand fix(wand): nodejs streaming Aug 29, 2025
waleedlatif1 pushed a commit that referenced this pull request Aug 29, 2025
* Switch to node

* Refactor
Sg312 added a commit that referenced this pull request Aug 30, 2025
* Switch to node

* Refactor
waleedlatif1 pushed a commit that referenced this pull request Sep 1, 2025
* Switch to node

* Refactor
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* Switch to node

* Refactor
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.

1 participant