Agent-box workflow internals
This page explains the runtime flow behind ab new and ab spawn.
Repository/workspace model
- Source repositories are discovered under
base_repo_dir. - Workspaces are created under
workspace_dir. - Workspace mode is either JJ workspace or Git worktree.
ab new flow
- Resolve repository ID (explicit or from current directory).
- Choose workspace type (JJ default, or Git).
- Create workspace for selected session name.
ab spawn flow
- Resolve workspace path (
--sessionmode) or current dir (--local). - Load and validate layered configuration.
- Resolve profile graph (
default_profile+ CLI profiles). - Build runtime-specific container configuration.
- Apply mounts/env/ports/hosts/network options.
- Mount portal socket and set
AGENT_PORTAL_SOCKETwhen portal is enabled. - Execute selected runtime backend (Podman or Docker).
Path resolution notes
- Home-relative paths are translated for host/container user homes.
- Relative mount source paths are resolved from current working directory.
- Symlinked paths are expanded to preserve resolution behavior inside container.