Skip to content

fix(safety): wire emergency-stop into lifeline forward path (P0)#377

Merged
JKHeadley merged 2 commits into
mainfrom
echo/emergency-stop-forward-fix
May 25, 2026
Merged

fix(safety): wire emergency-stop into lifeline forward path (P0)#377
JKHeadley merged 2 commits into
mainfrom
echo/emergency-stop-forward-fix

Conversation

@JKHeadley
Copy link
Copy Markdown
Owner

P0 safety fix

"stop everything" was not honored for lifeline-owned-polling agents (e.g. echo). The MessageSentinel emergency-stop/pause intercept lived only in TelegramAdapter.processUpdate() — the adapter's own poll loop — which lifeline-owned agents never run. Their inbound arrives via the lifeline → POST /internal/telegram-forward, which had zero sentinel references, so an emergency-stop was delivered to the session as normal text and nothing structurally halted a running (or wedged, mid-tool-call) session.

Verified to the data-flow tier: the classifier itself works ("stop everything"emergency-stop); the gap was purely where the intercept was wired.

The fix

Wire the same emergency-stop/pause intercept into /internal/telegram-forward, fail-open (a sentinel error never blocks message delivery), reusing the existing onSentinelKillSession/onSentinelPauseSession callbacks + stopAutonomousTopic. No new kill logic. The processUpdate intercept is unchanged (still serves adapter-poll agents).

Tests

  • New tests/integration/telegram-forward-sentinel-intercept.test.ts — 6/6 green: emergency-stop kills + not-routed; pause; normal routes untouched; fail-open (throwing sentinel still delivers); no-active-session acknowledges.
  • Wiring-integrity assertion that the forward route classifies before routing — the guard whose absence caused the original drift.
  • Full forward-route suite green (no regression); typecheck clean.

Docs / process

  • Spec: docs/specs/emergency-stop-forward-path-wiring.md (approved by Justin, Telegram topic 12702) + ELI16 companion.
  • Side-effects review: upgrades/side-effects/emergency-stop-forward-path-wiring.md.
  • Release notes: upgrades/NEXT.md (v1.2.72).

Pure server-side route logic — ships to every agent on the normal server update; no agent-installed file changes (no migration). Fail-open by design: worst case of a bug is "behaves like today."

🤖 Generated with Claude Code

Instar Agent (echo) and others added 2 commits May 24, 2026 23:53
…ram-forward (P0)

Lifeline-owned-polling agents (e.g. echo) never run TelegramAdapter.processUpdate,
where the sentinel intercept lived — so 'stop everything' was injected as a normal
message and never halted a running/wedged session. Wire the same emergency-stop/pause
intercept into the lifeline forward route, FAIL-OPEN (a sentinel error never blocks
delivery), reusing onSentinelKillSession/onSentinelPauseSession + stopAutonomousTopic.
Adds an integration suite (kill/pause/normal/fail-open/no-session) + a wiring-integrity
test asserting classify-before-route so the drift can't silently recur.

Spec: docs/specs/emergency-stop-forward-path-wiring.md (approved, Justin, topic 12702)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
instar Building Building Preview May 25, 2026 6:55am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant