fix(python): support Python 3.14 (daemon pool WorkerContext, wake litert bridge, requires-python ceiling, 3.14 CI lane) - #53
Open
spfcraze wants to merge 4 commits into
Open
Conversation
…d litert bridge, raise requires-python ceiling)
spfcraze
force-pushed
the
fix/python-3.14-support
branch
from
August 10, 2026 20:15
753616d to
39a2268
Compare
૮ >ﻌ< ა ci reviewrunning on 39a2268 — ci: add Python 3.14 test lane exercising the 3.14 compatibil waiting for more jobs to start…
|
…14 runtime import smoke (AI-review points 1,3) Addresses AI-review observations on PR NousResearch#83433: 1. daemon_pool: the 3.14 worker-signature branch was selected by hasattr(self, '_create_worker_context') alone, which a CPython fork could expose without the new _worker(...ctx, work_queue) contract. Now gated on BOTH sys.version_info >= (3,14) AND the attribute. Regression test verifies the branch selector + the source gate. 3. CI: the 3.14 lane ran only four daemon-pool-adjacent test files, leaving runtime import regressions (gateway/agent/tools) uncovered on 3.14. Added a runtime import smoke importing the core persistent/ agent/gateway/tool modules so a 3.14 import break surfaces in CI. Point 2 (uv.lock exclude-newer) verified: all 56 after-window packages are covered by exclude-newer-package exceptions; uv lock --check passes clean (249 pkgs). No change needed. Point 4 (wake_word backend) verified: ensure_tflite_runtime imports the real tflite_runtime first and falls back to ai_edge_litert only if absent (sys.modules.setdefault) — deterministic, no conflict. No change needed.
6 tasks
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.
fix(python): support Python 3.14 — daemon pool WorkerContext, wake-word litert bridge, raise requires-python ceiling
Summary
This PR makes hermes-agent run on Python 3.14 (verified against 3.14.4) while
remaining fully backward-compatible with 3.11/3.12/3.13. It contains exactly
three changes, each independently verified:
tools/daemon_pool.py— the only code-level 3.14 blocker: CPython 3.14changed the
concurrent.futures.thread._workersignature from(executor_reference, work_queue, initializer, initargs)to(executor_reference, ctx, work_queue)with aWorkerContextobject.DaemonThreadPoolExecutor._adjust_thread_countmirrored the old 4-argcall and crashes on 3.14 with
AttributeError: '_initializer'(the baseclass no longer sets those attributes). This is load-bearing: the delegate
timeout executor (
tools/delegate_tool.py:2802) uses this pool, sosubagent delegation, heartbeat, and orchestration all break on 3.14
without it.
pyproject.toml[wake]extra +[tool.uv]override —tflite-runtime(pulled by
openwakewordon Linux) ships only cp38–cp311 wheels andcannot install on Python 3.12+.
ai-edge-litertis the cross-platformsuccessor with cp314 wheels; the existing bridge in
tools/wake_word.py(ensure_tflite_runtimealiasestflite_runtime.interpreter→ai_edge_litert.interpreter) now coversLinux too. The marker-gated override excludes
tflite-runtimefromresolution on 3.12+.
requires-pythonceiling — raised from<3.14to<3.15. The cap'sstated reason ("Rust-backed transitives have no cp314 wheel yet") is stale:
pydantic-core 2.46.4, numpy 2.4.3, uvloop, watchfiles, uvicorn all ship
cp314 wheels; the full CI-shaped install succeeds on 3.14.4.
Verification (all measured, no claims without runs)
daemon_pool fix — sabotage-verified
AttributeError: '_initializer'test_delegate.pyon 3.14, unfixed treetest_delegate.pyon 3.14, fixed treetest_compression_concurrent_fork.py+test_async_delegation.py, fixedThe two new regression tests:
test_worker_context_signature_compat— spawns the pool with aninitializer/initargsand asserts workers receive the initializedthread-local (the exact 3.14 WorkerContext path).
test_no_initializer_spawns_and_reuses— pool without initializer stillspawns and reuses workers on 3.14.
Both run in a subprocess so a failure cannot wedge the test runner's own pool.
wake-word / tflite fix — verified
uv sync --extra wake --extra devon 3.14.4import tflite_runtimeafter syncensure_tflite_runtime()bridgeai_edge_litert.interpretertests/tools/test_wake_word.pyon 3.14uv.lockmarkertflite-runtime ... marker = "python_full_version < '3.12'"Full dependency audit (Linux x86-64, 2026-08-09)
tflite-runtime) is fixed by this PR.slack/aiohttp), matrix (mautrix+asyncpg+olm), teams, homeassistant, voice
(faster-whisper/onnxruntime/sherpa), mcp, modal, elevenlabs, boto3,
google/azure, feishu, youtube-transcript-api, web, acp.
Test suite (CI-shaped surface, 3.14.4)
tests/e2e/tests/integration— the CI-m 'not integration'surface): 29,577 tests, 0 collection errors on 3.14.--basetemp: exit 0, no errorcascade, residual failures are the daemon-pool delegation cluster (fixed
here) plus pre-existing parallel-run artifacts reproducible on 3.12.
contaminated by concurrent pytest runs sharing
/tmp/pytest-of-ratbasetemp (tmp_path fixture races) — not 3.14 breakage. Every affected
test passes standalone or with this PR's fix.
Why the changes are safe / backward compatible
daemon_pool.py: thehasattr(self, "_create_worker_context")branchselects the 3.14 API only when the base class provides it; 3.8–3.13 keeps
the exact original positional call. Verified on 3.12 (5/5 + delegate
suite + wake suite all green).
ai-edge-litertwas already the macOS dependency; this extendsit to Linux where the same bridge already existed.
tflite-runtimeremainsavailable on
<3.12for the legacy path.requires-python <3.15: purely widens the accepted range; existinginstalls on 3.11–3.13 are unaffected.
Files changed
tools/daemon_pool.py— WorkerContext-compatible worker spawn (+19/−6)tests/tools/test_daemon_pool.py— 2 new regression tests (+67)pyproject.toml— wake extra litert for all platforms, tflite override,requires-python ceiling (+24/−9)
uv.lock— regenerated marker matrix for 3.14Test evidence artifacts
Full logs from every run above are available in the py314 mission workspace:
/home/rat/py314/notes/(hunter-dep-audit.md, benefits-measurement.md,monitor-validation.md, PLAN.md status history).