Skip to content

Move WeChat restart from entrypoint to health monitor#116

Merged
thisnick merged 3 commits intomainfrom
claude/health-monitor-restart-wechat
Mar 11, 2026
Merged

Move WeChat restart from entrypoint to health monitor#116
thisnick merged 3 commits intomainfrom
claude/health-monitor-restart-wechat

Conversation

@thisnick
Copy link
Copy Markdown
Owner

Summary

  • The entrypoint bash restart loop was unreliable — WeChat would segfault and not get restarted
  • Moves restart logic into the agent-server health monitor, which already detects when the process disappears
  • Health monitor now calls spawn_wechat() directly when it detects the process is gone (after a 3s delay)
  • Crash loop protection preserved: 5 restarts within 60s triggers a 30s backoff
  • Entrypoint still does the initial launch but no longer loops

Test plan

  • Deploy, kill WeChat manually (kill -9 $(pgrep -f /usr/bin/wechat)), verify health monitor restarts it within ~4s
  • Kill WeChat 5+ times rapidly, verify backoff kicks in (30s delay logged)
  • Verify normal operation unaffected — health monitor still detects unresponsive state and kills after 60s

🤖 Generated with Claude Code

thisnick and others added 3 commits March 10, 2026 18:11
The entrypoint bash restart loop was unreliable — WeChat would crash
and not get restarted. Move the restart logic into the agent-server
health monitor which already detects when the process disappears.

The health monitor now spawns WeChat directly when it detects the
process is gone, with the same crash loop protection (5 restarts
within 60s triggers a 30s backoff).

The entrypoint still does the initial launch but no longer loops.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both the entrypoint (initial launch) and health monitor (restart after
crash) now call the same script, so WeChat env vars stay in one place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thisnick thisnick merged commit 42c80f6 into main Mar 11, 2026
3 checks passed
@thisnick thisnick deleted the claude/health-monitor-restart-wechat branch March 11, 2026 01:23
@github-actions github-actions bot mentioned this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant