fix(gateway): preserve message before stale-code restart#19238
Closed
ai-ag2026 wants to merge 1 commit into
Closed
fix(gateway): preserve message before stale-code restart#19238ai-ag2026 wants to merge 1 commit into
ai-ag2026 wants to merge 1 commit into
Conversation
1 task
8b981cd to
c0943df
Compare
Contributor
Author
|
Rebased onto current upstream main and force-pushed with lease. Local targeted verification after rebase: python -m pytest tests/gateway/test_stale_code_self_check.py -q -o 'addopts='
# '13No code changes beyond the rebase. |
Contributor
Author
|
Closing this one rather than rebasing it further. The branch is now stale/conflicting against current Thanks for the previous review bandwidth. |
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.
Summary
Preserve the authorized user message that triggers the gateway stale-code self-check before requesting a restart.
Problem
The stale-code self-check added for #17648 correctly detects when a long-running gateway survived an update and should restart before dispatching into stale imports.
However, the check currently returns a retry-after-restart notice without persisting the triggering message. For polling/event platforms such as Telegram, the update has already been consumed by the time
_handle_message()returns. The gateway restarts, but the user's actual request is gone and the platform will not replay it.Observed class: after a WebUI/Hermes update, Telegram messages received during the stale-code restart path were acknowledged with the restart notice but never delivered to the agent after restart.
Change
resume_pendingwith reasonstale_code_restart.Tests
python -m py_compile gateway/run.py tests/gateway/test_stale_code_self_check.py python -m pytest tests/gateway/test_stale_code_self_check.py tests/gateway/test_restart_resume_pending.py -q # 69 passedRefs #17648.