---
phase: quick
plan: 260329-sj0
subsystem: owl-messaging
tags: [bugfix, send, ephemeral-perch, BUSY-state]
dependency_graph:
  requires: []
  provides: [fix-send-ephemeral]
  affects: [owl.sh, src/owl/send.rs]
tech_stack:
  added: []
  patterns: [BUSY-pid-aware active-perch detection]
key_files:
  created: []
  modified:
    - owl.sh
    - src/owl/send.rs
decisions:
  - "BUSY pid + ready + info.json = active perch (not ephemeral)"
metrics:
  duration: 57s
  completed: "2026-03-30T03:37:08Z"
---

# Quick Fix 260329-sj0: Fix owl send ephemeral perch when caller has active perch

**One-liner:** BUSY pid state in send/ask now correctly detected as active perch, preventing ephemeral creation from clobbering a live listener.

## Changes Made

### Task 1: Harden active-perch detection for BUSY pid state

**owl.sh (send|ask case, lines 290-304):**
- Added explicit `info.json` existence check inside the `ready` file guard
- When `_get_pid` returns empty (BUSY/non-numeric pid) AND both `ready` and `info.json` exist, set `EPHEMERAL=false` -- the poll process is alive but temporarily processing
- When `_get_pid` returns a numeric pid, behavior unchanged: check `kill -0` liveness

**src/owl/send.rs (lines 26-40):**
- Added `info_path.exists()` guard before calling `get_pid_from_info`
- When `get_pid_from_info` returns `None` (BUSY state) but both ready and info.json exist, return `false` (active perch) instead of `true` (ephemeral)
- Added comment explaining the BUSY semantics

### Logic Summary (both implementations)

```
if ready file exists:
    if info.json exists:
        pid = get_pid(info.json)
        if pid is numeric AND alive:  ephemeral = false  (active listener)
        elif pid is BUSY (empty/None): ephemeral = false  (processing, will resume)
        else:                          ephemeral = true   (dead numeric PID)
    else:
        ephemeral = true               (stale, no info.json)
else:
    ephemeral = true                   (no perch at all)
```

## Deviations from Plan

None -- plan executed exactly as written.

## Known Stubs

None.

## Commits

| Task | Commit | Message |
|------|--------|---------|
| 1 | fb0245f | fix(260329-sj0): treat BUSY pid as active perch in send/ask |

## Self-Check: PASSED
