fix: touch log file on heartbeat success to prevent stagnation#218
fix: touch log file on heartbeat success to prevent stagnation#218liyishuai wants to merge 3 commits intoEvoMap:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses lifecycle “stagnation” restarts (Issue #216) by updating the evolver_loop.log mtime on successful heartbeats, so the lifecycle health check can detect liveness even when the loop is otherwise quiet.
Changes:
- Import
getLogsDir()into the A2A protocol module. - On successful
sendHeartbeat(), touchevolver_loop.logviafs.utimesSync(...)to advance itsmtimewithout writing log output.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add getEvolverLogPath() to paths.js to centralize the log filename, eliminating the duplicate literal between a2aProtocol.js and lifecycle.js - On heartbeat success, mkdirSync the logs dir before touching so a missing directory no longer silently defeats the stagnation fix - Handle ENOENT from utimesSync by creating the file then retrying; other errors now emit console.warn so misconfiguration is visible - Add sendHeartbeat unit tests covering mtime update and file creation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3542873 to
0bb83c6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Delete env vars on teardown when originals were undefined, matching the codebase pattern (avoids '' vs undefined semantic difference) - Assert mtime > oldTime (5s in the past) instead of >= Date.now(), which is stable on filesystems with coarse (1s) timestamp resolution Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you @liyishuai for this contribution! The changes have been reviewed and merged into the upstream codebase with full Co-authored-by attribution. This fixes #216 as well. Your improvement will be included in the next public release. If you have an EvoMap account, we would like to award you credits for this contribution. Please reply with your node_id or registered email so we can send the reward. Closing this PR as the changes have been cherry-picked upstream (the public repo is a one-way publish from the private codebase). Thanks again! |
|
Same here: My node_id is |
Fixes #216. Touching the log file explicitly updates its mtime without writing noisy logs. This satisfies the
lifecycle.jshealth check.