Skip to content

fix: retry Linux background launcher after early exit - #182

Open
jamilahmadzai wants to merge 1 commit into
monk-io:mainfrom
jamilahmadzai:fix/linux-background-agent-retry-180
Open

fix: retry Linux background launcher after early exit#182
jamilahmadzai wants to merge 1 commit into
monk-io:mainfrom
jamilahmadzai:fix/linux-background-agent-retry-180

Conversation

@jamilahmadzai

Copy link
Copy Markdown

Summary

  • retry non-launchd POSIX launcher starts when the child exits before readiness
  • keep retries bounded and inside the existing readiness deadline
  • add a Linux regression that proves the second start is used after an early child exit

Root cause

The macOS path delegates non-zero agent exits to launchd KeepAlive, but the Linux/background path started the child once. If that child exited before the health endpoint became ready, the launcher observed the dead PID, stopped waiting, and returned a not-ready error without giving the agent another chance to recover.

The retry stays limited by MONK_AGENT_BACKGROUND_RESTARTS with a small default and the existing readiness deadline, so persistent failures still terminate cleanly.

Validation

  • ./tests/start-monk-agent-background-retry.sh
  • ./tests/start-monk-agent-readiness-timeout.sh
  • ./tests/start-monk-agent-fastpath.sh
  • sh -n scripts/start-monk-agent.sh plugins/monk/scripts/start-monk-agent.sh .antigravity-plugin/scripts/start-monk-agent.sh tests/start-monk-agent-background-retry.sh tests/start-monk-agent-readiness-timeout.sh tests/start-monk-agent-fastpath.sh
  • generated launcher copy parity with cmp
  • Ruby YAML parse for .github/workflows/install-e2e.yml
  • git diff --check

Fixes #180.

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.

[Bug bounty] Linux agent start has no port-conflict recovery unlike macOS launchd path

1 participant