A team launch creates many directories/files in quick succession (worktrees, inboxes, session logs), and each addDir/unlinkDir event triggered a full TeamTaskWatchRegistry reconcile that tore down and recreated the entire chokidar watcher (re-opening a kqueue fd per watched file on macOS). Profiling a 6-member mixed-team launch showed kqueue churn (kevent) as a top native cost and watcher rebuild as the top remaining main-thread JS cost after the transcript fix. Debounce the event-driven reconcile (250ms) so a burst collapses into one rebuild. collectTargets re-reads the current directory state and emitExistingFilesForNewTargets backfills files created before the rebuild, so no change is missed; requestReconcile, startup, and the periodic 30s reconcile stay immediate. Adds a test asserting a burst of addDir events yields a single rebuild. |
||
|---|---|---|
| .. | ||
| agent-graph | ||
| features | ||
| fixtures | ||
| main | ||
| mocks | ||
| preload | ||
| renderer | ||
| scripts | ||
| shared | ||
| setup.ts | ||