---
name: perched-gate-run-strips-agent-env
description: Gate suites run from a perched session inherit OWL_SESSION_ID → DAEMON_STOP_REFUSED reds in daemon-stop tests; strip agent env vars for every rig run.
metadata: 
  node_type: memory
  type: project
  originSessionId: 00d52893-7427-4ec7-85be-eebb7e921b11
  modified: 2026-08-04T02:42:14.404Z
---

A gate rig driven from a perched/live-agent session inherits `OWL_SESSION_ID` (and `SPT_AGENT_ID`/`SPT_ENDPOINT_ID`) into every test process. The endpoint-guard on broker-stopping commands then refuses inside tests (`daemon_stop_convoy_e2e` red with `DAEMON_STOP_REFUSED: $OWL_SESSION_ID is set`) — a red that reads as the lane's but is the DRIVER's identity.

**Why:** the guard is doing its job (an spt endpoint must never stop the broker hosting the node); the rig defect is running the suite in an agent's env at all.

**How to apply:** every gate-rig cargo/nextest invocation from a perched session runs under `env -u OWL_SESSION_ID -u SPT_AGENT_ID -u SPT_ENDPOINT_ID`. Discriminate before attributing: the same 2026-08-03 run also carried 3 reds from the cross-package fixture-bin gap ([[spt-bin-lane-fixture-bins]] — pre-build `cargo build -p mock-adapter --bin mock-session`); both classes pass on re-run with the rig corrected. Related: [[e2e-leaked-daemons-shared-box]], [[bystander-test-reads-process-global]].
