Add factory orphan reaper#253
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds factory orphan reaping: a mechanism to detect stale factory loop instances via heartbeat staleness checks, persist a registry of in-flight agents with process identity metadata, verify process liveness and identity at reap time to prevent false positives from PID recycling, and terminate confirmed orphaned processes via SIGTERM/SIGKILL. It extends the fleet client to carry PIDs, injects process identity introspection, persists registry alongside heartbeat, and exposes the reaper as a CLI command and periodic scheduler. ChangesFactory Orphan Reaping with In-Flight Process Registry
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. 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 |
|
Implemented one PR-scope fix: Addressed comments
Advisory Notes
Local verification
I did not print |
|
Implemented one PR-scope fix: Addressed comments
Advisory Notes
Local verification
I did not print |
Summary
Adds D9 factory orphan reaping for the unattended overnight safety path:
agentName, cmdline, start time)reapFactoryOrphansOnceonly reaps when the heartbeat is stale and only for registry-confirmed PID identitiesfleet factory reap-orphansexposes the external watchdog pathSafety
Validation
npx vitest run packages/factory-sdk-> 224 passed (19 files)npx tsc --noEmit -p tsconfig.node.json-> exit 0No live writes, live dispatches, or live process kills were run.