Commit Graph

487 Commits

Author SHA1 Message Date
alt-glitch
a1bbd329ea refactor: split utils.py into the utils package
utils.py held three subjects in one 871-line file. It is now a package with
one module per subject: utils/files.py (atomic writes, temp files, file mode
and owner, signatures and digests, JSON and YAML file helpers), utils/urls.py
(the base_url helpers) and utils/env.py (truthy values, env numbers, proxy
env helpers). utils/__init__.py re-exports every public name, so no importer
changes. Function bodies are unchanged, no function-level import moved, and
the logger keeps the name "utils".

Tests patch a name in the module that now defines it. Patches stay on the
package where production reads the name through a function-level
"from utils import". The tests of utils itself move to tests/utils/.

A root module that becomes a folder drops out of anything that copies root
*.py files plus a fixed list of packages, so the fixtures that build a partial
source tree now list utils, as do pyproject's packages.find, three check
scripts and the CI change classifier.
2026-11-16 17:16:20 +05:30
alt-glitch
b7f657fc5e chore(lint): keep ruff.toml as the only ruff config
Ruff reads ruff.toml and ignores [tool.ruff] in pyproject.toml when both
exist, so the pyproject block was never applied: PLW1514
(unspecified-encoding), which that block called too load-bearing to keep
off and lint.yml said the blocking step enforces, was not enforced. Its
ASYNC baseline list was stale for the same reason: ruff.toml already
selects those rules with no baseline and the tree passes.

- ruff.toml selects PLW1514 and turns on preview only for preview rules
  it names (explicit-preview-rules). That also activates PLE0304,
  PLR1708, RUF063, RUF068 and FURB192, which were selected but skipped
  with a "preview is not enabled" warning.
- PLW1514 stays off for tests/, skills/, optional-skills/ and plugins/,
  carried over from the pyproject block.
- [tool.ruff*] leaves pyproject.toml; ruff.pre-commit.toml (a copy of
  ruff.toml that differed by one comma) is deleted, and `just ruff`
  (the lefthook pre-commit step) uses ruff.toml.
- lint.yml's comments name ruff.toml.
2026-11-15 14:02:40 +05:30
Adolanium
a1e37d77fa ci: pin wheel in build requires
build-system.requires pinned setuptools exactly but left wheel
unconstrained, so every PEP 517 isolated build floats to the newest
PyPI wheel release. Pin wheel==0.48.0 to match the setuptools policy.
2026-11-14 05:26:27 +01:00
alt-glitch
3af473c312 feat: install the module-rename compat finder in every Hermes process
hermes_agent.compat.install() puts a non-strict Finder(MOVES) at the front
of sys.meta_path once per process. It runs from hermes_bootstrap (which
covers the CLI, gateway, TUI gateway, ACP, MCP server, workers and the
plugin host child), from the cron scheduler's __main__, from the two
by-path update entry points, and at the top of the `plugins validate`
probe script. MOVES is empty, so nothing changes yet.

The plugin loader now finds a parent package's folder from the package's
own import spec instead of counting dots in its name, and the bundled
plugin discovery packages build their module and parent names from
__package__. The plugin host child looks up a provider base class under
both its old and current module name.

hermes_agent is added to update-startup-files, and the test fixtures that
copy a minimal checkout now copy hermes_agent too.
2026-11-13 18:45:31 +00:00
liuhao1024
d07a51c70a perf(ssl): memoize truststore's per-connection OpenSSL CA bundle reload
truststore 的 OpenSSL backend 在每次 wrap_socket/wrap_bio 时都对同一个
inner context 重跑 set_default_verify_paths(),每条新出站 TLS 连接都重扫
系统 CA bundle(Telegram 心跳、provider client、webhook),async client
的开销还落在事件循环上。

