fix(gateway): stop typing before post-delivery callbacks - #37556
Merged
kshitijk4poor merged 1 commit intoJun 10, 2026
Merged
Conversation
This was referenced Jun 10, 2026
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
davidgut1982
pushed a commit
to davidgut1982/hermes-agent
that referenced
this pull request
Jun 17, 2026
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
donbowman
pushed a commit
to donbowman/hermes-agent
that referenced
this pull request
Jul 13, 2026
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
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?
Fixes a gateway cleanup ordering bug where a hung post-delivery callback could prevent
_process_message_background()from stopping the platform typing indicator. The adapter now stops typing before running deferred callback work and bounds awaited callbacks to 30 seconds so callback I/O cannot keep the cleanup path stuck indefinitely.Related Issue
Refs #24971
Type of Change
Changes Made
gateway/platforms/base.py: stop the_keep_typingtask and explicitly clear platform typing before post-delivery callbacks run; wrap awaited post-delivery callbacks in a 30-second timeout.tests/gateway/test_run_progress_topics.py: add regression coverage proving a hung post-delivery callback does not keep typing alive or block message processing indefinitely.How to Test
$VIRTUAL_ENV/bin/python -m pytest tests/gateway/test_run_progress_topics.py::test_base_processing_releases_post_delivery_callback_after_main_send tests/gateway/test_run_progress_topics.py::test_base_processing_stops_typing_before_hung_post_delivery_callback -q— passed.$VIRTUAL_ENV/bin/python -m pytest tests/ -q -x --timeout=60— failed after 5:25 intests/acp/test_approval_isolation.py::TestAcpExecAskGate::test_interactive_env_var_routes_to_callback, outside the gateway files touched by this PR.$VIRTUAL_ENV/bin/python -m ruff check gateway/platforms/base.py tests/gateway/test_run_progress_topics.py— passed.$VIRTUAL_ENV/bin/python scripts/check-windows-footguns.py gateway/platforms/base.py tests/gateway/test_run_progress_topics.py— passed.git diff --check— passed.$VIRTUAL_ENV/bin/python -m ruff format --check gateway/platforms/base.py tests/gateway/test_run_progress_topics.py— failed because these existing files would be reformatted wholesale; this PR leaves unrelated formatting untouched.Checklist
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/AFor New Skills
N/A
Screenshots / Logs
N/A