Factory & Backends¶
Backend Factory¶
backends
¶
Backend registry and factory.
create_backend(name, *, harness, **kwargs)
¶
Create a backend instance by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Backend name ("podman" or "openshell"). |
required |
harness
|
Harness
|
Agent harness instance. |
required |
**kwargs
|
Any
|
Backend-specific arguments (workdir, image, policy, timeout, etc.).
|
{}
|
Returns:
| Type | Description |
|---|---|
Backend
|
A Backend instance. |
Source code in src/agentic_ci/backends/__init__.py
Local Backend¶
local
¶
Local (direct execution) backend for agentic-ci.
LocalBackend(workdir='.', extra_env=None, *, harness)
¶
Bases: Backend
Runs an AI agent directly in the local environment.
No container or sandbox — the agent binary must already be installed and accessible on PATH. Useful when agentic-ci is running inside an existing CI container (e.g. Prow) where an extra isolation layer is unnecessary.
The agent runs as the host user with the host environment, so there is
no sandbox boundary to protect and the workdir's .git is not
restored after the run, unlike the Podman and OpenShell backends.
Source code in src/agentic_ci/backends/local.py
Podman Backend¶
podman
¶
Podman container backend for agentic-ci.
PodmanBackend(workdir='.', image=None, timeout=1200, extra_env=None, *, harness)
¶
Bases: Backend
Runs an AI agent inside a persistent Podman container.
setup() creates a long-running detached container. run() execs
the agent inside it. stop() tears it down. The work directory is
mounted into the container and gcloud credentials are mounted
read-only. The host's git control files (.git/config, hooks,
info/) are recorded each time the container starts. After each run
the container is stopped, which kills every process the agent left
behind, and the host copy is restored and released; the next run records
the host copy again (keeping host edits made between runs) and starts the
container again.