kodeagent.code_runner.HostCodeRunnerEnv#
- class kodeagent.code_runner.HostCodeRunnerEnv(work_dir: str | None = None)[source]#
Execution environment for the local host.
Initialize the code runner environment.
- Parameters:
work_dir – Optional local workspace directory. Output files from code execution will be stored here. It will be used only if the path already exists. Otherwise, a temporary directory will be created.
- __init__(work_dir: str | None = None)#
Initialize the code runner environment.
- Parameters:
work_dir – Optional local workspace directory. Output files from code execution will be stored here. It will be used only if the path already exists. Otherwise, a temporary directory will be created.
Methods
__init__([work_dir])Initialize the code runner environment.
cleanup()Clean up environment resources.
download_files_from_remote(remote_paths)On host, files are already local.
run(source_code, task_id, timeout)Execute Python code on the local host.
Attributes
effective_work_dirReturn the effective working directory specified or creating a temporary one if needed.