@flame0510/project-aether 1.9.0 → 1.9.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/app/api/agents/create/route.ts +6 -0
- package/docs/REV4A.md +1 -0
- package/lib/agent-recreate.ts +3 -0
- package/package.json +1 -1
|
@@ -221,7 +221,13 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
|
|
|
221
221
|
// this is intentional (e.g. BOOTSTRAP.md only exists in custom/).
|
|
222
222
|
const templateFiles = ['AGENTS.md', 'SOUL.md', 'IDENTITY.md', 'MEMORY.md', 'TOOLS.md', 'HEARTBEAT.md', 'BOOTSTRAP.md'];
|
|
223
223
|
|
|
224
|
+
// --init: Docker's tini runs as PID 1 and collects orphaned processes. Without it
|
|
225
|
+
// openclaw-gateway is PID 1 and never does, so every process a tool leaves behind
|
|
226
|
+
// (Chrome, builds, scripts) stays a zombie and counts against the container's pids
|
|
227
|
+
// limit until the container can no longer start anything. Same flag in
|
|
228
|
+
// lib/agent-recreate.ts.
|
|
224
229
|
const cmd = `docker run -d \
|
|
230
|
+
--init \
|
|
225
231
|
--name "${containerName}" \
|
|
226
232
|
--network "${network}" \
|
|
227
233
|
--restart unless-stopped \
|
package/docs/REV4A.md
CHANGED
|
@@ -68,6 +68,7 @@ Every agent is created with:
|
|
|
68
68
|
- Control UI at `http://<host>:<port>`, opened from the Agents page through `GET /api/agents/[id]/open-control-ui`
|
|
69
69
|
- The provider gateway at `http://host.docker.internal:3740/api/provider/v1`
|
|
70
70
|
- `gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback: true`, so the Control UI opens on whatever host the agent is reached on, and pages from other origins are refused
|
|
71
|
+
- `--init`: Docker's tini runs as PID 1, with OpenClaw as its child, and collects orphaned processes the moment they exit. Without it `openclaw-gateway` is PID 1 and never collects them: every process a tool leaves behind (Chrome, builds, scripts) stays a zombie and counts against the container's pids limit (9 365 on the VPS) until the container cannot start anything. Measured before the fix: 1 542 zombies in one agent after four days of browsing and builds. tini forwards `docker stop`'s SIGTERM, so OpenClaw still shuts down cleanly. Set at create and in `recreateAgentContainer` (recreate, update, edit); an existing agent gets it the next time it is recreated.
|
|
71
72
|
|
|
72
73
|
The port is auto-assigned starting from 3000 (or user-specified).
|
|
73
74
|
|
package/lib/agent-recreate.ts
CHANGED
|
@@ -138,6 +138,9 @@ export async function recreateAgentContainer(
|
|
|
138
138
|
|
|
139
139
|
const runArgs = (img: string): string[] => [
|
|
140
140
|
'run', '-d',
|
|
141
|
+
// tini as PID 1 collects orphaned processes (zombies) — see the create route. An
|
|
142
|
+
// existing agent gets it here, the next time it is recreated, updated or edited.
|
|
143
|
+
'--init',
|
|
141
144
|
'--name', agentId,
|
|
142
145
|
'--network', network,
|
|
143
146
|
'--restart', 'unless-stopped',
|