Skip to content

fix(microvm): recognize absent Darwin daemon processes - #2220

Merged
JAORMX merged 1 commit into
mainfrom
fix/darwin-microvm-restart-20261009
Oct 9, 2026
Merged

JAORMX merged 1 commit into
mainfrom
fix/darwin-microvm-restart-20261009

Conversation

@JAORMX

@JAORMX JAORMX commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix a Darwin restart failure found during a real OpenRouter/MicroVM README smoke test on ozzmini.

For a retained daemon PID that no longer exists, macOS ps -p PID -o lstart= exits 1. The existing identity code propagated that generic error, so restart classified an absent process as uncertain and refused to start. An independent kill(PID, 0) returned ESRCH in the real reproduction.

Normalize a failed Darwin ps query to fs.ErrNotExist only when the independent existence probe confirms ESRCH. Live, inaccessible, and unknown processes preserve the original error and fail closed. Linux behavior and authenticated Darwin shutdown are unchanged.

Validation

  • Existing Darwin test file covers a real reaped test child, replacement of an absent recorded daemon, refusal for a live recorded process, and uncertain live identity failure.
  • Test subprocesses have finite lifetime and cleanup verifies their recorded start identity before signaling their dedicated process group.
  • go test ./internal/adapter/microvmmanager passed on Linux; Darwin arm64 test cross-compilation passed.
  • Spec/security reviews found no production issues. Standards/test review identified a cleanup gap; that was addressed before publication.
  • Full CI runs on this ready PR. Native Darwin validation and the real-agent task will resume after merge, with retained data preserved.

Confirm ESRCH independently after failed ps identity queries so compatible stopped daemons can restart without treating uncertain live processes as absent.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX force-pushed the fix/darwin-microvm-restart-20261009 branch from afd6064 to 6c3dade Compare October 9, 2026 17:43
@JAORMX
JAORMX merged commit 599bf01 into main Oct 9, 2026
37 checks passed
@JAORMX
JAORMX deleted the fix/darwin-microvm-restart-20261009 branch October 9, 2026 18:01
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 13, 2026
2 tasks
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