Skip to content

feat: skills: support script execution#276

Merged
kalenkevich merged 10 commits intomainfrom
feat/skills_part4
Apr 20, 2026
Merged

feat: skills: support script execution#276
kalenkevich merged 10 commits intomainfrom
feat/skills_part4

Conversation

@kalenkevich
Copy link
Copy Markdown
Collaborator

@kalenkevich kalenkevich commented Apr 16, 2026

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

2. Or, if no issue exists, describe the change:

Problem:
Skill Execution Limitations: Skills lacked the ability to execute scripts (JavaScript, Python, Shell) with input files and capture generated output files. There was also no mechanism to execute inline code generated directly by the LLM.

Solution:

  1. Enhanced UnsafeLocalCodeExecutor:
    • Added support for writing input files to the temporary execution directory before script execution.
    • Added support for passing arguments to the executed scripts.
    • Implemented automatic detection and capture of output files created during execution, including mapping extensions to proper MIME types and encodings (e.g., JSON, CSV, images, PDFs).
  2. New Skill Tools:
    • Added RunSkillScriptTool to execute scripts that are part of a skill package.
    • Added RunSkillInlineScriptTool to execute inline code provided by the model.
  3. Comprehensive Testing:
    • Added unit tests for the new tools and the enhanced executor.
    • Added integration tests with mock responses to verify end-to-end execution for both JS and Shell scripts.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary of passed results:

  • Tests for UnsafeLocalCodeExecutor covering input/output handling and arguments.
  • Tests for RunSkillScriptTool and RunSkillInlineScriptTool.

Manual End-to-End (E2E) Tests:

Integration tests serve as E2E verification for script execution:

  • Verified JS script execution via integration tests in tests/integration/skills/script_js.
  • Verified Shell script execution via integration tests in tests/integration/skills/script_sh.
  • These tests verify that files generated by the scripts match expected outputs.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules. (N/A if self-contained)

Additional context

This PR significantly expands the capabilities of skills by allowing them to run complex scripts and produce artifacts.

@kalenkevich kalenkevich self-assigned this Apr 16, 2026
@kalenkevich kalenkevich changed the title Feat/skills part4 feat: skills: support script execution Apr 16, 2026
@kalenkevich kalenkevich force-pushed the feat/skills_part4 branch 2 times, most recently from cb47d45 to f6660bf Compare April 17, 2026 02:46
Comment thread core/src/code_executors/code_execution_utils.ts Outdated
Comment thread core/src/code_executors/unsafe_local_code_executor.ts Outdated
Comment thread core/src/code_executors/unsafe_local_code_executor.ts
Comment thread core/src/code_executors/unsafe_local_code_executor.ts
Comment thread core/src/code_executors/unsafe_local_code_executor.ts Outdated
Comment thread core/src/tools/skill/run_skill_script_tool.ts Outdated
Comment thread core/src/tools/skill/run_skill_script_tool.ts Outdated
Comment thread tests/integration/skills/script_sh/agent.ts Outdated
Comment thread tests/integration/tools/run_skill_script_tool_test.ts Outdated
@kalenkevich kalenkevich merged commit 8d5cc0a into main Apr 20, 2026
7 checks passed
@kalenkevich kalenkevich deleted the feat/skills_part4 branch April 20, 2026 19:20
@kalenkevich kalenkevich mentioned this pull request Apr 20, 2026
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.

3 participants