fix: resource leaks and crashes in long-running gateway#993
Closed
Himess wants to merge 1 commit into
Closed
Conversation
- Prevent RotatingFileHandler accumulation: each AIAgent.__init__ was appending a new handler to the root logger without checking if one already exists. After N messages the same log line is written N times. Guard with a module-level flag. - Fix delivery dedup tuple mismatch: seen_platforms stores 3-tuples (platform, chat_id, thread_id) but the local check used a 2-tuple that never matches, causing duplicate LOCAL deliveries. - Fix AttributeError in context compressor: content can be None when the API returns no text, calling .strip() on None crashes. - Shutdown old ThreadPoolExecutor in resize_tool_pool: the previous executor was replaced without shutdown(), leaking threads.
teknium1
pushed a commit
that referenced
this pull request
Mar 14, 2026
Salvages the two still-relevant fixes from PR #993 onto current main: - use a 3-tuple LOCAL delivery key so explicit/local-origin targets are not duplicated - shut down the previous agent-loop ThreadPoolExecutor when resizing the global pool Adds regression tests for both behaviors.
teknium1
added a commit
that referenced
this pull request
Mar 14, 2026
Merging the non-redundant fixes salvaged from #993 onto current main, plus adjacent trajectory compressor hardening found during review.
Contributor
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
Salvages the two still-relevant fixes from PR NousResearch#993 onto current main: - use a 3-tuple LOCAL delivery key so explicit/local-origin targets are not duplicated - shut down the previous agent-loop ThreadPoolExecutor when resizing the global pool Adds regression tests for both behaviors.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…048e6599 Merging the non-redundant fixes salvaged from NousResearch#993 onto current main, plus adjacent trajectory compressor hardening found during review.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Salvages the two still-relevant fixes from PR NousResearch#993 onto current main: - use a 3-tuple LOCAL delivery key so explicit/local-origin targets are not duplicated - shut down the previous agent-loop ThreadPoolExecutor when resizing the global pool Adds regression tests for both behaviors.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…048e6599 Merging the non-redundant fixes salvaged from NousResearch#993 onto current main, plus adjacent trajectory compressor hardening found during review.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
Salvages the two still-relevant fixes from PR NousResearch#993 onto current main: - use a 3-tuple LOCAL delivery key so explicit/local-origin targets are not duplicated - shut down the previous agent-loop ThreadPoolExecutor when resizing the global pool Adds regression tests for both behaviors.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…048e6599 Merging the non-redundant fixes salvaged from NousResearch#993 onto current main, plus adjacent trajectory compressor hardening found during review.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
Salvages the two still-relevant fixes from PR NousResearch#993 onto current main: - use a 3-tuple LOCAL delivery key so explicit/local-origin targets are not duplicated - shut down the previous agent-loop ThreadPoolExecutor when resizing the global pool Adds regression tests for both behaviors.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…048e6599 Merging the non-redundant fixes salvaged from NousResearch#993 onto current main, plus adjacent trajectory compressor hardening found during review.
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.
Fixes #990
Four fixes for issues that compound in long-running gateway processes:
RotatingFileHandleraddition with a module-level flag so it only runs once(Platform.LOCAL, None)→(Platform.LOCAL, None, None)to match the 3-tuple inseen_platforms(content or "").strip()to handleNoneAPI responsesshutdown(wait=False)old executor before replacing inresize_tool_pool()