Skip to content

isShepherdHelperLabel

isShepherdHelperLabel(label): boolean

Defined in: src/tab-reaper.ts:47

Labels shepherd authors for its short-lived helper agents. A tab with one of these labels but no live agent is an orphaned husk (the probe/critic ended without its tab being closed — e.g. a shepherd restart cleared the in-memory tracking).

Scope filter, not a safety gate. This function is a first-pass scope filter; the caller’s process-liveness check (a live agent in herdr list) is the actual safety gate. This matters for the one exact match with no space — "rundown" — which IS a producible user slug. It is safe only because reapOrphanTabs never reaps a tab that has a live backing agent; a running user “rundown” session is therefore never touched.

Collision-proof markers (space-prefix or underscore): PROBE_NAME, DISTILL_LABEL and OPTIMIZE_LABEL contain underscores; every other helper uses a space-prefixed label ("review ", "name ", "plan-review ", "pr-critic ", "recap ", "autopilot ") or a multi-word exact phrase ("verify api key"). User sessions use prompt-derived [a-z0-9-] slugs — no spaces, no underscores — so none of these labels is reachable by a slug. Exception: "rundown" (exact, no space) relies on the liveness gate instead.

The distiller and optimizer each spawn under a UNIQUE per-run name of the form __distill__<8hex> / __optimize__<8hex> (prefixes DISTILL_LABEL / OPTIMIZE_LABEL), matched here by prefix. The prefix ends in __, which [a-z0-9-] slugs can never produce, so the prefix match stays collision-proof. The per-pane liveness check remains the actual safety gate.

Helpers covered:

  • __usage_probe__ — usage probe (PROBE_NAME)
  • __distill__<hex> — distiller (DISTILL_LABEL prefix, unique per run)
  • __optimize__<hex> — rule optimizer (OPTIMIZE_LABEL prefix, unique per run)
  • __merge__<hex> — background merge-suggestion pass (MERGE_LABEL prefix, unique per run)
  • review <desig> — critic / code-review spawns
  • name <desig> — background LLM namer
  • plan-review <desig> — plan-gate reviewer (plan-gate.ts)
  • pr-critic <repo>#<n> — standalone PR critic (standalone-critic.ts)
  • recap <desig> — recap generator (recap.ts)
  • rundown — herd-digest rundown (herd-digest.ts) — liveness-gated
  • autopilot <id> — autopilot LLM (autopilot-llm.ts)
  • verify api key — API-key verifier (verify-key.ts)

string

boolean