fix(gateway): preserve pending update prompts across restarts#18477
Closed
simbam99 wants to merge 1 commit into
Closed
fix(gateway): preserve pending update prompts across restarts#18477simbam99 wants to merge 1 commit into
simbam99 wants to merge 1 commit into
Conversation
Contributor
|
Merged via #20160 — cherry-picked your commit onto current |
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
This fixes a gateway
/updatestate-loss bug when Hermes asks the user an interactive update question and the gateway restarts before the user replies.Previously,
_watch_update_progress()deleted.update_prompt.jsonimmediately after forwarding the prompt to the user. If the gateway restarted while the update subprocess was still waiting on.update_response, the new gateway process had no durable prompt state left to recover from. The user's later reply would fall through as a normal message, and the update subprocess would remain blocked until timeout.What changed
.update_prompt.jsonon disk after forwarding the prompt..update_response.This keeps restart recovery intact while still preventing duplicate prompt spam within a single watcher process via
_update_prompt_pending.Why this is safe
_update_prompt_pending./updategateway IPC flow only.Tests
Added/updated coverage in
tests/gateway/test_update_streaming.pyfor:Repro before fix
/updatefrom a gateway platform.yorn.Before this fix, the prompt marker was already gone, so the restarted gateway could not recover the pending prompt and the reply would not reach the update subprocess.
Result after fix
The restarted gateway can see the still-pending
.update_prompt.json, re-forward the prompt, and route the user's eventual response back to the waiting update subprocess.