Both WeCom platforms (AI Bot `wecom`, self-built-app `wecom_callback`) move to
NousResearch/hermes-labs-plugins `wecom/`. Two LEFT_CORE rows (one per
platform, one shared plugin, installed once) whose platform_in_use predicates
replicate core's enable gates per mode. Stacked on the DingTalk removal
(#159638): the platform lists both PRs edit are resolved once here.
Folded from the earlier branch (one commit per step, in order):
331094ca15a3 Teknium test(gateway): a named profile's port-binder is served only on a default listener, live reconcile too
The live reconcile builds a named profile's platforms through the same prepare step as startup, so the
"not served" refusal holds there as well: a LINE secondary with neither api_server nor webhook on the
default stays unstarted and names the remedy instead of reading as connected. The two LINE named-profile
reconcile tests now give the default a webhook listener, so their LINE is served at /p/b/ as in a real
setup; their assertions are unchanged.
bedc93176b93 Teknium fix(left-core): off-platforms derive from the LEFT_CORE rows; left-core routes name the install
Same hunk as the QQ Bot (#159640) and Feishu (#159651) PRs, so merge order cannot leave a stale entry.
- A row whose tools lived in its own hermes-<platform> bundle only (Yuanbao) sets own_platform_only;
_derive_off_platforms fills off_platforms with every platform core knows plus every platform a
LEFT_CORE row moved out. The hand list _YUANBAO_OFF_PLATFORMS (which this PR had extended with
wecom/wecom_callback) is gone. The WeCom rows carry no toolsets (hermes-wecom and
hermes-wecom-callback bundled core tools only), so they need no off-platforms.
- Webhook routes: is_known_platform accepts any platform a LEFT_CORE row moved out, so a saved wecom or
wecom_callback route stays loaded before a secondary profile's plugin registers; without the plugin
the send fails naming the install.
- Cron: a deliver route naming a left-core platform whose plugin is not loaded reports the install
command (delivery error and preflight). tests/cron/test_cron_left_core_platform_route.py runs for
wecom and wecom_callback.
05d04a49ccc3 Teknium refactor(wecom): drop the one-install-per-home copy; the installer-race PR carries it generically
296e4a152f99 Teknium fix(gateway): a secondary port-binder with no default listener is not served, not "connected"
Under multiplex a secondary profile's port-binding adapter (WeCom callback, LINE, SMS, Teams, ...)
binds nothing: its app is published for /p/<profile>/ on the default profile's api_server or
webhook listener. With neither running on the default, connect() still returned True and the
runner logged "✓ wecom_callback connected (profile: b)" while nothing listened anywhere.
- Runner: such an adapter is not started; it is stamped `<profile>:<platform>` disabled with
error_code multiplex_no_shared_listener and a WARNING naming the remedy.
- Migration preflight: a secondary whose own gateway serves a port-binder today is refused when
the default enables neither listener (it would be served nowhere after the fold); a secondary
with no gateway gets the same text as a notice.
- bind_listener publishes the port it actually bound (`listener_base`); the dashboard topology
reads that instead of resolving a plugin platform's listen_port in the profile's plugin
registry, so a parked or cold profile's callback port is reported and no deferred loader runs.
26cde0b03cdc Teknium refactor(wecom): WeCom moves to the Hermes Labs wecom plugin, opt-in
WeCom is now a Hermes Labs plugin (NousResearch/hermes-labs-plugins), not an
official default one. Only homes that used WeCom get it installed, once; a new
home installs nothing.
- Both LEFT_CORE rows (bot and callback) carry the labs notice, like Yuanbao
and DingTalk, merged with the plugins.disabled 'wecom' sentence.
- Docs pages say "moved to the wecom Hermes Labs plugin" with the labs
warning (en + zh-Hans); no default-install wording is left.
- The one-automatic-install-per-plugin seam between default_plugins and the
left-core migration stays: it is general (any plugin that is both a catalog
default and a LEFT_CORE row) and now has its tests in test_default_plugins
with a stand-in plugin instead of the wecom-named ones.
9c82896ffee9 Teknium fix(wecom): migration preflight and dashboard read plugin capabilities in the owning profile
- platform_serves_profile_prefix(value, home) reads the adapter class in the
owning profile's plugin scope, like platform_binds_port: a port-binding
plugin only a secondary installed is a URL-change notice, not a blocker.
- A parked profile's plugins are never discovered for either check, nor for the
dashboard's port readout (read-only probe).
deb0661c69ea Teknium fix(wecom): review findings on the core removal
- One automatic install per plugin across both installers: left-core
`_pending` skips a plugin `_default_plugins_installed` records, and
default_plugins skips one `_left_core_installed` records, so a removed
WeCom stays removed whichever ran first.
- `listen_port` is read in the owning profile's plugin scope: a multiplexed
secondary (shared-listener routing), migration preflight (per profile home)
and the dashboard topology (discovers that home's plugins; preflight never
does, a parked profile's plugins must not run here).
- `hermes-wecom-callback` keeps resolving: a `hermes-<a-b>` bundle falls back
to platform `a_b`, and toolset validation accepts it.
- StandaloneSendPolicy.media_via_adapter moves after reply_file_over so
positional callers keep their meaning.
- cron home-target priority keeps wecom (the plugin platform keeps it).
- `_BUNDLED_ENV_SIBLINGS` removed with its readers' prefix branch.
c3ec8edb3cc4 Teknium refactor(wecom): WeCom leaves core for the official wecom plugin
Both WeCom platforms (AI Bot `wecom`, self-built-app `wecom_callback`) move to
NousResearch/hermes-official-plugins `wecom/`, installed by default on every
home (catalog `default: true`). Existing users get it automatically: two
LEFT_CORE rows (one per platform, one shared plugin, installed once) whose
platform_in_use predicates replicate core's enable gates per mode.
Generic seams added for the plugin, never a name check left in core:
- PlatformEntry.listen_port: a plugin platform that binds a host port
(platform_binds_port, multiplex shared listener, migration blockers,
dashboard topology). Replaces the wecom_callback rows.
- StandaloneSendPolicy.media_via_adapter: send_message media through the live
adapter route. Replaces the _CHUNKED_ROUTES["wecom"] row.
- cron: a registered plugin platform without a cron env var (home channel from
config.yaml only) is a valid delivery target. Replaces the wecom_callback row.
Child-env strip set unchanged: _ADAPTER_SECRET_ENV also carries the
left-core platform rows' secret_env.
DingTalk (Stream Mode adapter, AI Cards, the QR device-flow login in
hermes_cli/dingtalk_auth.py) now ships as the `dingtalk` plugin in
NousResearch/hermes-labs-plugins: built by Nous Research, not supported.
Same platform name, DINGTALK_* env vars and platforms.dingtalk keys.
Removed: plugins/platforms/dingtalk/**, hermes_cli/dingtalk_auth.py and
its tests, Platform.DINGTALK, the hermes_cli/platforms.py row, the
hermes-dingtalk toolset and its hermes-gateway include, the dingtalk PM
extra (+ uv.lock, nix groups), the platform.dingtalk.emotion locale
strings, builtin-list entries (update allowlist, allowlist env platforms,
webhook/cron deliver sets, dump, dashboard env rows) and the shim rows
for a folder that no longer exists. Comments that named DingTalk as a
core adapter now describe the capability flag instead; no core code
branched on the name. Docs: messaging/dingtalk.md (+ zh-Hans) is a
"moved to the Labs plugin" page.
Kept: DINGTALK_CLIENT_ID/SECRET on the hermes-owned env list (a plugin
manifest cannot claim them), tip t159 (tips are numbered contiguously),
the desktop/TUI session-source names (the plugin keeps the platform name).
hermes-dingtalk stays valid as a retired telemetry toolset name.
Teknium's ruling: push them to hermes-labs-plugins with no support guarantee and switch
existing users over with a notice. The bundled dirs stay deleted; what changes is what a
home still configured for one gets:
- Drop the `_REMOVED` table and `removed_provider_notice` (agent start, `hermes update`,
`memory status`, `memory setup <name>`, doctor). Both names stay in `_LEFT_CORE`, so the
existing machinery installs the catalog plugin unattended, exactly like hindsight/mem0.
- `_LABS_NOTICES` (name -> sentence, table-driven): the one "installed its plugin from the
catalog" line for byterover/retaindb adds "<Label> is now a Hermes Labs plugin: built by
Nous Research, not supported, and likely not maintained going forward. Fixes from the
community are welcome." Maintained providers' line is unchanged.
- Kept: BRV_API_KEY / RETAINDB_API_KEY / RETAINDB_BASE_URL in the static child-env
blocklist (no OPTIONAL_ENV_VARS row declares them any more); comment reworded.
- Docs: memory-providers (EN + zh-Hans) lists ByteRover and RetainDB as Hermes Labs catalog
plugins with a not-supported caution and install commands; env-var reference rows point
at the plugins; integrations/overview/memory pages, CONTRIBUTING (EN/ES), plugins/AGENTS.md
say "moved to Hermes Labs".
- Tests: the removed-provider test becomes "labs provider installed once with the notice,
second start installs nothing, config untouched", plus "maintained provider's line carries
no labs notice".
Nobody took over NousResearch/hermes-plugin-byterover or hermes-plugin-retaindb by the
Oct 15 2026 deadline (D12), so both bundled providers are deleted instead of moved to the
catalog.
- Delete plugins/memory/byterover/, plugins/memory/retaindb/ and the tests that only
exercised them (provider, multiplex contract, thread-profile and identity-scope files whose
every case was one of the two; the retaindb secret-scope pair; the two bundled-precedence
tests that used byterover as the bundled sample).
- memory_provider_migration: a `_REMOVED` name -> label table. A home whose memory.provider
names one gets "<Label> was removed from Hermes because no one took over maintaining it.
External memory is off; run `hermes memory setup` to choose another provider." at agent
start (CLI, Desktop notice, chat platform first reply), on `hermes update`, in
`hermes memory status`, `hermes memory setup <name>` and `hermes doctor`. No catalog lookup
and no install for those names; memory.provider is never rewritten. Both names leave
_LEFT_CORE (no unattended install consent for a plugin that does not exist).
- Drop RETAINDB_API_KEY / RETAINDB_BASE_URL / BRV_API_KEY from OPTIONAL_ENV_VARS, the
"Bundled providers" help line, ~/.brv-cli/bin from the memory-setup PATH, the two
boundary-lint baseline lines, and the docs (EN + zh-Hans).
- Kept: agent/redact.py's retaindb_/brv_ key patterns (a leaked key is still a secret).
The empty `honcho: {}` config root was already removed on main (6933155eaf).
Address all five Should-fix findings and the docs update from
@BearHuddleston's review of
https://github.com/NousResearch/hermes-agent/pull/160236:
1. Photon sidecar install lock (`plugins/platforms/photon/adapter.py`,
`plugins/platforms/photon/sidecar/.gitignore`): hold an exclusive
flock/msvcrt lock in the shared sidecar directory across the deps
checks and `npm ci`, preventing concurrent Photon profiles (each
loaded under its own per-home module name) from clobbering
`node_modules` or spawning against a half-installed tree.
2. Systemd boot-deadline renewal (`gateway/run_adapters.py`,
`gateway/run_adapters_recovery.py`,
`website/docs/user-guide/messaging/index.md`): renew systemd's
`Type=notify` start timeout before every preparation step (each
profile load and each enabled platform build), drop the 30 s
throttle and `prep_renewed_at`, and update the messaging docs for
wave-based secondary startup.
3. Remove test-only serial fallback (`gateway/run_adapters.py`): delete
`_uses_default_profile_starter`, `_DEFAULT_START_ONE_PROFILE_ADAPTERS`,
and the serial fallback branch, and update boot-sweep test stubs to
`_prepare_one_profile_adapters` so boot tests cover the real
parallel production path.
4. Serialize WhatsApp secondary connects one per wave
(`gateway/run_adapters_recovery.py`): add `_ONE_PER_WAVE_PLATFORMS`
for `Platform.WHATSAPP` and `wave_keys` on `_StagedProfileAdapter`
so WhatsApp secondaries connect one per wave in profile order while
other platforms still connect in the first wave.
5. Off-loop WhatsApp bridge deps install
(`plugins/platforms/whatsapp/adapter.py`): run
`_ensure_bridge_deps` via `asyncio.to_thread` so a cold/stale npm
install does not block the event loop and time out sibling connects
in the same wave.
Moves Gemini's auth registry row, static curated model list, picker placement/group, and
catalog aliases off hardcoded core tables onto `GeminiProfile` while preserving exact order
(`registry_after="lmstudio"`, `picker_after="huggingface"`, `base_url_env_var="GEMINI_BASE_URL"`).
- Pins `GEMINI_API_KEY` and `GEMINI_BASE_URL` on `_STATIC_PROVIDER_ENV_BLOCKLIST` in
`local_env_policy.py` so child processes never inherit them when the plugin is absent.
- Switches `models_detect.py`, `models_validate.py`, and `model_normalize.py` to
`static_catalog()` so vendor ownership, conflict detection, and prefix repair see plugin
`static_models`.
- Lets `sync_plugin_provider_registry()` wait for `registry_after` anchors discovered later
in the same pass (mirroring `picker_after` waiting in `sync_plugin_provider_catalog()`).
Adds `strict_client`, `implicit_max_output_tokens`, and `validate_setup_api_key` on
`ProviderProfile`, plus the `HERMES_ASYNC_CLIENT` capability attribute next to
`HERMES_SKIP_ASYNC_WRAP` so `_to_async_client` no longer uses `isinstance(..., GeminiNativeClient)`.
Removes the remaining core imports of `agent.gemini_native_adapter` from `agent_init.py`,
`agent_runtime_helpers.py`, `auxiliary_client.py`, and `model_setup_flows.py` while keeping
the auxiliary auto-discovery chain on `generateContent` (`auxiliary_chain=True`) and preserving
URL-qualified native compaction reservation and forwarding for custom routes.
Builds on the approach of #134578 (`strict_client`, the profile supplying Gemini's client).
Co-authored-by: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com>
Discovery accepted any gemini plugin package with an interactions module,
so an older profile-local copy whose http_error has no key_guidance
parameter passed the lookup and then failed with a TypeError on the first
error response. Check the names this transport calls, and that http_error
takes key_guidance, when the wire is resolved; an incompatible copy now
raises gemini_wire_unavailable with the missing names before any request.
The model list dropped gemini-4-argon, gemini-3.1-pro and gemini-3.8-flash, which
the endpoint no longer serves. A user who had picked one keeps it in config, so
every turn on that route went out with an id the endpoint rejects.
Exactly those three ids, in any spelling the client accepts (gemini/ and google/
prefixes, any case), now map to the default model, FALLBACK_MODELS[0]. The mapping
lives in one helper used by the profile's normalize_model_id hook (where Hermes
resolves the configured model), by build_extra_body before the thinking mapping,
by the setup effort picker, and by the client before the request is built. It logs
once per process per retired id. Every other id is left as typed.
Two existing tests used gemini-4-argon as their example of an unlisted id; they now
use gemini-4-xenon so they keep testing the unlisted path.
The client strips gemini/ and google/ before it names the model, so
gemini/gemini-4-carbon reaches Carbon. The per-model table lookup stripped only
google/, so gemini/ and upper-case spellings of a listed model counted as
unlisted: with no effort set the request skipped the model's default level, and
the setup effort picker offered the generic ladder instead of the model's levels.
The lookup now normalizes with the published bare_gemini_model_id, the same rule
the client uses (models/ is still not stripped, as the client sends it as
typed). The import is lazy and import-light, so discovery still loads the profile
without the HTTP stack.
The Solstice transport imported three core internals: the SSE event iterator and the
bounded streaming error-body reader from the native Gemini adapter, and the model-id
prefix rule. The plugin guide allows only published names, ctx methods or discovery,
and the lint baseline carried the three as exceptions.
The model-id rule now comes from its published home, agent.reasoning_effort. The two
stream helpers come from the gemini plugin's own client module, found the same way as
its interactions wire (the package the registered gemini profile was loaded from), so
the transport uses exactly the helpers the gemini client streams with. Their baseline
lines are gone. The base client and its error type stay as imported on main: Solstice
subclasses the client at import and raises the error when no gemini plugin is loaded.
The Solstice client picked its per-call timeout with `timeout or default`, so
an explicit timeout=0.0 was replaced by the one-hour read default. The
default now applies only when the caller passes no timeout (None).
Adds a test that timeout=0.0 reaches the request unchanged, unary and
streamed.
The transport reached the gemini plugin's Interactions wire with a relative
`from ..gemini import interactions`. That only resolves when Solstice is the
bundled `plugins.model_providers.solstice` package. A copy of the plugin in a
profile's own `plugins/model-providers/` loads under a top-level module name,
so creating its client failed with "attempted relative import beyond
top-level package", and the agent fell back to the generic client.
The transport now finds the wire through provider discovery: it looks up the
registered `gemini` profile and imports the `interactions` submodule of the
package that profile was loaded from. This happens once, when the client is
created. If no gemini plugin is loaded, or the loaded one has no
`interactions` module, creating the client still succeeds (an error there
would route the provider to the generic client), and each call raises a
GeminiAPIError (code `gemini_wire_unavailable`) that names the cause.
The wire itself stays in the gemini plugin, unchanged.
Tests: test_solstice_profile_local.py installs the plugin in a temp
HERMES_HOME and completes a unary and a streamed turn through real
discovery; test_solstice_transport.py covers the absent and replaced
gemini plugin cases.
The Solstice client turned long decode off through three class flags on the
gemini provider's GeminiClient (LONG_DECODE, SAMPLING_PARAMS,
REQUIRE_COMPLETED_STREAM). It capped max_tokens before the shared request
builder ran, so the builder still decided whether the request was stored, and
the gemini continuation loop carried Solstice-only branches.
GeminiClient is back to its pre-Solstice code path. SolsticeClient now
subclasses GeminiNativeClient and has its own single-request path: it builds
the request with the shared Interactions builder, caps the final
max_output_tokens at one request's (65536), forces store: false on the built
request, sends one request and reads one stream with no checkpoint, resume or
hop logic. A stream that ends before interaction.completed still raises
GeminiAPIError; temperature/top_p are still dropped; URL, headers, timeout
and the key-guidance-free Interactions error mapper are unchanged.
Adds a test that a request the shared builder would store (a 262144 cap and a
long-decode budget) still goes out with store: false and a 65536 cap.
The per-user-quota endpoint serves a fixed set of model IDs, each with its
own thinking_level set; any other ID or level is an HTTP 400 (or a
zero-limit 429). Solstice offered IDs the endpoint no longer serves, and
mapped efforts through the shared Gemini 4 helper, which knows no
per-model level sets and sends nothing when no effort is set, so no
thought summaries were requested.
- The provider list keeps only the IDs the endpoint serves; the first
entry stays the default.
- Each listed model gets its own allowed levels and default. An unset
effort sends the model's default with thoughts on; a set one is
clamped to the model's levels; thinking off hides thoughts at the
model's lowest level.
- The setup effort picker offers exactly each model's levels.
- The base moves to v1beta, where the Interactions method lives.
IDs outside the list keep the shared Gemini mapping. The boundary-lint
baseline records the profile's import of the shared clamp_effort helper.
The solstice cell of the provider wire snapshot is regenerated.
Solstice called the v1alpha generateContentPerUserQuota methods. It now
posts every request to the per-user-quota Interactions method on v1beta
(interactions:createPerUserQuota) with store: false. This brings thought
summaries, per-request thinking levels and signed thought-step replay.
SolsticeClient now subclasses the gemini plugin's GeminiClient and always
uses its Interactions wire, through new hooks whose defaults keep the
gemini provider unchanged:
- every request posts to <host>/v1beta/interactions:createPerUserQuota,
replacing any stored version segment (credential rows minted earlier
hold the v1alpha base);
- long decode is off: one request capped at 65536 output tokens, never
stored and never continued, because this method rejects stored
interactions;
- temperature and top_p are never sent;
- headers are the bearer token, content type and a hermes-agent
User-Agent only, never an API key, user-project or DPoP header;
- requests default to a 3600 s read timeout; an explicit per-call timeout
still wins;
- a stream that ends before interaction.completed raises instead of
returning the partial turn, because nothing stored can resume it;
- HTTP errors go through the Interactions error mapper without API-key
remedies.
The Solstice profile imported agent.reasoning_effort.gemini_top_thinking_level and the private
agent.transports.chat_completions._build_gemini_thinking_config, neither on the published plugin API;
the boundary-lint baseline carried both as exceptions.
Switch Solstice to agent.reasoning_effort.gemini_thinking_config, published for provider plugins in
the preceding seam commit, and drop its two baseline entries. The helper keys the mapping on the id
the native client sends, so a gemini/ or google/ prefixed model id keeps its effort too.
test_solstice_published_api.py checks that the profile imports only published names and sends what
the helper returns.
The Solstice profile had no build_extra_body, so reasoning fell through to
the generic extra_body.reasoning, which the native Gemini client drops. No
thinkingConfig ever went on the wire: the title pass's thinking-off never
applied, Gemini 4 Neon thought at its default level, and that thinking used
up the 512-token title cap in about two of three calls, leaving an empty
reply and the truncated first-message title. Main-turn reasoning efforts
were ignored the same way.
Translate reasoning to native thinking_config with the shared Gemini helpers,
as the gemini and vertex profiles do. Log a warning when a title reply comes
back empty at the output cap, which was previously silent.
The boundary-lint baseline records the profile's imports of the shared Gemini thinking helpers
(gemini_top_thinking_level, _build_gemini_thinking_config), which the gemini and vertex profiles
also import, so Solstice maps efforts the same way.
MATRIX_RECOVERY_KEY_OUTPUT_FILE is an operator path (the docs example is
/secure/path/...). Through mkdir_under_hermes_home an elevated Windows run
ACL-repaired that directory and everything under it. Take the boundary only
when the key directory sits inside a named profile home.
Patch and test by BearHuddleston (review 6019624984).
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Eight writers in gateway platform plugins still created their directory with a
raw mkdir(parents=True) under the active profile home. An adapter bound to a
named profile that was deleted or renamed meanwhile brought profiles/<name>/
back on its next write (tracker #155595 U3, part 2 of #9).
They now go through mkdir_under_hermes_home; each keeps its existing handling:
- Google Chat thread-count store: skipped, counts stay in memory;
- Feishu comment pairing: raises, so an approval is never reported saved;
- Matrix crypto store (connect and E2EE setup) and recovery-key target and
write: refused through the existing reason / warning / abort paths;
line-neutral (the adapter is over the 2000-line cap);
- the auth.json lock helper (_file_lock): raises before a lock file is created;
Photon's stores take it before writing, so the lock recreated a renamed home
first. Line-neutral (auth.py is over the cap);
- Photon auth.json: raises to the auth caller;
- Photon sidecar mirror: falls back to the source dir like a read-only one;
- WhatsApp secondary bridge-port record: raises into connect's existing
OSError handling;
- WhatsApp Cloud inbound media cache: the media is dropped like a failed
write.
Each gets a delete+rename regression that fails on main and on a raw-mkdir
mutant.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
The per-user-quota endpoint exposes no model listing to user tokens, so the
picker shows the hardcoded fallback list. Add the Gemini 4 Hydrogen, Neon and
Carbon IDs. Hydrogen goes first, so it becomes the default model for new
Solstice users (wire snapshot regenerated for solstice only); lite stays last
as the quota reserve.
discover_context_engines and discover_cron_schedulers built their rows with the same conditional
comprehension. It now lives once in plugin_loader.list_category; both listings return the same rows
as before.
read_plugin_choice only reads the selection and the plugins.enabled / plugins.disabled lists, so it
now uses load_config_readonly(), which returns the same values without copying the cached config.
Its docstring now says what a config.yaml that does not parse means: its last good copy when one
was kept, else the defaults.
context.engine: compressor (also the default) and the cron.provider values that pick the built-in
ticker (empty, builtin, in-process, inprocess) never load a plugin, but the listings counted them
as choosing a user plugin folder with the same name, so listing context engines or cron
schedulers ran its code. Those values now select nothing for a listing; a folder with such a name
still runs for a listing when plugins.enabled names it. Memory listings do not read the selection,
so they are unchanged.
A user-installed memory provider that plugins.disabled lists (by its
directory name, provider name or manifest name) is no longer imported
while memory providers are listed. The dashboard Plugins page, `hermes
memory status`, `hermes memory setup` and the `hermes plugins` memory
picker still show it with its manifest description and the same
"turned off" status and notice as before, and selecting it is still
refused the way the loader already did.
Every other provider is listed exactly as before: bundled providers,
pip-installed providers and user providers that are not turned off are
still loaded to report their real availability, whether or not they are
enabled or selected, so the dashboard readiness check keeps working.
The memory loader already refuses a user-installed provider that
plugins.disabled lists, even when memory.provider still names it. The
context-engine and cron loaders did not: context.engine or cron.provider
naming a turned-off plugin still ran its code.
load_context_engine() and load_cron_scheduler() now share that check
(moved next to the other loader helpers, the memory module keeps using
it) and refuse a non-bundled provider in plugins.disabled before
importing it, with a warning that names the command that turns it back
on. Callers end where they do for a provider that is not found: the
agent falls back to the built-in compressor and cron to the built-in
ticker. Bundled providers are not affected.
Opening the Context Engine category in `hermes plugins`, the dashboard's
context-engine options, or any caller of discover_context_engines() /
discover_cron_schedulers() imported every user plugin whose __init__.py
mentioned the contract, to read its availability. A plugin that was only
installed, or that plugins.disabled lists, ran its code just by being
listed.
Now a user plugin directory is imported for a listing only when the
operator turned it on: it is the one context.engine / cron.provider
selects, or plugins.enabled names it under any of its spellings, and
plugins.disabled does not. Every other one is still listed, with its
name and manifest description, as not available. Selecting it by name
keeps working and loads it on the existing select path. Bundled
providers list exactly as before. config.yaml is read once per listing.
Four writers under get_hermes_home() still created their directory with a raw
mkdir(parents=True). A gateway or plugin process bound to a named profile that
was deleted or renamed meanwhile brought profiles/<name>/ back on its next
write (probed on #158270's head by @xytxg and @BearHuddleston; tracker #155595 U3).
They now go through mkdir_under_hermes_home, the #158270 boundary:
- plugin host extraction cache (cache/plugin_host/model-providers/*.json):
skipped, and the extracted payload is still returned;
- Discord slash-command sync state: the path helper no longer creates the
dir. Reads need none, and the write's atomic_json_write already creates it
through the boundary. A refused write ends in the sync's existing
"Slash command sync failed" warning;
- Google Chat bot-id cache and the router catalog disk mirror: their
existing OSError / Exception handlers turn the refusal into a skip.
Each gets a delete+rename regression that fails on main and on a raw-mkdir
mutant.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Optional nits from BearHuddleston's approving reviews of #158223, #158271,
#158272, #158273 and #158211 (tracker #155595, issuecomment-7059727896),
each one of his tested patches unless noted:
Tests, each catching a mutant that passed the whole suite before:
- F06: a Windows WinError 5 with nothing at the destination stays raw
(the os.path.exists() half of publish_staging's fallback).
- F16 Edge A: the popped-adapter clause of the unserve finally guard.
- F07: import and rename onto an unfinished delete name it (ported to the
`incomplete` record main now writes); record_delete_finished's silent
FileNotFoundError; an unreadable record reads as incomplete.
- F10: the throwaway plugin host is stopped and its registrations
disposed; the channel-lost test closes the channel the read-error way,
so the child no longer exits on its own inside the asserted window.
Docs and dead code:
- F16 Edge A: _hold_secondary_claims docstring.
- F10: unused contextlib/Callable/Iterator imports; the developer guide
says the hooks run in a plugin host of their own.
- F09-1: share_auth comment and mirror_launch_credentials docstring follow
the _logins_home rule.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
The context-reference prefix table is process-wide and keyed to the claiming
manager. A load through the hook's throwaway manager would hold the prefix
past its stopped host, so the profile's own load of the same plugin was refused
it and @<prefix>: raised PluginHostUnavailable. A load with an explicit manager
now skips register_context_reference; the profile's shared load claims it.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
With plugins.isolation: host, notify_memory_provider loaded the new
profile's memory provider through that profile's shared plugin manager and
host, then on exit disposed every registration the provider key had gained
and stopped the host if it had started inside the block. A real load of the
same profile's provider during the hook (the dashboard serving the new
profile) lost its registrations, and an in-flight call failed with
PluginHostUnavailable (#155595 F10).
transient_plugin_host() now yields a throwaway PluginManager for the
profile's home with a distinct scope key ("<home>#transient"), so
_BARE_MODULE_SCOPE and the scope-keyed registries never merge it with the
shared manager. load_memory_provider gains a private manager= argument,
threaded through _load_provider_from_dir and _ProviderCollector, used only
by the hook path. On exit the block unloads that manager and stops its own
host; the shared manager and host are never touched.
provider_registration_scope is removed (its only caller was this path).
Every other caller keeps get_plugin_manager(). PluginHost uses only stdio
pipes, with no per-home socket, lock or pid file, so two hosts for one
home cannot collide.
For plugin authors: with plugins.isolation: host, on_profile_created and
on_profile_renamed now run in a separate host process from the profile's
shared host. Module-level state set up by the shared host's import is not
visible to the hook. Registrations the hook load makes are disposed when
it returns, as before. Bundled providers (in-process) and
plugins.isolation: in_process do not change. No bundled or in-repo
provider implements either hook (only the MemoryProvider base no-ops).
Test: the hosted seams module gains a hook that loads the provider through
the shared manager while it runs; the shared host, its registrations and
its next call survive. Red on origin/main, green here.
_data_dir caught every exception from plugin_data_dir, so its dead-home refusal
was retried by the standalone fallback (which refused again, through the same
guard). The fallback now catches ImportError around the import alone.
_write_json no longer repeats the parent mkdir (the real _data_dir creates the
directory through the home boundary), so a stub that returns a not-yet-created
path must create it, as the real one does.
persist_message runs right after every a2a security.audit call (inbound,
reply, and the a2a send tool) and still created
get_hermes_home()/a2a_conversations with a raw mkdir(parents=True), so a
session bound to a deleted or renamed profile recreated profiles/<name>.
It now goes through mkdir_under_hermes_home and, like audit, skips the
write. The test drives the real tools._send_task after a delete and a
rename.
The achievements _write_json no longer repeats the data-dir mkdir that
_data_file already did; that second mkdir could only rebuild a home
removed in between. Adds tests for the _data_dir standalone fallback,
for _write_json, and for the disk-cleanup _handle_slash liveness guard
(an unrelated FileNotFoundError on a live home still raises), and fixes
the _on_post_tool_call docstring.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
quick and deep can delete tracked files before save_tracked() refuses the
missing home, so "disk-cleanup did nothing" could be false. The reply now
says disk-cleanup stopped and already-removed files stay removed.
A session still bound to profile b survives `hermes profile delete b` and
`hermes profile rename b c`. Its next plugin write recreated profiles/b
through a raw mkdir, and nothing raised.
Seven plugin state writers now create their directories through
mkdir_under_hermes_home, which refuses a missing or tombstoned named home
with its existing FileNotFoundError: plugin_data_dir (and the
hermes-achievements fallback that duplicates it), the CLI plugins dir,
the update-check markers, disk-cleanup state, the Discord recovery ledger,
the Weixin account dir and the A2A audit log.
Callers that already catch keep skipping the write (Discord recovery,
the update-check writers, the disk-cleanup session-end hook and audit log,
the A2A audit). The disk-cleanup slash commands reply that the profile no
longer exists instead of raising. plugin_data_dir documents the refusal.
PTB's Application.add_handler creates a group by keying it on the
current dict and then replacing app.handlers with a new sorted dict.
_register_handlers kept a reference to app.handlers from before core
registration and read the core handler ids from it afterwards, so only
the first group created during registration was recorded. When no
plugin had a handler at connect (the usual late-install case), group 0
was recorded and the group-99 gateway_platform_event observer was not.
A plugin loaded mid-run that registered a group-99 handler was then
appended behind that catch-all TypeHandler(Update), and PTB, which runs
the first matching handler per group, never ran it. A plugin present
at connect already sat ahead of the observer, so the late re-wire did
not match connect as documented.
The core ids now come from the live table after registration, minus
the handlers that were there before it (the plugin handlers wired at
connect), so a late handler lands after earlier plugin handlers and
ahead of the observer, as at connect.
Ahead of the observer is the order connect already uses, and nothing
the observer does depends on running first: dispatch is counted in
TelegramApplication.process_update, an observer's return never
completes an admission claim (4a2b984fd2), and a plugin callback
accepts the claim on entry. For an update the plugin's own group-99
handler matches, the observer does not emit gateway_platform_event,
the same trade-off as for a plugin wired at connect; updates it does
not match still reach the observer.
The gateway test's _PtbApp appended with setdefault, which hid the
swap; it now mirrors PTB 22.8. A real-PTB dispatch test covers both
load orders where python-telegram-bot is installed. The snapshot came
with the late re-wire in 21d0b12958 (#119266).
Reported-by: AliZakaee (#152827)
telegram_vault_code.py landed after this PR was first written and imported
ParseMode from plugins.platforms.telegram.adapter at both send and card-edit
sites. On a first gateway run after on-demand python-telegram-bot install,
that sibling copy still binds ParseMode = None while only the running
hermes_plugins copy is rebound, so send_vault_code_prompt raised
AttributeError and _mark_vault_code_card failed silently.
Read ParseMode from telegram.constants at both sites and extend the lazy
install probe to exercise send_vault_code_prompt and _mark_vault_code_card.
Credit BearHuddleston for the first-run draft fix and AliZakaee for reporting the lazy-install problem.
Keep the no-bot failure contract while the optional Telegram dependency is still absent.
The ParseMode import now runs after the no-bot guard: a disconnected adapter returns
not_connected again instead of raising ModuleNotFoundError when python-telegram-bot is
missing. The added probe assertion fails on d1f52f77f2 and passes here.
(cherry picked from commit bda1e423d754b07aa65f8cbd7af3b929803cc40f)
send_draft read ParseMode from plugins.platforms.telegram.adapter, but the gateway
runs the hermes_plugins.platforms__telegram.adapter copy. When python-telegram-bot is
missing at plugin load, both copies bind ParseMode = None, and the registry's
installer (check_telegram_requirements) rebinds only the running copy. The first
draft frame then raised AttributeError ('NoneType' object has no attribute
'MARKDOWN_V2'), the stream consumer logged it at DEBUG and turned drafts off, and
every DM turn streamed through edits until the gateway restarted.
Regression from 7222595b82 (#151863), which moved the send_draft body out of
adapter.py, where it read the running module's global. ParseMode now comes from
telegram.constants at call time, as standalone.py already does.
The new test runs real plugin discovery with telegram blocked, then the registry's
create_adapter install path, and asserts the first draft goes out as MarkdownV2.
Reported-by: AliZakaee (#152827)
plugins/AGENTS.md still said scripts/ci/catalog_core_imports.py fails a core PR
and offered the breaks-catalog-plugin label. Since f998a982cb the check only
warns (naming each lost core name, whether it is private, and each plugin's
catalog entry, repo and line) and the label is gone. The sentence also moves
after Boundary lint's `--update` lines, so those no longer read as options of
the catalog check (BearHuddleston's suggestion on #157986).
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
Catalog plugins live in their own repos, pinned by sha, and many import Hermes modules that are not
on the published plugin API. When a core PR removes or renames such a module or name, nothing in
this repository's CI sees it: the plugin's code is not here. This week the storage rewrite broke
three that way (OpenViking via agent.message_content, Honcho via hermes_state_common, holographic
via hermes_state_wal: #157818), each found only after users upgraded.
- scripts/ci/catalog_core_imports/ (31 shards, ~780 KiB) records every Hermes import each of the
2,514 catalog entries makes at its pinned sha, parsed by
plugin_validate_private_imports.hermes_import_sites (the same parser `hermes plugins validate`
uses). An import inside a try that catches ImportError carries its alternatives, so a plugin
that already falls back is not reported.
- `catalog_core_imports.py check` (Repository guards, PR python lane) resolves each import against
the base and the merge commit from git objects alone: no network, no plugin code, nothing
imported. It only resolves imports whose module files the PR touches (every import when
compat/moves.py changes): 0.3 s on a typical PR, 2-3 s on the storage-rewrite commits.
- On failure it names plugin, file:line and import, and offers: open a PR for an official seam
(ctx method, hook, plugin_api.json entry), keep the old name via compat/moves.py, or the
breaks-catalog-plugin label.
- catalog-core-imports.yml re-indexes added or repinned entries daily and opens a bot PR.
The check asks only whether a name still exists; a name that stays but changes behaviour or
signature passes.
The vertex profile never applied the gemini plugin's xhigh step, so xhigh/max/ultra
reached google/gemini-4-hydrogen and google/gemini-4-neon as thinking_level "high".
The model set and the step move to agent.reasoning_effort (next to
GEMINI4_THINKING_LEVELS) and both profiles call it; Argon and Carbon still cap at high.
Adds gemini-4-neon to the Gemini provider catalog and official pricing snapshot ($3/$15/$0.15 per 1M input, output, and cache-read tokens) while keeping gemini-3.8-flash as the silent default. Enables the xhigh thinking level for Gemini 4 Neon alongside Hydrogen on xhigh, max, and ultra efforts, inheriting the existing 1M context window, 64K single-request cap, long decode continuation, and Interactions API routing.
A bare or -p command still depended on the shell that ran it: a named launch inspecting the
default home, or a custom root copied into a shell with HERMES_HOME unset, enabled another home
and left the inspected one parked. The command now always says which HERMES_HOME to set, plus
-p default when that home is not profile-shaped (profile_root_for_env_home). The notice reads
config once for the update record and the selected provider.
A bare hermes follows the sticky active_profile, so a default-home notice copied into a shell
whose sticky profile is another one enabled the provider there. The default home now drops -p
only while no other profile is sticky, and a home outside the profile tree is named with
HERMES_HOME plus -p default.
A provider-owned config panel (storage=provider) answered a provider parked in
plugins.disabled with "could not be loaded; see the logs" (#149402 follow-up).
It now returns parked_provider_notice, the notice the CLI, doctor and agent show.
The notice now says "external memory is off" only when the parked provider is
the selected memory.provider; the panel can inspect any provider while another
stays active. Its enable command carries `-p <profile>` for a named profile
(profile_cli_selector), so a ?profile=work panel names the profile it reads.
adapter.py still imported adapter_choice_cards and adapter_synthetic_events by absolute path, so their own `.cards` imports resolved to plugins.platforms.feishu.cards, which a plugin reload never evicts: clarify/choice clicks and synthetic events kept running the pre-reload card helpers. The reload test now overrides the helpers in the copied cards/authz.py and drives the chat-info, clarify and synthetic-event lanes.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>