WasmExecutor improvements for portability, package handling, and logging #1856
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 strengthens the WasmExecutor’s portability, standard-library handling, isolation, and failure visibility.
deno info --jsonand feed that path into the--allow-read/--allow-writeflags instead of hard-coding~/.cache/deno, which fixes macOS errors caused by Deno storing its cache under~/Library/Caches/deno. This makes the executor portable across Linux and macOS.find_free_port, inject that port into the runner JS/permission list, and poll the HTTP server for readiness (with logging and timeouts) so multiple WasmExecutors can coexist without collisions and we catch startup regressions immediately.json) by adding a Pyodide-sidegetMissingPackageshelper that filtersadditional_authorized_importsthroughimportlib.util.find_spec, so only truly missing packages reach micropip while stdlib entries remain listed in the agent's system prompt.micropip.destroy()afterward, and raising anAgentErroron the smolagents/Python side so agents now surface actionable errors instead of silently skipping dependency errors.deno --versionanddeno info --jsonplus the dynamic port helper, keeping the new cache-directory detection covered without touching real sockets or Deno installs.WasmExecutorcleanup tip so Deno sandboxes shut down cleanly after agent runs.Thank you for reviewing this PR, and especially for your feedback and support!