#3916·nanoclaw

Host logs never rotate and carry no date, so a multi-week nanoclaw.log misreads as a live incident

Author: BuckG71Created Sep 25, 2026Updated Sep 25, 2026

What happened

While reviewing a launchd install (macOS, v2.3.0 → 2.4.0), logs/nanoclaw.log was 10 MB and logs/nanoclaw.error.log 29 MB, both dating back to May. Filtering the log by time-of-day to look at "the last few minutes" matched the same hours across four months, and 9,483 historical NanoClaw starting lines from old Docker-down restart loops (launchd KeepAlive retrying every ~8 s) read as a current crash loop. The host process had in fact been up for three days.

Two design choices combine to produce this:

  1. No rotation. The launchd plist that setup generates points StandardOutPath / StandardErrorPath at two fixed files. Nothing truncates or rotates them; the files grow for the life of the install. #1088 hit the same thing at 27 GB in five days and was closed with a manual truncate; the volume has since dropped (custom logger replaced pino), but the growth is still unbounded.
  2. Timestamps without a date. src/log.ts ts() emits HH:MM:SS.mmm only. Inside a file that spans days, no line says which day it belongs to, so grep/awk by time is the only filter available and it is wrong by construction.

#2869 asked for both but was closed as filed against the wrong repo.

Expected

Either of these would be enough on its own; both would be better:

  • Rotation owned by the install: size- or day-based, with a small retained set (for launchd, a generated newsyslog.d entry or an in-process rotate on SIGHUP/size; for systemd, journald already covers it if stdout is not redirected to a file).
  • A date in the timestamp (YYYY-MM-DD HH:MM:SS.mmm, or ISO 8601), so a line is self-locating and since-style filters become possible.

Environment

  • NanoClaw v2.3.0 (commit a200fd04, upstream merge of 2026-09-22), macOS 26 / Apple Silicon, launchd service mode, Docker runtime.
  • logs/nanoclaw.log 77,046 lines / 10.2 MB; logs/nanoclaw.error.log 29.4 MB; first entries May 2026.

Workaround in use

None applied; reporting rather than patching locally. Manual truncate -s 0 on both files is safe with launchd (append-mode fds), which is what #1088 did.