Configuration Module

Configuration package - uses varlord for config management.

IMPORTANT: All configuration models are defined in models.py. No module should define its own config model. All modules access the same AtloopConfig model for type safety.

class atloop.config.ConfigLoader[source]

Bases: object

Configuration loader - uses varlord for lib/api.

static get() AtloopConfig[source]

Get configuration - access from anywhere in lib/api.

Returns:

Loaded AtloopConfig instance (type-safe, validated against AtloopConfig model)

Raises:
  • KeyError – If config not initialized (call setup() first)

  • RequiredFieldError – If required fields missing (varlord validation)

  • TypeError – If types don’t match model (varlord validation)

static setup(atloop_dir: str | None = None) Config[source]

Setup configuration - call once at application startup.

Parameters:

atloop_dir – Custom atloop directory (for testing)

Returns:

Config instance (also registered globally)

class atloop.config.AtloopConfig(ai: ~atloop.config.models.AIConfig, sandbox: ~atloop.config.models.SandboxConfig = <factory>, default_budget: ~atloop.config.models.Budget = <factory>, memory: ~atloop.config.models.MemoryConfig = <factory>, runs_dir: str = 'runs', skills_dirs: ~typing.List[str] = <factory>, mcp_config_path: str | None = None, stuck_signature_repeats: int = 3)[source]

Bases: object

Main atloop configuration.

__init__(ai: ~atloop.config.models.AIConfig, sandbox: ~atloop.config.models.SandboxConfig = <factory>, default_budget: ~atloop.config.models.Budget = <factory>, memory: ~atloop.config.models.MemoryConfig = <factory>, runs_dir: str = 'runs', skills_dirs: ~typing.List[str] = <factory>, mcp_config_path: str | None = None, stuck_signature_repeats: int = 3) None
__post_init__()[source]

Validate configuration.

mcp_config_path: str | None = None
runs_dir: str = 'runs'
stuck_signature_repeats: int = 3
ai: AIConfig
sandbox: SandboxConfig
default_budget: Budget
memory: MemoryConfig
skills_dirs: List[str]

ConfigLoader

class atloop.config.loader.ConfigLoader[source]

Bases: object

Configuration loader - uses varlord for lib/api.

static setup(atloop_dir: str | None = None) Config[source]

Setup configuration - call once at application startup.

Parameters:

atloop_dir – Custom atloop directory (for testing)

Returns:

Config instance (also registered globally)

static get() AtloopConfig[source]

Get configuration - access from anywhere in lib/api.

Returns:

Loaded AtloopConfig instance (type-safe, validated against AtloopConfig model)

Raises:
  • KeyError – If config not initialized (call setup() first)

  • RequiredFieldError – If required fields missing (varlord validation)

  • TypeError – If types don’t match model (varlord validation)

Configuration Models

class atloop.config.models.AtloopConfig(ai: ~atloop.config.models.AIConfig, sandbox: ~atloop.config.models.SandboxConfig = <factory>, default_budget: ~atloop.config.models.Budget = <factory>, memory: ~atloop.config.models.MemoryConfig = <factory>, runs_dir: str = 'runs', skills_dirs: ~typing.List[str] = <factory>, mcp_config_path: str | None = None, stuck_signature_repeats: int = 3)[source]

Bases: object

Main atloop configuration.

ai: AIConfig
sandbox: SandboxConfig
default_budget: Budget
memory: MemoryConfig
runs_dir: str = 'runs'
skills_dirs: List[str]
mcp_config_path: str | None = None
stuck_signature_repeats: int = 3
__post_init__()[source]

Validate configuration.

__init__(ai: ~atloop.config.models.AIConfig, sandbox: ~atloop.config.models.SandboxConfig = <factory>, default_budget: ~atloop.config.models.Budget = <factory>, memory: ~atloop.config.models.MemoryConfig = <factory>, runs_dir: str = 'runs', skills_dirs: ~typing.List[str] = <factory>, mcp_config_path: str | None = None, stuck_signature_repeats: int = 3) None
class atloop.config.models.TaskSpec(task_id: str, goal: str, workspace_root: str, constraints: ~typing.List[str] = <factory>, budget: ~atloop.config.models.Budget = <factory>, task_type: str = 'bugfix')[source]

Bases: object

Task specification.

task_id: str
goal: str
workspace_root: str
constraints: List[str]
budget: Budget
task_type: str = 'bugfix'
__post_init__()[source]

Validate task specification.

__init__(task_id: str, goal: str, workspace_root: str, constraints: ~typing.List[str] = <factory>, budget: ~atloop.config.models.Budget = <factory>, task_type: str = 'bugfix') None
class atloop.config.models.Budget(max_llm_calls: int = 80, max_tool_calls: int = 300, max_wall_time_sec: int = 1800)[source]

Bases: object

Budget constraints for task execution.

max_llm_calls: int = 80
max_tool_calls: int = 300
max_wall_time_sec: int = 1800
to_dict() dict[source]

Convert Budget to dictionary.

__init__(max_llm_calls: int = 80, max_tool_calls: int = 300, max_wall_time_sec: int = 1800) None
class atloop.config.models.SandboxConfig(base_url: str | None = None, local_test: bool = False, timeout: int = 30, session_ttl_seconds: int = 900, image: str | None = None, cpu_limit: str | None = None, memory_limit: str | None = None, ephemeral_storage_limit: str | None = None)[source]

Bases: object

Sandbox execution configuration.

base_url: str | None = None
local_test: bool = False
timeout: int = 30
session_ttl_seconds: int = 900
image: str | None = None
cpu_limit: str | None = None
memory_limit: str | None = None
ephemeral_storage_limit: str | None = None
__post_init__()[source]

Validate configuration.

__init__(base_url: str | None = None, local_test: bool = False, timeout: int = 30, session_ttl_seconds: int = 900, image: str | None = None, cpu_limit: str | None = None, memory_limit: str | None = None, ephemeral_storage_limit: str | None = None) None