NanoClaw
NanoClaw adds an init process so agent containers reap zombies
A NanoClaw patch adds Docker’s --init flag when spawning agent containers, placing a minimal PID 1 in front of the agent process. The change targets orphaned child processes that otherwise remain as zombies during long-lived group sessions.
nanocoai/nanoclaw PR #3060 is the inspected primary source: “fix(container): add --init to agent container spawn args so PID 1 reaps zombie processes.” The two related records below were inspected as supporting context, not treated as independent confirmation.
The facts
- nanocoai/nanoclaw PR #3060 was created 2026-07-16T12:07:15Z and was closed at inspection; its title is “fix(container): add --init to agent container spawn args so PID 1 reaps zombie processes.” - nanocoai/nanoclaw PR #2197 was created 2026-05-02T21:16:50Z and was closed at inspection; its title is “fix(update-nanoclaw): guard merge state to prevent silent single-parent commits.” - nanocoai/nanoclaw PR #1255 was created 2026-03-18T23:11:33Z and was closed at inspection; its title is “feat: add MiniMax OAuth (Coding Plan) as model provider.” - The repository reported 30389 stars, 857 open issues, default branch main, and last push 2026-07-28T08:00:29Z. - The latest tagged-release baseline checked was v2.1.17 published 2026-06-17T14:51:14Z.
What changed
nanocoai/nanoclaw PR #3060 reports: What Adds --init to the agent container spawn args in buildContainerArgs (src/container-runner.ts), and corrects the PID 1 claim in docs/build-and-runtime.md that documented the gap. Why The host spawn path uses --entrypoint bash with -c 'exec bun run /app/src/index.ts'. That override bypasses the image's ENTRYPOINT, so the tini that container/Dockerfile deliberately installs as PID 1 never runs on real sessions. Bun becomes PID 1 directly. Bun as PID 1 does not reap children it didn't spawn. Bun's subreaper is armed only around its own in-flight Bun.spawn wait loop (see the ParentDeathWatchdog comment in oven-sh/bun: "bun foo.js... would accumulate zombies"). So any Bash-tool grandchild whose intermediate shell exits first (backgrounded sleep, a pkill racing itself, a killed kubectl) reparents to Bun and sits as for the container's lifetime. Observed on a production host: an agent container accumulated 3 zombies (kubectl, sleep, pkill) within an hour of uptime. docs/build-and-runtime.md currently says the host path "Bypasses tini (Docker's default PID 1 handling applies)" - but Docker does not
nanocoai/nanoclaw PR #2197 reports: Problem When /update-nanoclaw is run on a customized fork, the result of Step 4A (git merge upstream/$UPSTREAM_BRANCH --no-edit) can silently turn into a **single-parent commit** instead of a real merge. The user ends up with a HEAD whose subject reads "Merge upstream/main into nanoclaw fork" but git rev-list --parents -1 HEAD shows only one parent. The upstream commits remain orphaned from the fork's ancestry, even though their file content was integrated. From that point on, GitHub's compare API and any git rev-list origin..upstream check report the fork as "behind by N" forever. Reproduction in the wild I hit this on a customized fork. Forensic evidence from git reflog: git fsck --lost-found surfaces a dangling 2-parent commit at exactly 14:05:01 with the WIP on main: prefix — the signature of git stash. git stash push calls git reset --hard HEAD internally, which clears.git/MERGE_HEAD. After that, git commit produces a regular single-parent commit even when the working tree contains the merged content. A daily upstream-drift check
nanocoai/nanoclaw PR #1255 reports: What this adds MiniMax OAuth (Coding Plan) as an alternative model provider — no Anthropic API key or Claude subscription OAuth token required. New files src/minimax-oauth.ts — device-code OAuth flow with PKCE S256, token polling, and auto-refresh scripts/minimax-login.ts — one-shot CLI to obtain and store tokens in.env.claude/skills/add-minimax-oauth/ — skill + README Changes src/credential-proxy.ts — adds minimax-oauth as a third AuthMode. Tokens auto-refresh 60s before expiry. package.json — adds minimax-login script Usage CN region: npm run minimax-login -- --region cn Auth mode priority 1. ANTHROPIC_API_KEY present → api-key mode 2. MINIMAX_OAUTH_ACCESS present → minimax-oauth mode 3. Neither → oauth mode (Claude OAuth, existing default) Tested on Ubuntu Server 22.04, Node 22, Docker 28, MiniMax M2.5 via https://api.minimax.io/anthropic
Why it matters
Agent containers invoke shells, browsers and helper processes more often than ordinary single-process services. Without a reaper, repeated tool use can turn harmless exits into process-table debt and eventual reliability failures. This is an operator boundary: persisted state, execution ownership and visible controls must describe the same event. A workaround that broadens access, deletes state or hides the symptom would trade a visible defect for an unmeasured one.
Current
The primary record was closed when captured on 2026-07-29. The release baseline was v2.1.17 published 2026-06-17T14:51:14Z. Current repository metadata, pull requests, issues, release records, Hacker News discovery results and the rendered ClawCharts row were checked. ClawCharts selected the subject; it did not prove the claim.
Evidence
The primary URL is https://github.com/nanocoai/nanoclaw/pull/3060. Supporting records are https://github.com/nanocoai/nanoclaw/pull/2197 and https://github.com/nanocoai/nanoclaw/pull/1255. Their source bodies, timestamps and states were captured in the daily evidence bundle. Test counts, reproductions and deployment observations remain attributed to their authors unless explicitly identified as independently rerun.
Source boundary
Open work is described as open, closed work as closed, and operator reports as reports. A pull request is evidence of proposed or reviewed direction, not proof of a shipped release. Issue closure would not by itself prove a deployed fix. Search residue, package mirrors and historically published source spines were excluded.
Operator take
Measure zombie count before and after sustained tool use, and verify signals still reach the agent cleanly through the inserted init process. Preserve a before-state receipt, make the smallest reversible change, and verify the original failure independently after intervention.
Caveat
Public project records are mutable. Status, scope and evidence can change after publication. This brief records the inspected state and does not authorize changes to a reader’s deployment.
Source inspected; source state, environment and release boundary remain explicit.