Repository navigation
feat(providers): external-process providers as standalone model-provider plugins (core half of #105863) - #117451
Merged
Merged
Conversation
teknium1
force-pushed
the
hermes/hermes-a998ec6f
branch
from
September 20, 2026 19:28
3445163 to
d1d97b4
Compare
Contributor
૮ >ﻌ< ა ci reviewran on 5ed9504 — fix(plugins): share the loader's SUPPORTED_MANIFEST_VERSION debug infoCI timingsCI timings · View report · View jobWall time 4m54s vs 5m46s (-15.0%). 5 job(s) slower, 7 faster, 2 unchanged.
|
teknium1
force-pushed
the
hermes/hermes-a998ec6f
branch
4 times, most recently
from
September 20, 2026 20:58
a7e2467 to
6632688
Compare
teknium1
added a commit
that referenced
this pull request
Sep 20, 2026
…ename The parent polls ready.exists() and then json.loads the file, but the child wrote the record in place, so the file was visible (and empty) the instant it was opened; on a loaded windows-latest runner that read raced the dump and every parametrized case could die with JSONDecodeError: Expecting value (seen on #117451's Windows-only lane, legacy-models case). Write to <ready>.tmp and os.replace it into place, so exists() implies a complete record.
teknium1
added a commit
that referenced
this pull request
Sep 20, 2026
… relay test Both failed once and passed on retry in a CI run of #117451; each is a real race in the test harness, reproduced deterministically here and green after the fix under the same simulation. test_gateway.py: tests that fake is_windows() send the reaper through _windows_scheduled_task_state, which spawns pwsh whenever one is on PATH (GitHub's ubuntu runners ship it). On a loaded runner that spawn outlives its 10 s timeout and subprocess.run kills it through the test's globally patched os.kill, so a foreign PID lands in killed_pids (assert [(29408, SIGKILL)] == []). A module autouse fixture stands the probe in with None; the one test of the probe itself undoes it. Repro: a fake `pwsh` that sleeps 15 s on PATH. test_zombie_process_cleanup.py: the 0.1 s child cap could elapse before the executor's worker thread had opened the child's turn, turning "late result after timeout" into "child never started" (assert child_started.is_set()). The settle event the cap rides on now waits for the child to start before honouring the timeout. Repro: a 0.3 s sleep in the worker before fn().
teknium1
added a commit
that referenced
this pull request
Sep 20, 2026
…ename The parent polls ready.exists() and then json.loads the file, but the child wrote the record in place, so the file was visible (and empty) the instant it was opened; on a loaded windows-latest runner that read raced the dump and every parametrized case could die with JSONDecodeError: Expecting value (seen on #117451's Windows-only lane, legacy-models case). Write to <ready>.tmp and os.replace it into place, so exists() implies a complete record.
…el-provider plugins (from #105863) The provider-agnostic half of PR #105863, so a CLI-driven subscription provider can ship as a standalone `kind: model-provider` plugin instead of a bundled one: - ProviderProfile: `native_reasoning_details_type`, `model_aliases`, `get_model_context_length`, `get_usage_cost`, `setup_status`, `discover_models` hooks (all default None / no-op). - Chat Completions transport: provider-native `reasoning_details` carriers follow only their declaring profile; standard records still replay on OpenRouter-style routes, strict routes drop the field wholesale (#70233). Relay/stream accumulate `delta.reasoning_details` verbatim. - `hermes model`: the generic plugin flow gates an external-process row on the CLI's own login status (inline `login_command` on a TTY), offers `discover_models()` rows with per-row notes, and never writes config when the executable is missing. - `/model` and the pickers: process providers list their live catalog merged with the pinned one, declared aliases/ids resolve inside the provider, and validation accepts a listed id without probing `process://`. - Delegation keeps the selected external-process provider and protocol for the child. - Model metadata / usage pricing consult the profile's bound and cost hooks first. - Desktop: `[1m]` renders as a "1M" tag and hyphenated Anthropic versions read "Haiku 4.5". The bespoke `_model_flow_external_process` and hard-coded `hermes_cli/main.py` paths from the PR were dropped in favour of main's `_model_flow_plugin_provider`. Co-authored-by: unsupportedpastels <unsupportedpastels@users.noreply.github.com>
… pinned models in the GUI picker model.options (Desktop/TUI) reads catalogs non-blocking from the disk cache; a cold cache falls back to the curated dict, which was built from _PROVIDER_MODELS only, so any plugin provider rendered an empty model list on first open. Seed the curated floor from the profile's fallback_models. Red on base via tests/tui_gateway/test_external_process_picker.py.
Doctor pushed every plugin through PluginManager._load_plugin, which demands register(ctx); model-provider plugins register a ProviderProfile at import through providers/ discovery (the manager skips the kind on purpose), so every valid provider plugin failed with 'no register() function' while 'hermes plugins validate' passed it. Route the kind through providers._import_plugin_dir, report the registered profiles, and restore the live registry and module state afterwards. Same diagnosis and shape as PR #86160 by @oliver-mee (Aug 14), which reached it first; this version imports through providers._import_plugin_dir (the real discovery loader) instead of the PluginManager namespace. Credit: #86160. Co-authored-by: Oliver Mee <102673257+oliver-mee@users.noreply.github.com>
…installer (#85879) The installer carried a private manifest-version cap of 1 while the runtime loader (and the docs) accept manifest_version 2, so 'hermes plugins install' refused every v2 plugin the loader happily loads. Read the shared constant instead. The alignment landed once in e834ee8 and was reverted by the follow-up 5bad3d5. Salvaged from PR #85893 by @webdevtodayjason; rebased onto the decomposed plugins_cmd.py.
teknium1
force-pushed
the
hermes/hermes-a998ec6f
branch
from
September 20, 2026 21:23
6632688 to
5ed9504
Compare
This was referenced Sep 20, 2026
Closed
[Bug]: hermes plugins doctor fails every model-provider plugin, including all 34 bundled ones
#86153
Closed
teknium1
added a commit
that referenced
this pull request
Sep 20, 2026
…dels) The provider extracted from #105863 lives at NousResearch/hermes-plugin-claude-subscription-directsdk; this pins fa920cbb so `hermes plugins install claude-subscription-directsdk` resolves through the reviewed catalog (sidecar, pinned checkout, no "unreviewed source" warning) instead of tracking the repo's main. It needs the external-process provider seams from #117451, hence requires_hermes >=0.21.4 (the first release carrying them). POSIX-only: the transport uses process groups.
KineticGamesStudio
added a commit
to KineticGamesStudio/hermes-agent-1
that referenced
this pull request
Sep 22, 2026
…r registering
`hermes plugins doctor` judged a `kind: model-provider` plugin by asking "did a
ProviderProfile register at import?". Model-provider discovery
(`providers._import_plugin_dir`) logs an import exception into a warning and drops the
module, so a plugin that registers its profile and *then* raises — e.g. one that
constructs a Hermes internals dataclass with a field the current release removed — left
its profile behind and doctor printed:
OK: runtime discovery, manifest parsing, import, and registration passed
while startup discovery was in fact discarding the plugin. The consequence is not
cosmetic: because the module is popped from `sys.modules`, that profile's own
`create_client` cannot import its client any more
(`ModuleNotFoundError: No module named '_hermes_user_provider_<hash>_<name>'`), so Hermes
falls back to the standard OpenAI client and every turn dies on an SDK signature error
(`Completions.create() got an unexpected keyword argument 'reasoning_config'`), with the
real cause visible only as a warning in the log.
`_import_plugin_dir(..., strict=True)` re-raises after the same `sys.modules` cleanup;
`_load_model_provider` passes it and turns the exception into a load error. Discovery
keeps the swallowing default, so no other caller changes.
Verified against a real out-of-tree plugin that broke exactly this way:
- before: doctor `OK` with `provider(s): devin`, failure only in the log;
- after: doctor `ERROR: import raised TypeError: ... unexpected keyword argument 'keyless'`,
while the repaired plugin still reports OK.
tests/hermes_cli/test_plugin_dev.py: a plugin that registers and then raises must not
report OK, and the registry must be left untouched.
Follows NousResearch#117451 (118984d), which put doctors model-provider validation on the real discovery loader (providers._import_plugin_dir, registry restored afterwards). This closes the remaining gap in that same call: the loader still swallowed an import that raises after registering, so doctor reported OK for a plugin that discovery was dropping.
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.
External-process (CLI-driven) model providers can now ship as standalone
kind: model-providerplugins: core carries the generic seams from #105863, and the Claude Subscription DirectSDK provider itself moves to its own repository.Splits #105863 as agreed: this PR is the core half (no bundled plugin); the provider lives at https://github.com/NousResearch/hermes-plugin-claude-subscription-directsdk.
Changes
ProviderProfilehooks (all default no-op):native_reasoning_details_type,model_aliases,get_model_context_length,get_usage_cost,setup_status,discover_models.reasoning_detailscarrier follows only its declaring profile (any route); without a declaring profile, replaying routes keep standard records and strict routes drop the field (bug(providers): reasoning_details from prior Groq reasoning call leaks into next request payload, breaks non-reasoning Groq models #70233). Relay/stream accumulatedelta.reasoning_detailsverbatim.hermes model: the generic plugin flow gates anexternal_processrow on the CLI's own login status (setup_status; inlinelogin_commandon a TTY), offersdiscover_models()rows with per-row notes, and writes nothing when the executable is missing or logged out./model, TUI/Desktop pickers, validation: process providers list live ids merged with the pinned catalog (same list on every surface), declared aliases/id-prefixes resolve inside the provider,validate_requested_modelaccepts a listed id without probingprocess://._PROVIDER_MODELSrow seed the curated floor fromfallback_models(previously an empty row until the cache warmed; hit every plugin provider).hermes plugins doctorunderstandskind: model-provider(loads through providers/ discovery, reports registered profiles, restores the live registry). Previously every valid provider plugin failed withno register() function. Same fix as fix(doctor): validate model-provider plugins through the providers registry #86160 by @oliver-mee (earlier; credited as co-author);hermes plugins validatealready had this contract via 5f9042b, which supersedes fix(plugins): validate model-providers via register_provider(), not register(ctx) #109470.SUPPORTED_MANIFEST_VERSIONinstead of a private cap of 1, so documented v2 manifests install (hermes plugins install refuses manifest_version 2 plugins the runtime loader happily loads #85879, salvaged from plugins install caps manifest_version at 1 while the runtime loader supports 2 #85893 by @webdevtodayjason; the earlier alignment e834ee8 was reverted by 5bad3d5).[1m]as a1Mtag and hyphenated Anthropic versions asHaiku 4.5.Dropped from the PR: the bespoke
_model_flow_external_processand hard-codedhermes_cli/main.pypaths (main's_model_flow_plugin_provideralready covers them) and the bundled plugin directory.Validation
tests/hermes_cli tests/agent tests/tui_gateway tests/tools tests/providers tests/plugins(rebased head)test_dashboard_auth_gateexit 75 /test_execution_flag_detection/var/tmpfixture) which fail identically on pristineorigin/maintests/tui_gateway/test_external_process_picker.pyred on base (models == set()), green with the fixhermes plugins doctor <provider plugin> --ci: baseERROR: Plugin registration failed: no register() function; headOK … provider(s): claude-subscription-directsdk-experimentalhermes plugins install file://<repo>withmanifest_version: 2: baserequires manifest_version 2, but this installer only supports up to 1; head installsHOME/HERMES_HOME, realhermes plugins install→ discovery →list_available_providers→model.options→hermes model)external_process; 15/15 plugin tests green against this headclaudeon PATH)setup_status.available=Falsewith the npm hint;discover_models=None; pickers list the pinned catalog; a request raisesClaudeCodeMissingwith the install hint (no Popen traceback);hermes modelwrites no configCLAUDE_CONFIG_DIR)setup_status{available: True, logged_in: False}in 0.8 s viaclaude auth status;hermes modelprints✗ Claude Code is installed but not logged in. Run claude auth login…and writes no configRoot cause of the split: #105863 mixed reusable host seams with a vendor-specific subscription transport;
plugins/AGENTS.mdkeeps such transports out of tree.Infographic