Skip to content

improvement/function: remove unused function execution logic in favor of vm, update turborepo#980

Merged
waleedlatif1 merged 4 commits into
stagingfrom
improvement/function
Aug 15, 2025
Merged

improvement/function: remove unused function execution logic in favor of vm, update turborepo#980
waleedlatif1 merged 4 commits into
stagingfrom
improvement/function

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

  • improvement(function): remove freestyle in favor of vm exec
  • update imports
  • remove unused test suite
  • update turborepo

Summary

  • remove previously used freestyle logic since we now only use the vm, remove corresponding logic/pkg/tests

Type of Change

  • Other: cleanup

Testing

No functional changes.

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
Copy Markdown

vercel Bot commented Aug 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Building Building Preview Comment Aug 15, 2025 7:49pm
sim Building Building Preview Comment Aug 15, 2025 7:49pm

Copy link
Copy Markdown
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 removes the Freestyle execution system in favor of standardizing on VM-based code execution throughout the codebase. The changes eliminate a dual execution path architecture where the system previously supported both Freestyle (a third-party sandbox service) and Node.js VM execution methods.

The core changes include:

  • Complete removal of Freestyle infrastructure: Deletes apps/sim/lib/freestyle.ts which contained the FreestyleSandboxes client singleton and executeCode function with package dependency extraction, code wrapping, and execution logic
  • Dependency cleanup: Removes the freestyle-sandboxes package dependency from apps/sim/package.json and eliminates the FREESTYLE_API_KEY environment variable from configuration files (env.ts, docker-compose files)
  • API route simplification: Removes 144+ lines of commented-out Freestyle execution code from the function execution route, leaving only the VM execution path active
  • Test suite reduction: Removes extensive Freestyle-related test cases including the entire 'Freestyle Execution' test suite, 'VM Execution' fallback tests, and Freestyle-specific template variable edge cases
  • Turborepo maintenance update: Bumps Turborepo from 2.5.5 to 2.5.6 as part of the cleanup effort

The remaining VM execution system provides secure code execution through Node.js's built-in VM module with proper context isolation, environment variable injection, console logging capture, and error handling. This architectural simplification reduces external dependencies, eliminates API key management overhead, removes fallback complexity, and standardizes the codebase on a single, reliable execution method.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it removes already-disabled functionality and unused dependencies
  • Score reflects that the changes are pure cleanup of commented-out code and unused infrastructure with no functional impact
  • No files require special attention since all changes are straightforward removals of unused code paths

8 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 7a17112 into staging Aug 15, 2025
2 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/function branch August 15, 2025 19:51
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
… of vm, update turborepo (simstudioai#980)

* improvement(function): remove freestyle in favor of vm exec

* update imports

* remove unused test suite

* update turborepo
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