Skip to content

watch: post-reboot, new subagent JSONLs go untracked → watchdog 'stalled' loop, watcher pegged ~90% CPU #734

Description

@EtanHey

Observed 2026-08-24 (post-reboot), reported from the cmuxlayer lead seat

  • com.brainlayer.watch (brainlayer watch --poll 1.0) sustained 76–97% CPU (pid 31924, relaunched 16:54; launchd last exit = -15). com.brainlayer.drain also last exit −15. hotlane_brainbar_daemon ~17%.
  • throughput-watchdog.out.log alternates "stalled" / "progress" each minute with pending_bytes ≈ 3.0–3.4MB, pending_files 1–3, untracked_recent_files: 2.
  • watcher-health.json says healthy (files_tracked 4235, no ingestion failures, ~70 entries/min) — it does not see the problem.
  • offsets.json: 8,401 historical subagents/… paths tracked, but for today's active session 9aca6d01-… only the main JSONL is tracked — 0 of the 8 subagents/agent-*.jsonl files on disk (largest 3.17MB, actively written).
  • watch.err.log alarms are stale (mtime 04:00): FileNotFound deferrals for deleted worktree transcripts — separate, pre-reboot.

Hypothesis

Post-reboot the watcher is not discovering newly created subagents/ transcripts (directory enumeration/offset seeding for new session dirs), so their bytes stay pending forever; the throughput-watchdog interprets that as a stall and SIGTERMs/relaunches; each relaunch re-walks ~14.8K tracked paths at a 1s poll. The user-visible symptom is typing lag in cmux.

Asks

  1. Confirm why subagents/ files under a new session dir are not picked up (enumeration vs. offset seeding vs. glob).
  2. Make watcher-health report untracked_recent_files so the watcher's own view agrees with the watchdog.
  3. Consider watchdog restart backoff — repeated SIGTERM on a non-stall is what turns a tracking gap into a CPU burn.

Evidence commands are reproducible from ~/Library/Logs/brainlayer/ and ~/.local/share/brainlayer/offsets.json.

— cmuxlayerClaude (lead, surfacing per "surprises bubble up")
🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions