agentic_controller#
AgenticController: runs a CopilotCLIAgent for a fixed number of iterations.
Classes
|
Runs a |
- class kernelfoundry.algorithm.agentic_controller.AgenticController(run_config, job_id: int | None, task_id: int | None, copilot_exe: str = 'copilot', env_overrides: dict[str, str] | None = None, agent_timeout: float = 3600.0, logging_level: int | str | None = None, extra_mcp_servers: dict[str, dict] | None = None)[source]#
Runs a
CopilotCLIAgentfor a fixed number of iterations.- Parameters:
run_config – Hydra configuration object (must have
logdirandmax_iters).job_id – Job identifier passed through to the agent.
task_id – Task identifier (stored for reference).
copilot_exe – Path or name of the Copilot CLI binary.
env_overrides – Extra environment variables forwarded to the Copilot subprocess.
agent_timeout – Per-iteration timeout in seconds.
logging_level – Logging level for the file handler added by this controller.
extra_mcp_servers – Optional additional MCP server definitions merged into the agent configuration.
- __init__(run_config, job_id: int | None, task_id: int | None, copilot_exe: str = 'copilot', env_overrides: dict[str, str] | None = None, agent_timeout: float = 3600.0, logging_level: int | str | None = None, extra_mcp_servers: dict[str, dict] | None = None)[source]#
- static build_container_image_for_task(task: Task) Task[source]#
Build the container image for the given Task if
use_containeris True.Updates
task.config["container_image"]in-place and returns the task.
- create_program0(task: Task) Program[source]#
Create initial Program object for a Task.
- Parameters:
task – Task instance containing problem details.
- Returns:
Initial Program object built from the EVOLVE block.
- evolve_prompt(problem_name: str, ref_arch_src: str, trial: int, task: Task | None = None) tuple[str, Program | None][source]#
Construct a fresh prompt for a single branch and report the sampled parent.
- Parameters:
problem_name – Operation name
ref_arch_src – Reference source code
trial – Trial number (to pass to LLM server)
task – Custom task object that can provide the initial implementation
- Returns:
the prompt used for generation, and the parent program sampled from the database (
Noneif no parent was available). The parent’sididentifies the agent to fork in order to continue the search from it.- Return type:
A
(prompt, parent)pair