Skip to content

Add SkillExecutor.HostedCodeInterpreter() skill script execution mode #4131

@SergeyMenshykh

Description

@SergeyMenshykh

Summary

Add support for executing agent skill scripts via the LLM's hosted code interpreter, encapsulated as SkillExecutor.HostedCodeInterpreter().

Background

The current agent skills functionality in FileAgentSkillsProvider handles skill loading and skill resource loading. Script execution is not yet supported as a configurable capability. This is the first of three planned execution modes:

  1. SkillExecutor.HostedCodeInterpreter() ← this issue
  2. SkillExecutor.External() — user-provided executor (future)
  3. SkillExecutor.Hybrid() — conditional routing between the two (future)

Requirements

  • Introduce SkillExecutor as an abstract class that defines the contract for all execution modes:
    • Abstract/virtual members for providing instructions and tools to the agent.
    • A static HostedCodeInterpreter() factory method that returns a concrete subclass instance.
  • The HostedCodeInterpreter mode (concrete sealed subclass) must:
    • Provide instructions that direct the LLM to use read_skill_resource for loading scripts and the hosted code interpreter for execution.
    • Register HostedCodeInterpreterTool as a provided tool.
    • Handle tool invocations at runtime.
  • FileAgentSkillsProvider should have script execution disabled by default.
  • When the provider's options include an executor (e.g., Executor = SkillExecutor.HostedCodeInterpreter()), the provider obtains instructions and tools from the executor via its public instance methods.
  • Add a sample project Agent_Step02_ScriptExecutionWithCodeInterpreter demonstrating usage of this execution mode.

Acceptance Criteria

  • SkillExecutor abstract class created with public abstract/virtual members for instructions and tools
  • HostedCodeInterpreter() static factory method on SkillExecutor returns a sealed concrete subclass
  • HostedCodeInterpreter mode provides instructions and registers HostedCodeInterpreterTool
  • FileAgentSkillsProvider script execution is off by default
  • Setting the executor on provider options enables script execution with mode-specific instructions and tools
  • Unit tests cover mode initialization, instruction/tool provisioning, and provider integration
  • Design supports future External() and Hybrid() modes without breaking changes
  • Agent_Step02_ScriptExecutionWithCodeInterpreter sample project added

Part of #3499

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions