nexus-agent-runner
The generic runtime that executes inside Kubernetes Jobs. Do not create one binary per agent type — the runner receives dynamic config and becomes whatever it describes.
Responsibilities
- Load run config · Load skills · Load memory
- Clone repo · Select a backend · Run the agent · Run tools
- Commit changes · Report logs/events · Return structured output
It reads two env vars — NEXUS_RUN_CONFIG (an AgentRunRequest) and
NEXUS_BACKEND_SPEC (a BackendSpec) — then calls
build_backend and runs the resulting
AgentBackend. The backend (OpenAI/Anthropic API, or the Claude Code / Codex /
OpenAI CLI) is chosen from data, so the same image runs any agent.
Stack
| Library | Use |
|---|---|
tokio | async runtime |
nexus-ai-runtime | AgentBackend trait + API/CLI backends |
reqwest | HTTP to Nexus Core + LLM providers |
serde / serde_json | config + result payloads |
schemars | schema for structured output |
tracing | logs / spans |
async-trait | provider traits |
clap | CLI args |
duct | running shell tools reliably |
tempfile | scratch workspaces |
ignore / walkdir | repo traversal |
similar | diffs |
Dynamic config
{
"agent_id": "backend-implementer",
"skills": ["rust-backend", "api-testing"],
"memory_scopes": ["project", "agent_private"],
"tools": ["git", "cargo", "shell"],
"task_id": "task_123"
}
So the same runner becomes:
planner-agent · implementer-agent · reviewer-agent · tester-agent · devops-agent
Git inside the container
Use the git CLI inside agent containers for reliability (clone, branch, commit, push). PR creation against GitHub/GitLab is done from Nexus Core via API clients (see crates → nexus-git).
Toolchain images
The runner binary is layered on top of toolchain images from
nexus-agent-images (rust, node, python,
devops, solana). The agent's runtime.image field selects which.