fix(gateway): retry startup auto-resume when a failed platform reconnects#37669
fix(gateway): retry startup auto-resume when a failed platform reconnects#37669Frowtek wants to merge 1 commit into
Conversation
|
Clean separation of startup resume vs reconnect resume. The One thing worth checking: the |
|
Cherry-picked this onto a v0.15.2-based fork (Discord gateway) alongside #30030. Resolves a restart-resume amnesia we were hitting — a session whose platform reconnected slightly after startup never got its interrupted turn resumed until a fresh user message arrived. The |
What does this PR do?
The gateway's documented startup auto-resume skips sessions whose platform
adapter isn't connected yet — and never retries them. A platform that connects
shortly after startup left its interrupted sessions behind; they only recovered
if the user sent a new message. This wires the auto-resume into the reconnect
path so a recovered platform retries the continuation for its own sessions.
Related Issue
Type of Change
Changes Made
gateway/run.py—_schedule_resume_pending_sessions()gains an optionalplatformfilter + an in-flight guard against double resumes.gateway/run.py— the reconnect-watcher success path re-runs the auto-resumescoped to the reconnected platform.
tests/gateway/test_restart_resume_pending.py,tests/gateway/test_platform_reconnect.py— regression coverage.How to Test
resume_pendingwhile its adapter is offline at startup → skipped.scripts/run_tests.sh tests/gateway/test_restart_resume_pending.py tests/gateway/test_platform_reconnect.py -q— all pass.Checklist
fix(gateway): ...)