fix(daemon_pool): support both Python 3.11 and 3.14 worker signatures - #85961
Open
ypQQ1984 wants to merge 1 commit into
Open
fix(daemon_pool): support both Python 3.11 and 3.14 worker signatures#85961ypQQ1984 wants to merge 1 commit into
ypQQ1984 wants to merge 1 commit into
Conversation
Hermes ships two runtimes sharing the same daemon_pool.py: the gateway service runs on .venv Python 3.11 while the desktop runtime runs system Python 3.14. The upstream implementation only supports one signature: - 3.8-3.13: _worker(ref, work_queue, initializer, initargs) - 3.14: _worker(ref, ctx, work_queue) with _create_worker_context() A single-version implementation breaks the other runtime with AttributeError, which cascades into conversation compression and relay initialization failures (agent errors on messaging platforms). Detect at runtime with hasattr(self, "_create_worker_context") and build the worker args accordingly, so both runtimes work from the same file.
Collaborator
Contributor
fix(daemon_pool): support both Python 3.11 and 3.14 worker signatures
|
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.
Problem
Hermes ships two runtimes sharing the same
tools/daemon_pool.py: the gateway service runs on.venvPython 3.11 while the desktop runtime runs system Python 3.14. The upstream implementation only supports a single Python version:_worker(ref, work_queue, initializer, initargs)_worker(ref, ctx, work_queue)with_create_worker_context()A single-version implementation crashes the other runtime with
AttributeError: DaemonThreadPoolExecutor has no attribute ..., which cascades into_compress_context/ relay conversation initialization failures — surfacing as agent errors on messaging platforms (Feishu).Fix
Detect at runtime with
hasattr(self, "_create_worker_context")and build worker args for the matching signature, so both 3.11 and 3.14 runtimes work from the same file.Verification
Tested on both interpreters: submit() succeeds on Python 3.11 (uses
_initializer/_initargspath) and Python 3.14 (uses_create_worker_contextpath).