Conversation
Node's recursive fs.watch can emit 'error' (e.g. ENOENT scandir) when a watched subdirectory is removed mid-rescan. An 'error' event with no listener is rethrown by EventEmitter as an uncaughtException that kills the whole Pi process (observed: 'pi exiting due to uncaughtException: Error: ENOENT: no such file or directory, scandir ~/.agents/skills/<skill>/storage'). Attach a best-effort error listener per watcher and expose the active watchers under __testing so the regression test can assert the listener exists and that emitting 'error' no longer crashes the process.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughChangesSkill registry watcher handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Watcher errors are handled without terminating the application, and the regression test covers listener attachment, emitted errors, and cleanup. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #962
PR Type
Summary
'error'listener to every recursive skill-registryFSWatcherso Node cannot rethrow an unhandled'error'as anuncaughtExceptionand kill Pi.'error'on the recursive watchers with zero listeners kills the process; with the listener attached the process survives.__testing.activeWatchers()and adds a regression test that asserts each watcher carries an error listener.Changes
extensions/skill-registry.tswatcher.on("error", ...)when starting skill-registry watchers; expose__testing.activeWatchers()tests/skill-registry.test.ts'error'event instead of crashing the processTest Plan
node --experimental-strip-types --test tests/*.test.ts— 2325 pass, 0 failnode scripts/check-provider-contract.mjs— passnode --experimental-strip-types tests/runtime-harness.mjs— pass (exit 0)node scripts/build-runtime-modules.mjs --check— runtime modules match TypeScript sourcesContributor Checklist
type:*label (type:bug)Co-Authored-BytrailersSummary by CodeRabbit
Bug Fixes
Tests