Skip to content

fix(subagents): bound watcher IO and retained entries - #300

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/subagent-watcher-bounded-tail
Jun 20, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
fix/subagent-watcher-bounded-tail

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Jun 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • stream only the appended byte range from subagent JSONL files instead of reading the full growing file on every poll
  • preserve trailing partial JSONL lines between polls
  • cap retained parsed entries per subagent so main-process memory stays bounded
  • clear watcher maps on stop
  • add focused watcher coverage for partial lines and the retained-entry cap

Tracking

Fixes #310.
Refs #288, #277, #292.

Why

The live subagent fleet view made these files hot. The original watcher tracked byte offsets but still read the entire transcript every 600ms, and retained every parsed entry in main memory even though the renderer mini-feed is only recent activity.

Verification

  • npm run test:unit -- src/main/subagents/SubAgentWatcher.test.ts
  • npm run build

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SubAgentWatcher reads full JSONL files and retains parsed entries unbounded

1 participant