fix: resource leaks and crashes in long-running gateway#993
Open
Himess wants to merge 1 commit intoNousResearch:mainfrom
Open
fix: resource leaks and crashes in long-running gateway#993Himess wants to merge 1 commit intoNousResearch:mainfrom
Himess wants to merge 1 commit intoNousResearch:mainfrom
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.
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()