refactor: use shared extheartbeat and fix re-Start monitor leak#458
Conversation
Switch action_kit_sdk to extension-kit's extheartbeat watchdog (v1.10.7) and delete the local heartbeat package — it was a byte-identical copy of preflight-kit's, and the same concurrency fix had to be applied to both. Sharing one implementation stops it diverging again. Also fold in the re-Start monitor leak fix (matching preflight-kit#52): monitorHeartbeatWithCallback now Swap-and-Stops any monitor already registered for the execution id, so a repeated Start no longer leaks the previous monitor's goroutines. Adds a goroutine-leak regression test.
|
Claude finished @joshiste's task in 2m 39s —— View job Review
Summary: Clean, well-scoped refactor. Verified the swap-and-stop fix against the actual
No bugs, race conditions, or security issues found in this change. Note: I was unable to run |
|



What
Switches
action_kit_sdkto the sharedextheartbeatwatchdog from extension-kit (extension-kit#150, released as v1.10.7) and deletes the localaction_kit_sdk/heartbeatpackage.That package was a byte-identical copy of preflight-kit's, and the same concurrency bug had to be fixed in both (action-kit#457, preflight-kit#52). Sharing one implementation stops it diverging again. extension-kit was already a dependency, so no new module coupling.
Also folds in the re-Start monitor leak fix (matching preflight-kit#52):
monitorHeartbeatWithCallbacknowSwap-and-Stops any monitor already registered for the execution id, so a repeated Start no longer leaks the previous monitor's two goroutines.API impact
None. The local
heartbeatpackage was SDK-internal — imported only byaction_sdk.go, not by extensions. Clean removal (no shim), agreed.Verification
heartbeatpackage removed.go build ./...,go vet ./...,go test -race ./...pass (modulego/action_kit_sdk).