improvement/function: remove unused function execution logic in favor of vm, update turborepo#980
Conversation
There was a problem hiding this comment.
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.tswhich contained theFreestyleSandboxesclient singleton andexecuteCodefunction with package dependency extraction, code wrapping, and execution logic - Dependency cleanup: Removes the
freestyle-sandboxespackage dependency fromapps/sim/package.jsonand eliminates theFREESTYLE_API_KEYenvironment 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
… of vm, update turborepo (simstudioai#980) * improvement(function): remove freestyle in favor of vm exec * update imports * remove unused test suite * update turborepo
Summary
Type of Change
Testing
No functional changes.
Checklist