Repository navigation
Description
Problem
The fleet orphan reaper in src/autoskillit/cli/fleet/_fleet_lifecycle.py:113-114 uses read_starttime_ticks(pid) from core/runtime/_linux_proc.py to verify PID identity before killing an orphan process. On macOS, /proc does not exist, so read_starttime_ticks() returns None.
The identity guard:
current_ticks = read_starttime_ticks(pid)
if current_ticks is not None and current_ticks == dispatch.dispatched_starttime_ticks:
# KILL path — only reached on Linux
else:
# "reaped_pid_recycled" path — NO KILL issuedWhen current_ticks is None (macOS), the guard evaluates False, the reaper takes the else branch, marks the dispatch as reaped_pid_recycled, and never sends a signal to the orphan process. This is a silent behavioral gap, not an intentional design choice.
Failure Chain
- Test writes
dispatched_starttime_ticks=0(becauseread_starttime_ticksreturnsNoneon macOS, collapsed viaor 0) - Reaper reads
current_ticks = read_starttime_ticks(pid)→None - Guard
current_ticks is not None→False→ kill branch skipped - Orphan
sleep 999process stays alive test_orphan_l3_reapingassertionnot psutil.pid_exists(orphan_pid) or _is_zombie(orphan_pid)fails
Related Functions
read_starttime_ticks()—src/autoskillit/core/runtime/_linux_proc.py— reads/proc/{pid}/statread_boot_id()— same module — reads/proc/sys/kernel/random/boot_id_reap_stale_dispatches()—src/autoskillit/cli/fleet/_fleet_lifecycle.py:86-134kill_process_tree()—src/autoskillit/execution/process/_process_kill.py:48-58
Potential Approach
When current_ticks is None (non-Linux), fall back to psutil.Process(pid).create_time() for cross-platform PID-reuse detection. Both dispatched_starttime_ticks and the current check would use the same cross-platform API. This is already available via psutil on all platforms.
Alternatively, on non-Linux where /proc identity is unavailable, treat the process as the original orphan (assume no PID recycling) and proceed with the kill — PID-reuse protection is already degraded without /proc.
Context
- Discovered via PR test #945 macOS-15 CI failure
- Investigation report:
.autoskillit/temp/investigate/investigation_macos_ci_failures_pr945_2026-05-08_160000.md - Note: Fleet is currently a develop-only experimental feature. See companion issue for test gating.
Activity