fix(safety): wire emergency-stop into lifeline forward path (P0)#377
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P0 safety fix
"stop everything" was not honored for lifeline-owned-polling agents (e.g. echo). The
MessageSentinelemergency-stop/pause intercept lived only inTelegramAdapter.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 existingonSentinelKillSession/onSentinelPauseSessioncallbacks +stopAutonomousTopic. No new kill logic. TheprocessUpdateintercept is unchanged (still serves adapter-poll agents).Tests
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.Docs / process
docs/specs/emergency-stop-forward-path-wiring.md(approved by Justin, Telegram topic 12702) + ELI16 companion.upgrades/side-effects/emergency-stop-forward-path-wiring.md.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