Fix factory SDK agent exit latch#238
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesAgent Exit Deduplication Refactor
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Review Result I found no breakage in the current checkout and made no code changes. The PR is scoped to Addressed Comments
Advisory Notes
Local Validation Passed:
I did not run the macOS-only |
Summary
Replaces the factory SDK
InternalFleetClientagent-exit dedup window with a latch keyed by agent name.Root Cause
The broker emits a single
agent_exit, butInternalFleetClientcan observe the same logical exit through overlapping listener fan-out paths (onEvent,deliveryUpdate, and typedagentExited). The previous 5 second dedup window was not sufficient because live duplicate callbacks were observed 10 seconds or more apart.Changes
onAgentExitcallbacks for the same name until that name is spawned or resumed again.spawn()andresume()for the returned agent name.agentExitedduplicate fan-out suppressionValidation
npx vitest run packages/factory-sdknpx tsc --noEmit -p tsconfig.node.json