@action-llama/action-llama 0.12.2 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{docs/agent-reference → agent-docs}/AGENTS.md +31 -15
- package/{docs/agent-reference → agent-docs}/skills/README.md +1 -0
- package/agent-docs/skills/calls.md +82 -0
- package/{docs/agent-reference → agent-docs}/skills/resource-locks.md +13 -7
- package/{docs/agent-reference → agent-docs}/skills/signals.md +1 -1
- package/dist/agents/container-runner.d.ts +3 -2
- package/dist/agents/container-runner.d.ts.map +1 -1
- package/dist/agents/container-runner.js +12 -12
- package/dist/agents/container-runner.js.map +1 -1
- package/dist/agents/prompt.d.ts.map +1 -1
- package/dist/agents/prompt.js +3 -2
- package/dist/agents/prompt.js.map +1 -1
- package/dist/agents/runner.d.ts +3 -2
- package/dist/agents/runner.d.ts.map +1 -1
- package/dist/agents/runner.js +14 -14
- package/dist/agents/runner.js.map +1 -1
- package/dist/build-info.json +1 -1
- package/dist/cli/commands/doctor.d.ts +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +53 -15
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/env.d.ts +4 -0
- package/dist/cli/commands/env.d.ts.map +1 -1
- package/dist/cli/commands/env.js +41 -0
- package/dist/cli/commands/env.js.map +1 -1
- package/dist/cli/commands/kill.js +2 -2
- package/dist/cli/commands/kill.js.map +1 -1
- package/dist/cli/commands/logs.d.ts.map +1 -1
- package/dist/cli/commands/logs.js +25 -20
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/pause.js +2 -2
- package/dist/cli/commands/pause.js.map +1 -1
- package/dist/cli/commands/push.d.ts +1 -0
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +2 -1
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/resume.js +2 -2
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +21 -46
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +62 -2
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +23 -7
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.d.ts +1 -0
- package/dist/cli/commands/stop.d.ts.map +1 -1
- package/dist/cli/commands/stop.js +3 -2
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/gateway-client.d.ts +6 -0
- package/dist/cli/gateway-client.d.ts.map +1 -1
- package/dist/cli/gateway-client.js +19 -0
- package/dist/cli/gateway-client.js.map +1 -1
- package/dist/cli/main.js +12 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cloud/vps/constants.d.ts +1 -1
- package/dist/cloud/vps/constants.d.ts.map +1 -1
- package/dist/cloud/vps/constants.js +9 -0
- package/dist/cloud/vps/constants.js.map +1 -1
- package/dist/cloud/vps/hetzner-api.d.ts +14 -3
- package/dist/cloud/vps/hetzner-api.d.ts.map +1 -1
- package/dist/cloud/vps/hetzner-api.js +24 -11
- package/dist/cloud/vps/hetzner-api.js.map +1 -1
- package/dist/cloud/vps/provision.js +29 -6
- package/dist/cloud/vps/provision.js.map +1 -1
- package/dist/cloud/vps/ssh.d.ts +7 -0
- package/dist/cloud/vps/ssh.d.ts.map +1 -1
- package/dist/cloud/vps/ssh.js +15 -1
- package/dist/cloud/vps/ssh.js.map +1 -1
- package/dist/credentials/builtins/index.d.ts.map +1 -1
- package/dist/credentials/builtins/index.js +2 -0
- package/dist/credentials/builtins/index.js.map +1 -1
- package/dist/credentials/builtins/reddit-oauth.d.ts +4 -0
- package/dist/credentials/builtins/reddit-oauth.d.ts.map +1 -0
- package/dist/credentials/builtins/reddit-oauth.js +71 -0
- package/dist/credentials/builtins/reddit-oauth.js.map +1 -0
- package/dist/docker/local-runtime.d.ts +1 -0
- package/dist/docker/local-runtime.d.ts.map +1 -1
- package/dist/docker/local-runtime.js +9 -6
- package/dist/docker/local-runtime.js.map +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +5 -4
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/routes/logs.d.ts.map +1 -1
- package/dist/gateway/routes/logs.js +29 -111
- package/dist/gateway/routes/logs.js.map +1 -1
- package/dist/remote/bootstrap.d.ts +2 -0
- package/dist/remote/bootstrap.d.ts.map +1 -1
- package/dist/remote/bootstrap.js +7 -11
- package/dist/remote/bootstrap.js.map +1 -1
- package/dist/remote/push.d.ts +6 -0
- package/dist/remote/push.d.ts.map +1 -1
- package/dist/remote/push.js +172 -91
- package/dist/remote/push.js.map +1 -1
- package/dist/remote/ssh.d.ts +1 -0
- package/dist/remote/ssh.d.ts.map +1 -1
- package/dist/remote/ssh.js +8 -0
- package/dist/remote/ssh.js.map +1 -1
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +56 -7
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/watcher.d.ts +1 -1
- package/dist/scheduler/watcher.d.ts.map +1 -1
- package/dist/scheduler/watcher.js +5 -6
- package/dist/scheduler/watcher.js.map +1 -1
- package/dist/setup/scaffold.js +2 -2
- package/dist/setup/scaffold.js.map +1 -1
- package/dist/shared/config.d.ts +1 -0
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/credentials.d.ts +8 -18
- package/dist/shared/credentials.d.ts.map +1 -1
- package/dist/shared/credentials.js +8 -62
- package/dist/shared/credentials.js.map +1 -1
- package/dist/shared/server.d.ts +2 -0
- package/dist/shared/server.d.ts.map +1 -1
- package/dist/shared/server.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +1 -1
- package/dist/tui/App.js.map +1 -1
- package/dist/webhooks/definitions/github.d.ts.map +1 -1
- package/dist/webhooks/definitions/github.js +13 -0
- package/dist/webhooks/definitions/github.js.map +1 -1
- package/dist/webhooks/providers/github.d.ts.map +1 -1
- package/dist/webhooks/providers/github.js +6 -0
- package/dist/webhooks/providers/github.js.map +1 -1
- package/dist/webhooks/registry.d.ts.map +1 -1
- package/dist/webhooks/registry.js +9 -3
- package/dist/webhooks/registry.js.map +1 -1
- package/dist/webhooks/types.d.ts +3 -1
- package/dist/webhooks/types.d.ts.map +1 -1
- package/docker/bin/_http-exit +17 -0
- package/docker/bin/al-call +10 -4
- package/docker/bin/al-check +9 -3
- package/docker/bin/al-status +1 -1
- package/docker/bin/al-wait +11 -3
- package/docker/bin/rlock +9 -2
- package/docker/bin/rlock-heartbeat +9 -2
- package/docker/bin/runlock +9 -2
- package/package.json +2 -2
- package/docs/agent-config-reference.md +0 -313
- package/docs/agents.md +0 -256
- package/docs/cloud-run.md +0 -173
- package/docs/cloud.md +0 -98
- package/docs/commands.md +0 -286
- package/docs/config-reference.md +0 -241
- package/docs/creating-agents.md +0 -147
- package/docs/credentials.md +0 -167
- package/docs/docker.md +0 -323
- package/docs/ecs.md +0 -795
- package/docs/examples/dev/ACTIONS.md +0 -75
- package/docs/examples/dev/README.md +0 -28
- package/docs/examples/dev/agent-config.toml +0 -18
- package/docs/examples/devops/ACTIONS.md +0 -33
- package/docs/examples/devops/README.md +0 -23
- package/docs/examples/devops/agent-config.toml +0 -13
- package/docs/examples/index.md +0 -15
- package/docs/examples/reviewer/ACTIONS.md +0 -37
- package/docs/examples/reviewer/README.md +0 -22
- package/docs/examples/reviewer/agent-config.toml +0 -11
- package/docs/models.md +0 -191
- package/docs/vps-deployment.md +0 -285
- package/docs/web-dashboard.md +0 -113
- package/docs/webhooks.md +0 -152
- /package/{docs/agent-reference → agent-docs}/skills/credentials.md +0 -0
- /package/{docs/agent-reference → agent-docs}/skills/environment.md +0 -0
package/docs/docker.md
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
# Container Isolation
|
|
2
|
-
|
|
3
|
-
All agents run in isolated containers for security and consistency. Container isolation is always enabled.
|
|
4
|
-
|
|
5
|
-
## How it works
|
|
6
|
-
|
|
7
|
-
When `al start` runs:
|
|
8
|
-
|
|
9
|
-
1. The base image (`al-agent:latest`) is built from `docker/Dockerfile` on first run
|
|
10
|
-
2. Per-agent images are built for any agent that has a custom `Dockerfile`
|
|
11
|
-
3. Each agent run launches a fresh container with:
|
|
12
|
-
- Read-only root filesystem
|
|
13
|
-
- Credentials mounted read-only at `/credentials/`
|
|
14
|
-
- Writable tmpfs at `/tmp` (2GB)
|
|
15
|
-
- All capabilities dropped, no-new-privileges
|
|
16
|
-
- PID, memory, and CPU limits
|
|
17
|
-
- Non-root user (uid 1000)
|
|
18
|
-
- A unique shutdown secret for the anti-exfiltration kill switch
|
|
19
|
-
|
|
20
|
-
## Container runtime
|
|
21
|
-
|
|
22
|
-
Each agent run is a short-lived container that boots, runs a single LLM session, and exits. The entry point is `node /app/dist/agents/container-entry.js`.
|
|
23
|
-
|
|
24
|
-
### Environment
|
|
25
|
-
|
|
26
|
-
The container receives everything it needs via environment variables and mounts:
|
|
27
|
-
|
|
28
|
-
| Env var | Description |
|
|
29
|
-
|---------|-------------|
|
|
30
|
-
| `AGENT_CONFIG` | JSON-serialized agent config (model, credentials, params) plus `ACTIONS.md` content |
|
|
31
|
-
| `PROMPT` | The fully assembled prompt (`<agent-config>` + `<credential-context>` + trigger text) |
|
|
32
|
-
| `TIMEOUT_SECONDS` | Max runtime in seconds (default: 3600). The container self-terminates if exceeded |
|
|
33
|
-
| `GATEWAY_URL` | HTTP URL of the host gateway (local Docker only — used for credential fetch and shutdown) |
|
|
34
|
-
| `SHUTDOWN_SECRET` | Unique per-run secret for the anti-exfiltration kill switch (local Docker only) |
|
|
35
|
-
|
|
36
|
-
Credentials are injected in one of three ways depending on the runtime:
|
|
37
|
-
|
|
38
|
-
| Runtime | Strategy | How it works |
|
|
39
|
-
|---------|----------|--------------|
|
|
40
|
-
| Local Docker | Volume mount | Files staged to a temp dir, mounted read-only at `/credentials/<type>/<instance>/<field>` |
|
|
41
|
-
| Cloud Run | Gateway fetch | Container fetches credentials from `GATEWAY_URL/credentials/<secret>` on startup |
|
|
42
|
-
| ECS Fargate | Env vars | Secrets Manager values injected as `AL_SECRET_<type>__<instance>__<field>` env vars |
|
|
43
|
-
|
|
44
|
-
The container tries each strategy in order: volume mount, env vars, gateway. The first one that has data wins.
|
|
45
|
-
|
|
46
|
-
### Startup sequence
|
|
47
|
-
|
|
48
|
-
1. **Set working directory** — `chdir("/tmp")`
|
|
49
|
-
2. **Start self-termination timer** — kills the process with exit code 124 if `TIMEOUT_SECONDS` is exceeded
|
|
50
|
-
3. **Parse config** — reads `AGENT_CONFIG`, extracts `ACTIONS.md` content
|
|
51
|
-
4. **Load credentials** — from volume, env vars, or gateway (see table above)
|
|
52
|
-
5. **Inject env vars from credentials:**
|
|
53
|
-
- `GITHUB_TOKEN` / `GH_TOKEN` from `github_token` credential
|
|
54
|
-
- `SENTRY_AUTH_TOKEN` from `sentry_token` credential
|
|
55
|
-
- `GIT_SSH_COMMAND` pointing to the mounted SSH key from `git_ssh` credential
|
|
56
|
-
- `GIT_AUTHOR_NAME` / `GIT_AUTHOR_EMAIL` / `GIT_COMMITTER_NAME` / `GIT_COMMITTER_EMAIL` from `git_ssh` credential
|
|
57
|
-
- Git HTTPS credential helper configured if `GITHUB_TOKEN` is set
|
|
58
|
-
6. **Create pi-coding-agent session** — initializes the LLM model, tools, and settings
|
|
59
|
-
7. **Send prompt** — delivers the pre-built prompt to the session
|
|
60
|
-
|
|
61
|
-
### Agent session
|
|
62
|
-
|
|
63
|
-
The prompt is sent to the LLM with rate-limit retry (up to 5 attempts with exponential backoff, 30s to 5min). The LLM runs autonomously — reading files, executing commands, making API calls — until it finishes or hits an error.
|
|
64
|
-
|
|
65
|
-
**Unrecoverable error detection:** The container watches for repeated auth/permission failures (e.g. "bad credentials", "permission denied", "resource not accessible by personal access token"). After 3 such errors, it aborts early rather than burning through retries.
|
|
66
|
-
|
|
67
|
-
### Exit codes
|
|
68
|
-
|
|
69
|
-
| Code | Meaning |
|
|
70
|
-
|------|---------|
|
|
71
|
-
| 0 | Success — agent completed its work |
|
|
72
|
-
| 1 | Error — missing config, credential failure, unrecoverable errors, or uncaught exception |
|
|
73
|
-
| 124 | Timeout — `TIMEOUT_SECONDS` exceeded, container self-terminated |
|
|
74
|
-
|
|
75
|
-
### Log protocol
|
|
76
|
-
|
|
77
|
-
The container communicates with the scheduler via structured JSON lines on stdout. This is how the scheduler tracks progress, surfaces errors in the TUI, and writes log files.
|
|
78
|
-
|
|
79
|
-
**Structured log lines** have the format:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{"_log": true, "level": "info", "msg": "bash", "cmd": "git clone ...", "ts": 1234567890}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
The `_log: true` field distinguishes structured logs from plain text output. The scheduler parses these and forwards them to the logger at the appropriate level.
|
|
86
|
-
|
|
87
|
-
| Field | Description |
|
|
88
|
-
|-------|-------------|
|
|
89
|
-
| `_log` | Always `true` — marker for structured log lines |
|
|
90
|
-
| `level` | `"debug"`, `"info"`, `"warn"`, or `"error"` |
|
|
91
|
-
| `msg` | Log message (e.g. `"bash"`, `"tool error"`, `"credentials loaded from volume"`) |
|
|
92
|
-
| `ts` | Unix timestamp in milliseconds |
|
|
93
|
-
| `...` | Additional fields vary by message (e.g. `cmd`, `tool`, `error`, `result`) |
|
|
94
|
-
|
|
95
|
-
Key log messages emitted during a run:
|
|
96
|
-
|
|
97
|
-
| Message | Level | When |
|
|
98
|
-
|---------|-------|------|
|
|
99
|
-
| `"container starting"` | info | Boot, includes `agentName` and `modelId` |
|
|
100
|
-
| `"credentials loaded from ..."` | info | After credential loading (`volume`, `env vars`, or `gateway`) |
|
|
101
|
-
| `"SSH key configured for git"` | info | After SSH key setup |
|
|
102
|
-
| `"creating agent session"` | info | Before LLM session creation |
|
|
103
|
-
| `"session created, sending prompt"` | info | Prompt delivery |
|
|
104
|
-
| `"bash"` | info | Every bash tool call, with `cmd` field |
|
|
105
|
-
| `"tool error"` | error | Failed tool call, with `tool`, `cmd`, and `result` fields |
|
|
106
|
-
| `"rate limited, retrying prompt"` | warn | Rate limit hit, with `attempt` and `delayMs` |
|
|
107
|
-
| `"run completed"` | info | Agent finished successfully |
|
|
108
|
-
| `"no work to do"` | info | Agent found nothing to act on |
|
|
109
|
-
| `"container timeout reached, self-terminating"` | error | Timeout exceeded |
|
|
110
|
-
|
|
111
|
-
**Signal commands:**
|
|
112
|
-
|
|
113
|
-
The container has signal commands installed at `/tmp/bin/` that write to `$AL_SIGNAL_DIR`:
|
|
114
|
-
|
|
115
|
-
| Command | Description |
|
|
116
|
-
|---------|-------------|
|
|
117
|
-
| `al-rerun` | Request an immediate rerun to drain remaining backlog. Without this, the scheduler treats the run as complete and waits for the next scheduled tick. |
|
|
118
|
-
| `al-status "<text>"` | Status update shown in the TUI. Example: `al-status "reviewing PR #42"` |
|
|
119
|
-
| `al-return "<value>"` | Return a value to the calling agent. Used when this agent was invoked via `al-call`. |
|
|
120
|
-
| `al-exit [code]` | Terminate with an exit code indicating an unrecoverable error. Defaults to 15. |
|
|
121
|
-
|
|
122
|
-
**Agent-to-agent calls:**
|
|
123
|
-
|
|
124
|
-
Agents can call other agents and retrieve structured results using shell commands injected into the container:
|
|
125
|
-
|
|
126
|
-
- **`al-call <agent>`** — Call another agent. Pass context via stdin, get back a JSON response with a `callId`.
|
|
127
|
-
- **`al-check <callId>`** — Check the status of a call (never blocks). Returns `{"status":"pending|running|completed|error", ...}`.
|
|
128
|
-
- **`al-wait <callId> [callId...] [--timeout N]`** — Wait for one or more calls to complete (polls every 5s, default timeout 900s).
|
|
129
|
-
|
|
130
|
-
Example:
|
|
131
|
-
```sh
|
|
132
|
-
CALL_ID=$(echo "Review PR #42 on acme/app" | al-call reviewer | jq -r .callId)
|
|
133
|
-
# ... do other work ...
|
|
134
|
-
RESULT=$(al-wait "$CALL_ID" --timeout 600)
|
|
135
|
-
echo "$RESULT" | jq ".\"$CALL_ID\".returnValue"
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
The called agent receives an `<agent-call>` block with the caller name and context. To return a value, the called agent uses the `al-return` command:
|
|
139
|
-
```
|
|
140
|
-
al-return "PR looks good. Approved with minor suggestions."
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Rules:
|
|
144
|
-
- An agent cannot call itself (self-calls are rejected)
|
|
145
|
-
- If all runners for the target agent are busy, the call is queued (up to `workQueueSize` limit in global config, default: 100)
|
|
146
|
-
- Call chains are allowed (agent A calls B, B calls C) up to a configurable depth limit (`maxCallDepth` in `config.toml`, default: 3)
|
|
147
|
-
- Called runs do not re-run — they respond to the single call
|
|
148
|
-
- These commands require the gateway; they return errors if `GATEWAY_URL` is not set
|
|
149
|
-
|
|
150
|
-
Any stdout line that is not valid JSON with `_log: true` is treated as plain agent output (the LLM's final text response).
|
|
151
|
-
|
|
152
|
-
## Base image
|
|
153
|
-
|
|
154
|
-
The base image (`al-agent:latest`) is built automatically from the Action Llama package and includes the minimum needed for any agent:
|
|
155
|
-
|
|
156
|
-
| Package | Why |
|
|
157
|
-
|---------|-----|
|
|
158
|
-
| `node:20-slim` | Runs the container entry point and pi-coding-agent SDK |
|
|
159
|
-
| `git` | Clone repos, create branches, push commits |
|
|
160
|
-
| `curl` | API calls (Sentry, arbitrary HTTP), anti-exfiltration shutdown |
|
|
161
|
-
| `ca-certificates` | HTTPS for git, curl, npm |
|
|
162
|
-
| `openssh-client` | SSH for `GIT_SSH_COMMAND` — git clone/push over SSH |
|
|
163
|
-
|
|
164
|
-
The base image also copies the compiled Action Llama application (`dist/`) and installs its npm dependencies. The entry point is `node /app/dist/agents/container-entry.js`.
|
|
165
|
-
|
|
166
|
-
## Project base image
|
|
167
|
-
|
|
168
|
-
The project `Dockerfile` (at the project root) lets you customize the base image for **all** agents in the project. It is created by `al new` and checked into git:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
my-project/
|
|
172
|
-
Dockerfile <-- project base image (shared by all agents)
|
|
173
|
-
config.toml
|
|
174
|
-
dev/
|
|
175
|
-
agent-config.toml
|
|
176
|
-
ACTIONS.md
|
|
177
|
-
reviewer/
|
|
178
|
-
agent-config.toml
|
|
179
|
-
ACTIONS.md
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
By default, the project Dockerfile is a bare `FROM al-agent:latest` with no customizations. In this state, it is skipped entirely — agents build directly on `al-agent:latest` with no overhead.
|
|
183
|
-
|
|
184
|
-
To customize, add `RUN`, `ENV`, or other instructions:
|
|
185
|
-
|
|
186
|
-
```dockerfile
|
|
187
|
-
FROM al-agent:latest
|
|
188
|
-
|
|
189
|
-
# Install tools shared by all agents
|
|
190
|
-
RUN apk add --no-cache python3 py3-pip github-cli
|
|
191
|
-
|
|
192
|
-
# Set shared environment variables
|
|
193
|
-
ENV MY_ORG=acme
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
When the project Dockerfile has customizations beyond the bare `FROM`, the build pipeline creates an intermediate image (`al-project-base:latest`) that all per-agent images layer on top of.
|
|
197
|
-
|
|
198
|
-
### Image build order
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
al-agent:latest ← Action Llama package (automatic)
|
|
202
|
-
│
|
|
203
|
-
▼
|
|
204
|
-
al-project-base:latest ← project Dockerfile (if customized)
|
|
205
|
-
│
|
|
206
|
-
▼
|
|
207
|
-
al-<agent>:latest ← per-agent Dockerfile (if present)
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
If the project Dockerfile is unmodified, the middle layer is skipped.
|
|
211
|
-
|
|
212
|
-
## Custom agent images
|
|
213
|
-
|
|
214
|
-
Agents that need extra tools **beyond** what the project base provides can add a `Dockerfile` to their own directory:
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
my-project/
|
|
218
|
-
Dockerfile <-- project base (shared tools)
|
|
219
|
-
dev/
|
|
220
|
-
agent-config.toml
|
|
221
|
-
ACTIONS.md
|
|
222
|
-
Dockerfile <-- custom image for this agent only
|
|
223
|
-
reviewer/
|
|
224
|
-
agent-config.toml
|
|
225
|
-
ACTIONS.md
|
|
226
|
-
<-- no Dockerfile, uses project base
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Extending the base image
|
|
230
|
-
|
|
231
|
-
Use `FROM al-agent:latest` and add what you need. The build pipeline automatically rewrites the `FROM` line to point at the correct base (either `al-project-base:latest` or the cloud registry URI). Switch to `root` to install packages, then back to `node`:
|
|
232
|
-
|
|
233
|
-
```dockerfile
|
|
234
|
-
FROM al-agent:latest
|
|
235
|
-
|
|
236
|
-
USER root
|
|
237
|
-
RUN apk add --no-cache github-cli
|
|
238
|
-
USER node
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
This is a thin layer on top of the base — fast to build and shares most of the image.
|
|
242
|
-
|
|
243
|
-
**Tip:** If multiple agents need the same tool, put it in the project `Dockerfile` instead of duplicating it across agent Dockerfiles.
|
|
244
|
-
|
|
245
|
-
Common additions:
|
|
246
|
-
|
|
247
|
-
```dockerfile
|
|
248
|
-
# GitHub CLI (for gh issue list, gh pr create, etc.)
|
|
249
|
-
RUN apk add --no-cache github-cli
|
|
250
|
-
|
|
251
|
-
# Python (for agents that run Python scripts)
|
|
252
|
-
RUN apk add --no-cache python3 py3-pip
|
|
253
|
-
|
|
254
|
-
# jq (for JSON processing in bash) — already in the base image
|
|
255
|
-
# RUN apk add --no-cache jq
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
### Writing a standalone Dockerfile
|
|
259
|
-
|
|
260
|
-
If you need full control, you can write a Dockerfile from scratch. It must:
|
|
261
|
-
|
|
262
|
-
1. Include Node.js 20+
|
|
263
|
-
2. Copy the application code from the base image or install it
|
|
264
|
-
3. Set `ENTRYPOINT ["node", "/app/dist/agents/container-entry.js"]`
|
|
265
|
-
4. Use uid 1000 (`USER node` on node images) for compatibility with the container launcher
|
|
266
|
-
|
|
267
|
-
Example standalone Dockerfile:
|
|
268
|
-
|
|
269
|
-
```dockerfile
|
|
270
|
-
FROM node:20-slim
|
|
271
|
-
|
|
272
|
-
# Install your tools
|
|
273
|
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
274
|
-
git curl ca-certificates openssh-client gh jq python3 \
|
|
275
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
276
|
-
|
|
277
|
-
# Copy app from the base image (avoids rebuilding from source)
|
|
278
|
-
COPY --from=al-agent:latest /app /app
|
|
279
|
-
WORKDIR /app
|
|
280
|
-
|
|
281
|
-
USER node
|
|
282
|
-
ENTRYPOINT ["node", "/app/dist/agents/container-entry.js"]
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
The key requirement is that `/app/dist/agents/container-entry.js` exists and can run. The entry point reads `AGENT_CONFIG`, `PROMPT`, `GATEWAY_URL`, and `SHUTDOWN_SECRET` from environment variables, and credentials from `/credentials/`.
|
|
286
|
-
|
|
287
|
-
### Build behavior
|
|
288
|
-
|
|
289
|
-
- The base image (`al-agent:latest`) is only built if it doesn't exist yet
|
|
290
|
-
- The project base image (`al-project-base:latest`) is rebuilt on every `al start` if the project Dockerfile has customizations
|
|
291
|
-
- Agent images are named `al-<agent-name>:latest` (e.g. `al-dev:latest`) and are rebuilt on every `al start` to pick up Dockerfile changes
|
|
292
|
-
- The build context is the Action Llama package root (not the project directory), so `COPY` paths in per-agent Dockerfiles reference the package's `dist/`, `package.json`, etc.
|
|
293
|
-
|
|
294
|
-
## Configuration
|
|
295
|
-
|
|
296
|
-
| Key | Default | Description |
|
|
297
|
-
|-----|---------|-------------|
|
|
298
|
-
| `local.image` | `"al-agent:latest"` | Base Docker image name |
|
|
299
|
-
| `local.memory` | `"4g"` | Memory limit per container |
|
|
300
|
-
| `local.cpus` | `2` | CPU limit per container |
|
|
301
|
-
| `local.timeout` | `3600` | Max container runtime in seconds |
|
|
302
|
-
|
|
303
|
-
For Cloud Run configuration, see [Cloud Run docs](cloud-run.md). For ECS Fargate configuration, see [ECS docs](ecs.md).
|
|
304
|
-
|
|
305
|
-
## Container filesystem layout
|
|
306
|
-
|
|
307
|
-
| Path | Mode | Contents |
|
|
308
|
-
|------|------|----------|
|
|
309
|
-
| `/app` | read-only | Action Llama application + node_modules |
|
|
310
|
-
| `/credentials` | read-only | Mounted credential files (`/<type>/<instance>/<field>`) |
|
|
311
|
-
| `/tmp` | read-write (tmpfs, 2GB) | Agent working directory — repos, scratch files, SSH keys |
|
|
312
|
-
|
|
313
|
-
## Troubleshooting
|
|
314
|
-
|
|
315
|
-
**"Docker is not running"** — Start Docker Desktop or the Docker daemon before running `al start`.
|
|
316
|
-
|
|
317
|
-
**Base image build fails** — Run `docker build -t al-agent:latest -f docker/Dockerfile .` from the Action Llama package directory to see the full build output.
|
|
318
|
-
|
|
319
|
-
**Project base image build fails** — Check that the project `Dockerfile` starts with `FROM al-agent:latest` and that any `apk add` packages are spelled correctly. The base image uses Alpine Linux.
|
|
320
|
-
|
|
321
|
-
**Agent image build fails** — Check that your agent's `Dockerfile` starts with `FROM al-agent:latest` (the build pipeline rewrites this to the correct base) and that any package install commands are correct.
|
|
322
|
-
|
|
323
|
-
**Container exits immediately** — Check `al logs <agent>` for the error. Common causes: missing credentials, missing `ACTIONS.md`, invalid model config.
|