在 install_truststore() 注入后 wrap truststore._api._configure_context:
以 WeakKeyDictionary 按 context 记忆 (cafile, capath, stat 签名),bundle
未变化则跳过重复加载(加载本身是 additive 幂等的);bundle 文件变化后
重新加载。macOS/Windows 平台 verifier backend 与未识别布局不动,私有
API 漂移时静默退回原行为。truststore 已 exact-pin 0.10.4。

Fixes #139765
2026-11-12 01:25:10 -08:00
liuhao1024
21ae0e1238 fix(deps): pin av 18.1.0 alongside faster-whisper 1.2.1
Some checks failed
Live provider canaries / Live provider canaries (push) Has been cancelled
faster-whisper 1.2.1 calls av.open(..., metadata_errors="ignore"), a kwarg
PyAV 19 removed, so the faster-whisper 1.2.1 + av 19 pair fails every local
transcription with a TypeError. faster-whisper only declares av>=11, so an
unlocked resolve of [stt-whisper] picks av 19.0.2 today; only uv.lock's
av 18.1.0 kept locked installs working, and any lock refresh would break
local STT on every voice message.

No faster-whisper release carries the upstream fix (SYSTRAN/faster-whisper#1495);
1.2.1 (2025-10-31) is still the latest on PyPI, so an upgrade is not
available. Exact-pin av==18.1.0 (released 2026-08-12, already the locked
version) in [voice] and [stt-whisper] with faster-whisper's platform marker,
per the exact-pin policy for direct deps. uv.lock only records the new
requirement; no resolved version changes.

A metadata regression test asserts every extra carrying faster-whisper 1.2.1
also exact-pins a pre-19 av under the same marker.

Fixes #135245
2026-11-07 19:38:20 -08:00
alt-glitch
4c70376475 build: ship the hermes_agent package
Add hermes_agent to packages.find so every install kind that builds the
project (editable dev venv, Nix, Docker, PM generations) carries
hermes_agent.compat. Nothing imports it at runtime yet.
2026-11-07 01:55:24 -05:00
alt-glitch
7c695da032 chore: drop the tenacity dependency that no module imports
pyproject.toml pinned tenacity==9.2.1 as a core dependency, but no
Python file in the tree imports it (`git grep -n "import tenacity\|from
tenacity"` returns nothing). The last import was removed in e46d5b2c13.
No plugin, plugin-catalog entry, nix expression or bundle script names
it. The only other code reference was the third-party preload list of
the fresh-process import smoke, which preloads modules only to speed up
its import runs; the name is removed there too.

uv.lock is regenerated with `python -m hermes_cli.main pm lock` from
this tree. The lock diff removes only the tenacity entries.
2026-11-06 23:02:03 -05:00
alt-glitch
85b43c1f0b fix(update): refuse a target that lacks a startup file it declares
The pre-move syntax preflight and the post-move check skipped any listed
startup file the target did not contain. A change that moved or dropped
one of those files therefore passed both checks, and the next launch
failed on the import.

The list of startup files now lives in the tree it describes:
pyproject.toml [tool.hermes] update-startup-files. Both checks read the
target's own list, so a commit that moves a startup file updates its
path there and updates to it are judged by the new path. A declared
file the target lacks refuses the update before anything moves, and
rolls the pull back after it.

A target that declares no list (every release before this one) is still
judged by the running updater's list with absent files skipped, so
rollbacks and channel switches to older releases keep working: releases
up to v2026.9.24 lack five of the nineteen listed files.

The post-pull guard now always goes through tree_syntax_error, which
already chose the interpreter by requires-python, so the separate
same-interpreter path (_validate_critical_files_syntax) is removed.
2026-11-06 23:00:58 -05:00
Maciej Lisiewski
36f9cba878 fix(deps): bump setuptools to 84.1.0
Moves every setuptools pin from 83.0.0 to 84.1.0 together: the dev
group, [build-system].requires, and the Termux toolchain and
deb-wheelhouse pins (scripts/termux), so source builds, the lock and
the Termux payload keep using one version. Only setuptools moves in the
relock. 84.1.0 was published 2026-10-19, past the 3-day release-age
check.

This is a major bump. 84.0's removals are distutils compiler internals
(Compiler.spawn shims, exception classes, LooseVersion in
CygwinCCompiler). Hermes's setup.py and the setuptools.build_meta
backend use none of them.

Advisory: GHSA-xmj3-9gf7-h52w
2026-11-03 21:06:30 +01:00
Maciej Lisiewski
3d4d73e0fd fix(deps): bump pyasn1 to 0.6.5
Moves the google extra pin and the Google Chat staleness probe
(_REQUIRED_PACKAGES) from 0.6.4 to 0.6.5 so a half-synced interpreter
is repaired onto the patched release. pyasn1-modules 0.4.2 allows
<0.7.0. 0.6.5 was published 2026-10-27, past the 3-day release-age
check.

Advisories: GHSA-2qm8-x737-gmw5, GHSA-9m75-vc3g-4x39,
GHSA-fm9c-5rcf-2q5p, GHSA-mm57-4v3p-rchx
2026-11-03 21:06:29 +01:00
Maciej Lisiewski
a5c7cb4779 fix(deps): bump pypdf to 6.21.4
Moves the documents extra pin from 6.21.2 to 6.21.4 and relocks (only
pypdf moves). The four document skills that stage the same pin set in
their side environment move with it so they install the patched
release. 6.21.4 was published 2026-10-28, past the 3-day release-age
check.

Advisories: GHSA-42gh-23hr-vphw, GHSA-4vqv-7265-gm2w,
GHSA-5849-834g-hvw5, GHSA-62m5-6wh8-28x7, GHSA-cggf-277g-3q54,
GHSA-mfr5-77xh-9j7h, GHSA-x3rh-gjgm-fmqc
2026-11-03 21:06:29 +01:00
mnajafian-nv
f301e86fe4 chore(relay): upgrade to 0.11.0
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
2026-11-03 00:14:24 +05:30
kshitijk4poor
d66b9cd9ce refactor(process): one owner-death supervisor per Hermes process, in sh, owned by process_identity
The parent-death supervisor that only stdio MCP servers could use (tools/mcp_death_supervisor.py
+ the client in tools/mcp_tool.py) becomes layer 4 of hermes_cli/process_identity.py, next to the
spawn ledger and the Windows job object, so every long-lived child family can use the same path
instead of shipping its own reaper. MCP's three call sites now call
process_identity.update_supervised_pgids; the protocol (register/unregister <pgid>, EOF = owner
died, TERM -> 3 s -> KILL, unsafe targets refused, replay on respawn, release when empty) is
unchanged and every existing contract test moves with it.

The supervisor itself is now POSIX sh (hermes_cli/process_supervisor.sh) instead of a second
CPython: it stays resident for the life of any Hermes process with a supervised child, and an
idle sh is 0.5 MB USS against 8.1 MB for the Python supervisor (Linux, py3.14, measured).
Malformed and over-long lines are skipped exactly as before; the only protocol difference is
that a line is no longer length-capped while being read (sh's read has no cap), which only a
writer inside Hermes could exploit.
2026-10-29 16:58:09 +05:30
Teknium
4a8c01790a fix(skills): document skills share one PM-built side environment; pause before Enter in the no-tmux recipe
The six document skills each carried a copy of a venv bootstrap that ran
`python -m venv --clear` on a shared directory after an unlocked check, so two
agents could erase each other's install, and the pdf skill's optional installs
read a DOCS_ENV that was only set inside a branch.

`hermes pm environment NAME --extra E | --requirement R` exposes PM's existing
isolated environments (pm.ensure_environment) to shell callers: the identity
is re-checked under the environment's install lock, a rebuild lands in a new
generation published by an atomic selection, and the previous generation is
never deleted. It prints only the interpreter path on stdout. --extra reads
the extra's pins from pyproject.toml, so a Hermes update does not build a new
generation unless those pins change.

Every document skill now runs the same one-liner
(`hermes pm environment documents --extra documents --extra documents-pdf`)
when `python` lacks the libraries; the new documents-pdf extra carries
pdfplumber and pypdfium2. OCR libraries get their own named environments.

The no-tmux PTY recipe pauses 0.5 s between the text write and the Enter
write, like the tmux recipe, so the paste guard cannot read Enter as a newline.
2026-10-28 19:26:17 -07:00
Teknium
b357ebbfc4 fix(docker): ship tmux and the Office/PDF libraries; document skills keep a persistent side env
Hosted Docker instances could not run the hermes-agent skill's tmux spawning
recipe (no tmux) or create Office/PDF files: the docx/xlsx/powerpoint/pdf
skills said `pip install ...`, but the image's sealed venv has no pip and the
root fs resets on restart.

- Dockerfile: tmux in the runtime apt layer (+3 MB); bake a new [documents]
  extra (python-docx, openpyxl, python-pptx, reportlab, pypdf) into the
  sealed venv (+14 MB compressed, ~+38 MB on disk).
- pyproject/uv.lock: the [documents] extra, exact pins, outside [all];
  pm/extras ANCHORS gets its import anchors.
- docx/xlsx/powerpoint/pdf (+ optional excel-author/pptx-author): use
  `python` when it already imports the libs, otherwise a persistent side
  venv at $HERMES_HOME/environments/documents (recreated when its Python is
  gone); pdf script hints and the OCR reference point there, never at pip
  into Hermes's interpreter.
- hermes-agent skill: send text and Enter as separate tmux keystrokes (one
  burst lands as a newline, verified live), plus a no-tmux fallback via
  terminal(background=true, pty=true) + process_manage write.

Found on Hermes Cloud staging.
2026-10-28 19:26:17 -07:00
Ben Barclay
69d037b349 feat(config): remote config backend (HERMES_CONFIG_BACKEND=remote)
plugins/config_backends/remote serves each profile's user layer from the
config plane: boot fetch inside load_hermes_dotenv with bounded retry and
fail-closed exit (D2), per-process ETag poller (D9), key-level diff writes
with CAS and one conflict retry (D10), client-side lock and secret-literal
checks (D7, D17), in-memory migrations (D12), managed config.yaml ignored
(D18), plane credential from auth.json or IdP client credentials only and
never from a secrets: source (D26, D32). Vendored gg conformance fixtures
run against the lock matcher, secret rule and _deep_merge.
2026-10-27 17:33:48 -07:00
Maciej Lisiewski
bb6986f4d9 chore(deps): bump brotlicffi to 1.2.1.0 (#145147)
Carries libbrotli 1.2.1 (CVE-2026-111497, out-of-bounds write / RCE). Trailing bytes after a complete Brotli stream now raise brotlicffi.error.
2026-10-26 12:08:32 -07:00
Teknium
7abb9cc0fa feat(vault): opt-in OS-keychain storage for the vault key, with a verified migration
The local vault key sat in vault.key next to vault.json.enc, so any backup, synced
folder or copied ~/.hermes carried the ciphertext together with its key.

vault.key_storage: keychain (default stays `file`) puts a NEW vault's key in the OS
keychain via keyring (new lazy `keychain` extra, keyring==25.7.0), one entry per
profile, named by a non-secret vault.keyref. No reachable keychain (headless Linux,
extra not installed, plaintext/null keyring backends) falls back to the 0600 file.

`hermes vault key` shows where the key is; `hermes vault key migrate --to keychain|file`
writes the destination, proves it decrypts the vault, and only then removes the
source, so an interrupted move leaves a working vault and a rerun finishes it.

A vault whose key is missing (file or keychain entry) now raises a recovery message
and never mints a new key over existing ciphertext (before, a deleted vault.key was
silently replaced and the vault reported "key mismatch or corruption").

Opt-in rather than default: macOS can prompt for keychain access after Hermes'
Python changes, locked Linux keyrings prompt or are absent over SSH, cron while
logged out cannot read the key, and backups stop being self-contained.
2026-10-25 05:45:51 -07:00
Maciej Lisiewski
128b101efd chore(deps): bump openai to 2.54.0
openai: 2.24.0 -> 2.54.0 (pins edited: 1; also: {})
2026-10-23 09:24:07 +02:00
Maciej Lisiewski
5a36b89795 chore(deps): bump daytona to 0.225.0
daytona: 0.210.0 -> 0.225.0 (pins edited: 1; also: {daytona-analytics-api-client 0.210.0->0.225.0, daytona-api-client-async 0.210.0->0.225.0, daytona-api-client 0.210.0->0.225.0, daytona-analytics-api-client-async 0.210.0->0.225.0, daytona-toolbox-api-client 0.210.0->0.225.0, daytona-toolbox-api-client-async 0.210.0->0.225.0})
2026-10-23 09:24:06 +02:00
Maciej Lisiewski
f02555cf5f chore(deps): bump ruff to 0.15.22
ruff: 0.15.10 -> 0.15.22 (pins edited: 1; also: {})
2026-10-23 09:24:04 +02:00
Maciej Lisiewski
64487e631f chore(deps): bump ty to 0.0.89
ty: 0.0.82 -> 0.0.89 (pins edited: 1; also: {})
2026-10-23 09:24:03 +02:00
Maciej Lisiewski
f9ed8d62ce chore(deps): bump vercel to 0.12.0
vercel: 0.7.2 -> 0.12.0 (pins edited: 1; also: {vercel-workers 0.0.25->None, vercel-internal-telemetry 0.7.2->0.8.1, vercel-cache 0.7.2->0.7.6})
2026-10-23 09:24:01 +02:00
Maciej Lisiewski
fa8ffd09c9 chore(deps): bump uvicorn to 0.54.0
uvicorn: 0.41.0 -> 0.54.0 (pins edited: 1; also: {})
2026-10-23 09:23:58 +02:00
Maciej Lisiewski
fb945d0e61 chore(deps): bump truststore to 0.10.5
truststore: 0.10.4 -> 0.10.5 (pins edited: 2; also: {})
2026-10-23 09:23:58 +02:00
Maciej Lisiewski
b2ae855dff chore(deps): bump tenacity to 9.2.1
tenacity: 9.1.4 -> 9.2.1 (pins edited: 1; also: {})
2026-10-23 09:23:57 +02:00
Maciej Lisiewski
d8062a5c44 chore(deps): bump starlette to 1.9.0
starlette: 1.3.1 -> 1.9.0 (pins edited: 4; also: {})
2026-10-23 09:23:56 +02:00
Maciej Lisiewski
741357733f chore(deps): bump sounddevice to 0.5.6
sounddevice: 0.5.5 -> 0.5.6 (pins edited: 3; also: {})
2026-10-23 09:23:55 +02:00
Maciej Lisiewski
b3ace3a08f chore(deps): bump slack-sdk to 3.45.0
slack-sdk: 3.44.1 -> 3.45.0 (pins edited: 2; also: {})
2026-10-23 09:23:54 +02:00
Maciej Lisiewski
c6a8753e65 chore(deps): bump rich to 14.3.4
rich: 14.3.3 -> 14.3.4 (pins edited: 1; also: {})
2026-10-23 09:23:53 +02:00
Maciej Lisiewski
00a064a797 chore(deps): bump resvg-py to 0.5.0
resvg-py: 0.4.0 -> 0.5.0 (pins edited: 1; also: {})
2026-10-23 09:23:52 +02:00
Maciej Lisiewski
cec2a96e89 chore(deps): bump requests to 2.34.2
requests: 2.33.0 -> 2.34.2 (pins edited: 1; also: {})
2026-10-23 09:23:51 +02:00
Maciej Lisiewski
f62a01d293 chore(deps): bump python-dotenv to 1.2.4
python-dotenv: 1.2.2 -> 1.2.4 (pins edited: 1; also: {})
2026-10-23 09:23:49 +02:00
Maciej Lisiewski
67e9933f4e chore(deps): bump pytest-asyncio to 1.4.0
pytest-asyncio: 1.3.0 -> 1.4.0 (pins edited: 1; also: {})
2026-10-23 09:23:48 +02:00
Maciej Lisiewski
335e0eb680 chore(deps): bump pydantic to 2.14.1
pydantic: 2.13.4 -> 2.14.1 (pins edited: 1; also: {pydantic-core 2.46.4->2.50.1})
2026-10-23 09:23:47 +02:00
Maciej Lisiewski
e2a379174a chore(deps): bump prompt-toolkit to 3.0.53
prompt-toolkit: 3.0.52 -> 3.0.53 (pins edited: 1; also: {})
2026-10-23 09:23:47 +02:00
Maciej Lisiewski
65a82c53f9 chore(deps): bump playwright to 1.64.0
playwright: 1.62.0 -> 1.64.0 (pins edited: 1; also: {})
2026-10-23 09:23:46 +02:00
Maciej Lisiewski
7e0c575b44 chore(deps): bump parallel-web to 0.6.0
parallel-web: 0.4.2 -> 0.6.0 (pins edited: 1; also: {})
2026-10-23 09:23:44 +02:00
Maciej Lisiewski
8309f37f33 chore(deps): bump packaging to 26.3
packaging: 26.0 -> 26.3 (pins edited: 2; also: {})
2026-10-23 09:23:43 +02:00
Maciej Lisiewski
b3f77e1ddd chore(deps): bump numpy to 2.5.4
numpy: 2.4.3 -> 2.5.4 (pins edited: 3; also: {})
2026-10-23 09:23:42 +02:00
Maciej Lisiewski
e322dde361 chore(deps): bump modal to 1.6.2
modal: 1.5.5 -> 1.6.2 (pins edited: 1; also: {})
2026-10-23 09:23:40 +02:00
Maciej Lisiewski
481796aa6a chore(deps): bump microsoft-teams-apps to 2.1.1
microsoft-teams-apps: 2.0.13.4 -> 2.1.1 (pins edited: 1; also: {microsoft-teams-api 2.0.16->2.1.1})
2026-10-23 09:23:39 +02:00
Maciej Lisiewski
fe279881f8 chore(deps): bump markdown to 3.11.2
markdown: 3.10.2 -> 3.11.2 (pins edited: 1; also: {})
2026-10-23 09:23:38 +02:00
Maciej Lisiewski
c2083e626a chore(deps): bump lark-oapi to 1.7.5
lark-oapi: 1.6.8 -> 1.7.5 (pins edited: 1; also: {})
2026-10-23 09:23:37 +02:00
Maciej Lisiewski
161e7d2121 chore(deps): bump huggingface-hub to 1.33.0
huggingface-hub: 1.24.0 -> 1.33.0 (pins edited: 1; also: {})
2026-10-23 09:23:36 +02:00
Maciej Lisiewski
0cd517aa68 chore(deps): bump httpx2 to 2.15.1
httpx2: 2.12.0 -> 2.15.1 (pins edited: 3; also: {httpcore2 2.12.0->2.15.1})
2026-10-23 09:23:35 +02:00
Maciej Lisiewski
4b5479596f chore(deps): bump google-cloud-pubsub to 2.43.0
google-cloud-pubsub: 2.39.2 -> 2.43.0 (pins edited: 1; also: {})
2026-10-23 09:23:34 +02:00
Maciej Lisiewski
154748800b chore(deps): bump google-auth-oauthlib to 1.5.0
google-auth-oauthlib: 1.3.1 -> 1.5.0 (pins edited: 1; also: {})
2026-10-23 09:23:34 +02:00
Maciej Lisiewski
77da0e47a1 chore(deps): bump google-auth-httplib2 to 0.4.4
google-auth-httplib2: 0.3.1 -> 0.4.4 (pins edited: 1; also: {})
2026-10-23 09:23:33 +02:00