fix(gateway): route conflict-retry start_polling failure to reconnect ladder - #25232
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(gateway): route conflict-retry start_polling failure to reconnect ladder#25232liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
… ladder When start_polling() raises during a conflict retry in _handle_polling_conflict, the exception was logged and swallowed. Polling stayed dead with no further error callbacks, leaving the gateway alive but deaf until manual restart. Route the failure into _handle_polling_network_error which handles retries with exponential back-off and eventual escalation to retryable-fatal, matching the existing behavior in the network-error retry path. Fixes NousResearch#25221
liuhao1024
force-pushed
the
fix/issue-25221-conflict-retry-reconnect
branch
from
May 13, 2026 21:14
95e3977 to
2a49504
Compare
This was referenced May 13, 2026
Closed
Closed
3 tasks
Contributor
|
This looks implemented on current main by a later Telegram conflict-recovery fix. Automated hermes-sweeper review evidence:
This is not byte-for-byte the same as the PR's proposed route through |
This was referenced Aug 3, 2026
Closed
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.
What does this PR do?
When
start_polling()raises during a conflict retry in_handle_polling_conflict, the exception was logged and swallowed. Polling stayed dead with no further error callbacks, leaving the gateway "alive but deaf" until manual restart.Root Cause
In
gateway/platforms/telegram.py,_handle_polling_conflictretriesstart_polling()after a 409 Conflict. If that retry call itself fails (timeout, network error), theexceptblock logged the error and returned — without routing the failure into the existing reconnect ladder.The
_handle_polling_network_errorhandler already has the correct pattern: whenstart_polling()fails in its retry path, it self-schedules a new_handle_polling_network_errortask viaasyncio.ensure_future(lines 814-823). The conflict-retry path was missing this.Related Issue
N/A
Type of Change
Changes Made
How to Test
pytest tests/ -q— all tests should passChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture and workflows — or N/ACode Intelligence
_handle_polling_conflict(callers: 2, callees: 3, flows: 0)_handle_polling_network_erroralready uses the sameasyncio.ensure_futureself-scheduling pattern (lines 814-823)Regression Coverage
New test
test_conflict_retry_routes_to_reconnect_on_start_polling_failureintests/gateway/test_telegram_network_reconnect.py:start_pollingto raise during conflict retry_background_taskstest_reconnect_self_schedules_on_start_polling_failurewhich covers the network-error pathTesting
Fixes Telegram gateway can stay alive with dead polling after conflict retry start_polling failure #25221