feat: add execution timeout support for isolated-vm JavaScript execution#4
Open
code-xpertai[bot] wants to merge 1 commit into
Open
feat: add execution timeout support for isolated-vm JavaScript execution#4code-xpertai[bot] wants to merge 1 commit into
code-xpertai[bot] wants to merge 1 commit into
Conversation
- Add optional timeout parameter to IWFNCode interface (default: 5000ms) - Add timeout parameter to SandboxVMCommand - Pass timeout to isolated-vm's script.run() method with bounds validation - Min: 100ms, Max: 60000ms, Default: 5000ms - Add UI controls in code workflow component for timeout configuration - Propagate timeout from workflow node to sandbox execution This addresses issue xpert-ai#234 where JavaScript execution in isolated-vm could hang indefinitely in Node.js 20 environment. Users can now configure a timeout to prevent indefinite hangs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds execution timeout support for JavaScript code execution in
isolated-vm, addressing issue xpert-ai#234 where script execution could hang indefinitely in Node.js 20 environment.Changes
Backend
IWFNCodeinterface: Added optionaltimeoutfield (in milliseconds) with documentationSandboxVMCommand: Addedtimeoutparameter to the command constructorSandboxVMHandler:isolated-vm'sscript.run()methodFrontend
Usage
Users can now configure a timeout for JavaScript code execution in workflow nodes:
The timeout is configured via the UI in the Code node panel, under the "Timeout" section.
Testing
Fixes xpert-ai#234