You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for executing agent skill scripts via a user-provided executor, encapsulated as SkillExecutor.External().
Background
With the SkillExecutor abstract class and HostedCodeInterpreter mode established in #4131, this issue adds the second execution mode where script execution is delegated to a user/developer-provided callback. This is the second of three planned execution modes:
SkillExecutor.Hybrid() — conditional routing between the two (future)
Requirements
Add a static External() factory method on SkillExecutor that accepts a user-provided execution delegate/predicate and returns a concrete sealed subclass instance.
The External mode (concrete sealed subclass) must:
Provide instructions that direct the LLM to call the execute_script tool for script execution.
Register an execute_script tool as a provided tool.
When execute_script is invoked, delegate execution to the user-provided callback, passing relevant context (script content, skill name, etc.).
The user-provided delegate should receive sufficient context to execute the script and return a result.
Add a sample project Agent_Step03_ScriptExecutionWithExternalExecutor demonstrating usage of this execution mode.
The execute_script tool should be wrapped with ApprovalRequiredAIFunction by default to require user approval before executing scripts externally.
The External() factory method should accept an optional parameter to disable approval (e.g., requireApproval: bool = true). When enabled: new
ApprovalRequiredAIFunction(AIFunctionFactory.Create(executeScript)). When disabled, the tool is registered directly.
Acceptance Criteria
External() static factory method on SkillExecutor accepts a user-provided execution delegate
External mode is a sealed concrete subclass of SkillExecutor
External mode provides instructions directing the LLM to use execute_script
External mode registers an execute_script tool
execute_script tool invocations delegate to the user-provided callback
Unit tests cover mode initialization, instruction/tool provisioning, and delegate invocation
Integration with FileAgentSkillsProvider works consistently with the HostedCodeInterpreter mode
Summary
Add support for executing agent skill scripts via a user-provided executor, encapsulated as
SkillExecutor.External().Background
With the
SkillExecutorabstract class andHostedCodeInterpretermode established in #4131, this issue adds the second execution mode where script execution is delegated to a user/developer-provided callback. This is the second of three planned execution modes:SkillExecutor.HostedCodeInterpreter()— LLM code interpreter (AddSkillExecutor.HostedCodeInterpreter()skill script execution mode #4131)SkillExecutor.External()← this issueSkillExecutor.Hybrid()— conditional routing between the two (future)Requirements
External()factory method onSkillExecutorthat accepts a user-provided execution delegate/predicate and returns a concrete sealed subclass instance.Externalmode (concrete sealed subclass) must:execute_scripttool for script execution.execute_scripttool as a provided tool.execute_scriptis invoked, delegate execution to the user-provided callback, passing relevant context (script content, skill name, etc.).ApprovalRequiredAIFunction(AIFunctionFactory.Create(executeScript)). When disabled, the tool is registered directly.
Acceptance Criteria
External()static factory method onSkillExecutoraccepts a user-provided execution delegateExternalmode is a sealed concrete subclass ofSkillExecutorExternalmode provides instructions directing the LLM to useexecute_scriptExternalmode registers anexecute_scripttoolexecute_scripttool invocations delegate to the user-provided callbackFileAgentSkillsProviderworks consistently with theHostedCodeInterpretermodePart of #3499
Depends on #4131