diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-03-24 14:39:20 -0700 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-03-24 14:39:20 -0700 |
| commit | af025aa35bcd403b15e2b44281304c1e92da0f5d (patch) | |
| tree | 2ebec944274c1ce98bc231813c471d59aee27e98 /RELEASE-NOTES.md | |
| parent | 738a18d6ff47be822cfd2e81ace56b3287814dd4 (diff) | |
Fix owner-PID lifecycle monitoring for cross-platform reliabilityfix/owner-pid-lifecycle
Two bugs caused the brainstorm server to self-terminate within 60s:
1. ownerAlive() treated EPERM (permission denied) as "process dead".
When the owner PID belongs to a different user (Tailscale SSH,
system daemons), process.kill(pid, 0) throws EPERM — but the
process IS alive. Fixed: return e.code === 'EPERM'.
2. On WSL, the grandparent PID resolves to a short-lived subprocess
that exits before the first 60s lifecycle check. The PID is
genuinely dead (ESRCH), so the EPERM fix alone doesn't help.
Fixed: validate the owner PID at server startup — if it's already
dead, it was a bad resolution, so disable monitoring and rely on
the 30-minute idle timeout.
This also removes the Windows/MSYS2-specific OWNER_PID="" carve-out
from start-server.sh, since the server now handles invalid PIDs
generically at startup regardless of platform.
Tested on Linux (magic-kingdom) via Tailscale SSH:
- Root-owned owner PID (EPERM): server survives ✓
- Dead owner PID at startup (WSL sim): monitoring disabled, survives ✓
- Valid owner that dies: server shuts down within 60s ✓
Fixes #879
Diffstat (limited to 'RELEASE-NOTES.md')
| -rw-r--r-- | RELEASE-NOTES.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 2abd146..c73a716 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -17,7 +17,7 @@ The subagent review loop (dispatching a fresh agent to review plans/specs) doubl ### Bug Fixes -- **Owner-PID false positives** — the brainstorm server's `ownerAlive()` check treated EPERM (permission denied) the same as ESRCH (process not found), causing the server to self-terminate within 60 seconds whenever the owner process ran as a different user. This affected WSL (owner is a Windows process), Tailscale SSH, and any cross-user scenario. Fixed by treating EPERM as "alive". (#879) +- **Owner-PID lifecycle fixes** — the brainstorm server's owner-PID monitoring had two bugs causing false shutdowns within 60 seconds: (1) EPERM from cross-user PIDs (Tailscale SSH, etc.) was treated as "process dead", and (2) on WSL the grandparent PID resolves to a short-lived subprocess that exits before the first lifecycle check. Fixed by treating EPERM as "alive" and validating the owner PID at startup — if it's already dead, monitoring is disabled and the server relies on the 30-minute idle timeout. This also removes the Windows/MSYS2-specific carve-out from `start-server.sh` since the server now handles it generically. (#879) - **writing-skills** — corrected false claim that SKILL.md frontmatter supports "only two fields"; now says "two required fields" and links to the agentskills.io specification for all supported fields (PR #882 by @arittr) ### Codex App Compatibility |
