-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: Implement Watchdog process for reliable telemetry #777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+762
−80
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
313dccb to
519cd13
Compare
- Introduce WatchdogClient to spawn and communicate with a sidecar process - Implement watchdog entry point and sender to handle event transmission and detect parent death - Refactor ClearcutLogger to delegate event sending to the watchdog client - Add E2E tests for process termination handling (SIGTERM, SIGKILL)
519cd13 to
931dde4
Compare
OrKoN
reviewed
Jan 19, 2026
OrKoN
reviewed
Jan 19, 2026
ae4eb0c to
80d328c
Compare
OrKoN
reviewed
Jan 19, 2026
OrKoN
reviewed
Jan 19, 2026
OrKoN
reviewed
Jan 19, 2026
OrKoN
reviewed
Jan 19, 2026
…ve the Windows-specific taskkill test
OrKoN
approved these changes
Jan 19, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the watchdog process architecture for the telemetry system. It moves the
ClearcutSenderexecution to a dedicated child process, ensuring that events—especially shutdown events—are reliably transmitted even if the main server process terminates abruptly.Added an e2e test that runs the server, checks the log file and confirms the telemetry logs exist and that the watchdog process is correctly killed after sending the shutdown event once the main process is killed.
Implementation Roadmap:
This is the fourth in a series of PRs designed to implement the telemetry system:
--usage-statisticsflag and transparency logging.ClearcutLogger: Implemented the main logging entry point.logToolInvocationandlogServerStarthooks intomain.tsto capture events.ClearcutSender: Introduced a transport abstraction.FilePersistence: Implemented a local file-based state manager to persist thelastActivetimestamp.ClearcutLoggerto automatically detect and logdaily_activeevents (withdays_since_last_activecalculation) vialogDailyActiveIfNeeded.WatchdogClient: Added a client-side wrapper to spawn and communicate with the watchdog process viastdin.watchdog/main.ts: Created the entry point for the watchdog process. It listens for IPC messages and usesClearcutSenderto transmit events.shutdownevent is sent when the parent exits or crashes (detectingstdinclosure).ClearcutSenderto thewatchdogdirectory and updatedClearcutLoggerto delegate event sending to theWatchdogClient.ClearcutSenderwith actual HTTP transport logic, including event batching and exponential backoff retries.