Fix restart sentinel internal continuations#88161
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 9:59 PM ET / 01:59 UTC. Summary PR surface: Source +40, Tests +82. Total +122 across 36 files. Reproducibility: yes. Source inspection of current main shows session-scoped restarts infer an agentTurn continuation and route final delivery back to the channel; Mantis also captured baseline Telegram behavior for the visible restart-continuation path. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the internal/message-tool-only restart-continuation behavior only after a maintainer explicitly approves the compatibility and message-delivery semantics for existing restart/update workflows. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows session-scoped restarts infer an agentTurn continuation and route final delivery back to the channel; Mantis also captured baseline Telegram behavior for the visible restart-continuation path. Is this the best way to solve the issue? Yes, with maintainer approval. The patch addresses the implicated runtime path directly and keeps explicit visible follow-up available through the message tool, but the compatibility semantics are intentional enough to require human approval. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f870beac85ec. Label changesLabel justifications:
Evidence reviewedPR surface: Source +40, Tests +82. Total +122 across 36 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for restart continuation delivery.
Motion-trimmed clips: Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-88161/run-26667359644-1/index.json |
9d3e8e5 to
8500b54
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8500b54 to
dccbe07
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* fix restart sentinel internal continuations * update gateway prompt snapshots * stabilize sandbox browser audit timer tests * drive sandbox audit timeouts deterministically * drive gh-read timeout tests deterministically * drive label-open-issues timeout tests deterministically * document deterministic timeout test timers * test: preserve deterministic timer setup after rebase
* fix restart sentinel internal continuations * update gateway prompt snapshots * stabilize sandbox browser audit timer tests * drive sandbox audit timeouts deterministically * drive gh-read timeout tests deterministically * drive label-open-issues timeout tests deterministically * document deterministic timeout test timers * test: preserve deterministic timer setup after rebase
* fix restart sentinel internal continuations * update gateway prompt snapshots * stabilize sandbox browser audit timer tests * drive sandbox audit timeouts deterministically * drive gh-read timeout tests deterministically * drive label-open-issues timeout tests deterministically * document deterministic timeout test timers * test: preserve deterministic timer setup after rebase




Summary
Fixes #87792.
This makes restart-sentinel continuations internal by default instead of letting synthetic restart turns auto-deliver final assistant output back to the originating channel. It also preserves current channel/thread/message context for CLI, MCP, and queued follow-up paths so an explicit post-restart continuation can still speak only when it deliberately uses the message tool.
Verification
git diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main:autoreview clean: no accepted/actionable findings reportedpnpm buildnode scripts/run-vitest.mjs src/infra/restart-sentinel.test.ts src/gateway/server-restart-sentinel.test.ts src/agents/tools/gateway-tool.test.ts src/auto-reply/reply/commands-session-restart.test.ts src/gateway/server-methods/update.test.ts src/gateway/mcp-http.test.ts src/agents/cli-runner/prepare.test.ts src/gateway/tool-resolution.test.ts src/agents/cli-runner.spawn.test.ts src/auto-reply/reply/agent-runner-utils.test.ts src/auto-reply/reply/followup-runner.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts test/scripts/label-open-issues.test.ts test/scripts/gh-read.test.ts src/security/audit-sandbox-browser.test.ts: passed, 23 files / 541 testsblacksmith-testbox, focused build + regression suite passed, 23 files / 541 testswhatsappQA credential and mock-openai provider mode: passed; credential identifier redactedReal Behavior Proof
Behavior addressed: Restart-sentinel
agentTurncontinuations no longer auto-deliver plain final assistant output into the originating channel. The restart notice itself still delivers to the live channel route.Real environment tested: Local source checkout with the real WhatsApp transport, a Convex-leased
whatsappQA credential, and mock-openai provider mode. Credential identifiers and live routing details are redacted from this PR body.Exact steps or command run after this patch: Built the current branch, started the QA WhatsApp driver and SUT gateway, sent a real WhatsApp group seed turn, wrote a restart sentinel with an explicit
agentTurncontinuation marker, restarted the gateway viarestartAfterStateMutation, then watched the live group for the restart notice and for absence of the continuation marker.Evidence after fix: Local live proof passed with
ISSUE_87792_LIVE_FIX_PROOF pass credential=<redacted> seedMs=5182 noticeMs=10379andISSUE_87792_LIVE_REGRESSION_REPRO pass continuationMarkerAbsentMs=30000.Observed result after fix: The seed WhatsApp group turn replied, the restart notice was delivered after restart, and the explicit continuation final marker did not appear in the live WhatsApp group during the regression window.
What was not tested: I did not run a live Telegram or Discord restart-sentinel path. Blacksmith could run the focused regression suite, but the exact custom live proof could not run there because the delegated Testbox path cannot forward local credential env; a workflow-backed WhatsApp live lane was blocked by a logged-out pooled WhatsApp session before scenario execution.