watch: post-reboot, new subagent JSONLs go untracked → watchdog 'stalled' loop, watcher pegged ~90% CPU
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
- Domain
- backend, devops, observability
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; launchdlast exit = -15).com.brainlayer.drainalso last exit −15.hotlane_brainbar_daemon~17%.throughput-watchdog.out.logalternates"stalled"/"progress"each minute withpending_bytes ≈ 3.0–3.4MB,pending_files 1–3,untracked_recent_files: 2.watcher-health.jsonsays healthy (files_tracked 4235, no ingestion failures, ~70 entries/min) — it does not see the problem.offsets.json: 8,401 historicalsubagents/…paths tracked, but for today's active session9aca6d01-…only the main JSONL is tracked — 0 of the 8subagents/agent-*.jsonlfiles on disk (largest 3.17MB, actively written).watch.err.logalarms 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
- Confirm why
subagents/files under a new session dir are not picked up (enumeration vs. offset seeding vs. glob). - Make watcher-health report
untracked_recent_filesso the watcher's own view agrees with the watchdog. - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EtanHey/brainlayer
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#1431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#1428 ·
Maintainers usually reply within 1 day
-
test(BrainBar): inject synthetic observabilityCadence in BackupsHealth/one-page fixtures (DCI-1)Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
EtanHey/brainlayer#1367 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
EtanHey/brainlayer#1364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
EtanHey/brainlayer#1362 ·
Maintainers usually reply within 1 day
All issues in EtanHey/brainlayer
Similar issues
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkPossibly taken @ocelotl claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cuga-project/cuga-agent#1020 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
microsoft/playwright#43640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day