fix(gateway): avoid false failure reactions on restart cancellation#6942
Closed
bobashopcashier wants to merge 1 commit into
Closed
fix(gateway): avoid false failure reactions on restart cancellation#6942bobashopcashier wants to merge 1 commit into
bobashopcashier wants to merge 1 commit into
Conversation
6190ab5 to
71f699b
Compare
71f699b to
3943ad2
Compare
Contributor
|
Merged via PR #7123. Your commit was cherry-picked onto current main with your authorship preserved. Clean enum-based fix — thanks! |
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?
Distinguishes expected shutdown/restart cancellation from genuine processing failure so Discord, Telegram, and Matrix adapters do not emit false terminal failure reactions during intentional gateway cancellation.
Related Issue
Fixes #6315
Related historical issue: #1414
Follow-up to PR #1427
Separate env/pairing hardening is tracked in PR #6956
Type of Change
Changes Made
gateway/platforms/base.pyso expected cancellation is not treated like an ordinary processing failuregateway/platforms/discord.py,gateway/platforms/telegram.py, andgateway/platforms/matrix.pyto avoid false terminal failure reactions on expected cancellationtests/gateway/test_base_topic_sessions.py,tests/gateway/test_discord_reactions.py,tests/gateway/test_matrix.py, andtests/gateway/test_telegram_reactions.pyHow to Test
/Users/kennyxie/Documents/Code/clawspace/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_discord_reactions.py tests/gateway/test_telegram_reactions.py tests/gateway/test_base_topic_sessions.py tests/gateway/test_gateway_shutdown.py tests/gateway/test_matrix.py -n0 -q❌is emittedChecklist
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 or workflows — or N/AScreenshots / Logs
/Users/kennyxie/Documents/Code/clawspace/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_discord_reactions.py tests/gateway/test_telegram_reactions.py tests/gateway/test_base_topic_sessions.py tests/gateway/test_gateway_shutdown.py tests/gateway/test_matrix.py -n0 -q→152 passed, 3 skipped