diff --git a/gateway/run.py b/gateway/run.py index 9a062501cce..545b9c05b31 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -17434,12 +17434,25 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew and _resume_entry is not None and getattr(_resume_entry, "resume_pending", False) ): + _sn_reason = ( + getattr(_resume_entry, "resume_reason", None) or "restart_timeout" + ) + _sn_reason_phrase = ( + "a gateway restart" + if _sn_reason == "restart_timeout" + else "a gateway shutdown" + if _sn_reason == "shutdown_timeout" + else "a gateway interruption" + ) message = ( - "[System note: The previous turn in this session was " - "interrupted by a gateway restart. Review the conversation " - "history above, finish any unfinished work, and summarize " - "what was accomplished, then wait for the user's next " - "message.]" + f"[System note: The previous turn was interrupted by " + f"{_sn_reason_phrase}; the gateway is now back online. " + f"Any restart/shutdown command in the history has already " + f"run — do NOT re-execute or verify it. Report to the user " + f"that the session was restored successfully and ask what " + f"they would like to do next. Do NOT re-execute old tool " + f"calls — skip any unfinished work from the conversation " + f"history.]" ) _approval_session_key = session_key or "" diff --git a/scripts/release.py b/scripts/release.py index 30e0ef1de28..13b1103f17e 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -45,6 +45,7 @@ ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json" # Auto-extracted from noreply emails + manual overrides AUTHOR_MAP = { + "7698789+abchiaravalle@users.noreply.github.com": "abchiaravalle", # PR #46997 salvage (recover resume_pending sessions: dual freshness signal + empty-turn safety net so restart auto-resume never sends a blank user turn) "swissly@users.noreply.github.com": "swissly", # PR #47167 salvage (wrap cron delivery thread-pool fallback in its own try/except so a per-target failure can't escape the except-RuntimeError block and crash the multi-target delivery loop; #47163) "30854794+YLChen-007@users.noreply.github.com": "YLChen-007", # PR #27289 salvage (case-insensitive streaming reasoning-tag filter in cli.py _stream_delta + gateway stream_consumer so mixed-case variants like / are suppressed, not just the hardcoded case literals) "27672904+kangsoo-bit@users.noreply.github.com": "kangsoo-bit", # PR #47508 salvage (keep Telegram gateway alive on transient bootstrap network errors: best-effort deleteWebhook + resilient start_polling degrade to background recovery instead of failing startup) diff --git a/tests/gateway/test_restart_resume_pending.py b/tests/gateway/test_restart_resume_pending.py index 15d7b104f0b..198e1cb3269 100644 --- a/tests/gateway/test_restart_resume_pending.py +++ b/tests/gateway/test_restart_resume_pending.py @@ -195,12 +195,23 @@ def _simulate_note_injection( and resume_entry is not None and getattr(resume_entry, "resume_pending", False) ): + sn_reason = getattr(resume_entry, "resume_reason", None) or "restart_timeout" + sn_reason_phrase = ( + "a gateway restart" + if sn_reason == "restart_timeout" + else "a gateway shutdown" + if sn_reason == "shutdown_timeout" + else "a gateway interruption" + ) message = ( - "[System note: The previous turn in this session was " - "interrupted by a gateway restart. Review the conversation " - "history above, finish any unfinished work, and summarize " - "what was accomplished, then wait for the user's next " - "message.]" + f"[System note: The previous turn was interrupted by " + f"{sn_reason_phrase}; the gateway is now back online. " + f"Any restart/shutdown command in the history has already " + f"run — do NOT re-execute or verify it. Report to the user " + f"that the session was restored successfully and ask what " + f"they would like to do next. Do NOT re-execute old tool " + f"calls — skip any unfinished work from the conversation " + f"history.]" ) return message