Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#734 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start with the brainlayer watch --poll 1.0 entry point and reproduce from ~/Library/Logs/brainlayer/ using watcher-health.json, throughput-watchdog.out.log, and watch.err.log; compare discovery and offset seeding against ~/.local/share/brainlayer/offsets.json. Done means new subagents/*.jsonl files are tracked, health reports untracked_recent_files, and watchdog restarts do not create a CPU-burning loop.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
9
Forks
7
Avg merge
4h 50m
Merged PRs (30d)
404

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EtanHey/brainlayer

All issues in EtanHey/brainlayer

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.