The Copilot rows in the picker catalog (CANONICAL_PROVIDERS, PROVIDER_GROUPS,
model-catalog aliases, _AGGREGATOR_PROVIDERS), the providers-layer overlays
(HERMES_OVERLAYS, _ALIAS_GROUPS, _LABEL_OVERRIDES) and the models.dev id map
become generic ProviderProfile fields the copilot / copilot-acp plugins set:
- picker_after: the row lands after that slug (order in `hermes model` kept)
- picker_group: (group_id, label, description) fold in interactive pickers
- catalog_aliases: profile aliases also normalize in the model catalog
- aggregator: joins _AGGREGATOR_PROVIDERS at sync time
- provider_overlay: HermesOverlay fields for the models.dev-keyed definition
(hermes_overlays() merges them; normalize_provider/get_provider read them)
- models_dev_id (existing): read at lookup time by models_dev_id_for /
models_dev_provider_map, never merged into PROVIDER_TO_MODELS_DEV
The picker's copilot live-catalog branch was equivalent to the generic one
and is dropped; the dead "copilot" auth type leaves _ACCOUNTS_AUTH_TYPES.
The ChatGPT/Codex backend accepts service_tier: "ultrafast" from a plan
without the entitlement and silently serves the default tier (live:
pro plan, Sol and Astra both answered at ~49 tok/s, served_tier=default,
while the same account's /models catalog lists only "priority"). The
official Codex client gates Ultrafast on that per-account catalog, and
OpenAI's own tracker shows it differs per account and per model.
/fast ultrafast (CLI, gateway picker, TUI config.set) and the Desktop
capability flag now ask agent.codex_service_tiers.ultrafast_offered:
the existing route gate, plus on the Codex subscription the account's
own catalog (read through the salvaged per-credential tier cache, the
stored ChatGPT OAuth JWT when the caller holds an API key). An
unreadable catalog never refuses. The API key route is unchanged and
serves Ultrafast for gpt-6.1-sol (salvaged allowlist + pricing).
`/fast ultra` is accepted as shorthand for `ultrafast` on every surface.
The refusal copy no longer claims Ultrafast is GPT-6 Astra-only.
build_models_payload(include_unconfigured=True) — the path the in-session TUI
/model command uses — appended CANONICAL_PROVIDERS skeleton rows via
_append_unconfigured_rows() without consulting model_catalog.excluded_providers.
So every excluded provider reappeared in the TUI picker even though hermes model
(list_authenticated_providers) hid it correctly.
Filter excluded providers in the skeleton loop, normalized the same way
list_authenticated_providers does ({str(p).strip().lower()}), and exclude
unconditionally — including the configured-current provider — to match that
path, which drops an excluded provider even when it is current.
Adds include_unconfigured-path coverage: excluded provider removed (others
intact), case-insensitive match, current-excluded-provider dropped, and
empty/None excluded is a no-op.
Fixes#68816
ProviderProfile gains `hidden` and `listed()`. A hidden profile is left
out of every surface that offers providers (the hermes model / setup
lists, /model and the TUI inventory, the provider catalog behind the
dashboard accounts tab, the hermes auth add picker) until the user signs
in by name and its credential pool holds a row. Resolution by name is
never gated, so --provider, model.provider and `hermes auth add <name>`
keep working.
This replaces the PR's global _HIDDEN_GATES registry plus a per-provider
enable function, which returned True unconditionally and showed the
provider to every user.
The provider heading's status slot now shows a fuel gauge for the
tightest usage window: hidden while there's room, "17% left · resets
3:00 PM" at 20% or less (amber from 10%), with a bar along its bottom
edge for what's left, then the existing "Limited until" once the login
is out. Hovering lists every window (5-hour, weekly, per-family).
model.options attaches `usage: { windows }` from a per-profile cache in
agent/account_usage_cache.py and refreshes it in the background, so the
picker never waits on a usage API. Every fetch_account_usage call lands
in that cache, including the one session.usage runs after each turn, so
the chip is at most a turn or two minutes behind. Covers the built-in
fetchers (Anthropic, Codex, OpenRouter) and any provider plugin's usage
hook.
Both pickers now render one ProviderStatusChip instead of separate
limit badges.
Offsets the code-health ratchet: the monolithic locale files and types.ts
may only shrink, and ModelFamilyRow's complexity may not grow. The pool
limit read logs its traceback instead of a silent catch-all.
model.options now attaches `limit` to a row whose credential pool is
rate-limited: `account` (every live entry benched credential-wide, e.g. a
Claude Pro/Max 5-hour window) with the pool's own reset time, or `models`
(only those models are cooling down, each until its own time). Read from a
new read-only CredentialPool.limit_state; entitlement benches aren't reset
windows and stay out.
Desktop renders it in both pickers: an amber "Limited until 4:30 PM" badge
on the provider heading with its models dimmed but still selectable, or a
"resets 4:30 PM" badge on just the cooled-down row so its siblings read as
the way to keep working. A limit whose reset has passed drops on its own.
The for_picker cooldown rule lived only in the overlay section, so a pooled
models.dev provider (gemini) or canonical provider still vanished while its
pool sat in a 429 cooldown, even from pickers that ask for visibility.
_credential_pool_is_usable now takes for_picker and every picker section
passes it.
model.options keeps cooldown rows visible without shortening the live probe of
the current custom endpoint (fast_custom_probe=False, the full 5s budget).
Tests drive the real payload builder against a real auth.json pool: an
exhausted or per-model-cooldown pool keeps its row (anthropic via the overlay
section, gemini via models.dev; explicit_only on and off), and a slow current
custom endpoint keeps its discovered models.
Co-authored-by: Finn763 <Finn763@users.noreply.github.com>
Review feedback on #103843: forwarding for_picker=True to keep exhausted-pool
providers visible also flipped _discover_endpoint_models' budget for the live
current-custom-endpoint probe from 5s to 1.5s, so an endpoint answering
between the two budgets silently lost its discovered models from /model.
Thread fast_custom_probe (bool | None) through build_models_payload ->
list_authenticated_providers -> _PickerBuild; None resolves to for_picker so
every existing caller keeps its timeout. The CLI main picker passes
fast_custom_probe=False to retain its historical 5s probe budget while
keeping cooldown providers selectable.
Regression tests pin both sides: a slow current endpoint keeps its
discovered-only model with the full budget, and the default coupling plus
an explicit fast probe still cut it off.
Desktop/TUI/API model pickers go through build_model_options_payload, which
never forwarded for_picker=True. Rate-limited credential pools were then
hidden mid-session, so providers vanished from the chat model dropdown even
though another model under the same provider may still work.
_apply_featured() documented that only aggregator rows get a
featured_models shortlist, but decided "is this an aggregator?" with a
local heuristic: does any model id contain "/" and span >= 2 prefixes?
Every user-defined provider following the Org/Model id convention
therefore got a top-5-per-lab shortlist, and the desktop picker — whose
default-visible set IS featured_models — hid models its owner had
configured by hand (#120217: 3 of 13 models in the reproduction,
including a brand-new flagship ranked out by a missing release_date).
The same module already answers this canonically: is_routing_aggregator(),
used by _strip_aggregator_overlaps(). Reuse it — skip the shortlist for
is_user_defined rows and for any slug the predicate does not claim, before
the models.dev lookup loop.
tests/hermes_cli/test_inventory.py asserted
featured_models == models for a user-defined providers.lab row, which is
exactly the behaviour this issue says is wrong; it now asserts [] while
keeping the constant-config-read invariant the test exists for.
Fixes#120217
The picker payload resolved fast-mode overrides twice per catalog model (plain, then
tier="ultrafast"); with tier="ultrafast" the function passes the same two gates and then
returns non-None iff model_supports_ultrafast, so one resolve plus that predicate is
equivalent.
Ultrafast collapsed into ordinary Fast across the stack: the catalog only
reported `fast`, presets and drafts stored a boolean, session.create took
only `fast`, and Settings had a single Fast switch, so an Ultrafast default
read as Fast and a new chat could lose it.
- Inventory reports `ultrafast` per model from the same route-aware
resolver that builds the request; Daybreak aliases offer no accelerated
speed (their priority request is ignored).
- session.create accepts an exact `service_tier` that wins over the legacy
`fast` flag; unknown tiers are rejected.
- Desktop keeps the exact tier through presets, draft creation, session
options and labels; an unsupported remembered tier falls back to
Standard, and failed edits reconcile to the confirmed state.
- Settings → Model → Main model offers one Speed choice (Standard / Fast /
Ultrafast) on models that support Ultrafast; others keep the Fast switch.
Split out of #129251 (which keeps Daybreak).
(cherry picked from commit 4e332fb850c989ef9f34bd70aaca174042beecc6)
Add _raw_config_has_enabled_moa_preset() guard to _moa_provider_row()
so the virtual MoA provider row only appears in model pickers when the
user's raw config.yaml explicitly enables at least one MoA preset.
The synthesized 'default' preset from normalize_moa_config({}) (which
every user gets via DEFAULT_CONFIG defaults) must not be treated as a
user choice — a user selecting 'openai-codex:gpt-5.6-sol' should never
see a transient switch to provider=moa.
The guard already existed in _filter_explicit_provider_rows() but was
missing from _moa_provider_row(), which is the entry point for the
non-explicit picker paths (TUI full picker, dashboard picker, etc.).
Adjust three tests that iterated CANONICAL_PROVIDERS (which includes
'moa') or used count-based assertions that assumed MoA was always
present.
The whitespace reject ran for every provider, so a self-hosted catalog or a
user-configured base_url could not select an id that legitimately contains
spaces. Cloud providers still reject. Picker payloads drop an id that
reject will still refuse.
Fixes#43140
_disk_serve_tier owns the ollama clamp now, and get_model_capabilities /
get_model_info already treat config=None as load-it-yourself.
Six config=config pass-through ternaries in agent/models_dev.py whose callees
have no test double (_configured_catalog_provider, _models_dev_id,
_get_provider_models) collapse to a single call; the _cfg_get and
_load_model_overrides ternaries stay because tests replace those functions.
Branch semantics kept where main and PM disagree: update_cmd_deps.py,
constraints-termux.txt, the Electron update-api-check module and the
post-swap hand-off test stay deleted; the pending-fleet-restart catch-up
and the local_runtime tag/download ladder stay retired (PM owns engines).
Ported from main onto the branch's shape: profile_scoped_chore for the
auto-archive and plugin-update housekeeping chores, the local-runtime
cross-process boot lock and residency cap, the checkpoint tmp_pack sweep,
the cua daemon-liveness status probe, the remote-served Desktop update
flag (posix.sh / windows.ps1), sign-in for env-pinned remote gateways
(urlDisabled on RemoteSetupFields), the uvloop extra split (uvicorn
without [standard]), and the umask-scoping spawn test.
uv.lock regenerated with pm.build_env --lock-only; new utf-8 reads from
main switched to utf-8-sig (check-windows-footguns).
Parametrize the slug-detected and URL-detected twin into one test and keep the
different-upstream control; the no-aggregator case is covered by the existing
_strip_aggregator_overlaps tests in test_inventory.py. The try/except around the
agent.model_metadata import guarded a module that always exists in-tree.
The /model -> local/ flow offers the 'llamacpp' row from staged GGUFs alone,
but resolve_provider_full only admitted that id behind a live endpoint, so
selecting a staged model died with "Unknown provider 'llamacpp'" before the
runtime seam could start or attach a server.
- providers.py: LLAMACPP_PROVIDER_ID/ALIASES are the single definition; the
llamacpp rung resolves when a server is reachable OR a model is staged.
- inventory.py: the picker row's slug comes from that definition.
- endpoint.py: honour local_runtime.detect_ports (every provider caller
invoked the resolver bare, leaving the documented knob dead).
- model_switch.py: a local-runtime alias failure surfaces the seam's own
message instead of an API-key hint.
Salvage follow-up to the previous commit (#114397 by @Finn763):
- Codex/Copilot rows went through cached_provider_model_ids directly, so a
cold cache on the non-blocking read path rendered an EMPTY Copilot row
(live repro: copilot:0). Route them through _live_or_curated_ids like
every other built-in so the curated list fills the first open.
- Drop the catalog_pending row flag, provider_catalogs_refreshing and
_mark_catalogs_pending: no surface consumes it and it would have needed
a gateway contract regen. Drop the _spawn_background_warm wrapper: the
ollama-cloud row's own SWR refresh already warms that cache.
- Z.AI endpoint detection only persists a SUCCESS, so a key that 429s on
every endpoint re-ran four chat-completion probes on every
credential-pool load (load_pool("zai") runs several times per picker
open; the reporter's logs show exactly these repeated POSTs). Memoize
the failure in-process for 5 minutes. Copilot already has the same
negative cache for its token exchange.
- Tests trimmed to two invariants (degraded provider cannot stall the
open + row still renders; explicit refresh still probes) plus one for
the Z.AI negative cache; a rigid test fake gains **kw for the widened
cached_provider_model_ids signature.
- Docs: how GUI pickers source per-provider lists and what Refresh does.
Live repro (temp HERMES_HOME, five built-ins pointed at a stalling
/v1/models stand-in, Z.AI key set): refresh=False 50.5s on origin/main ->
3.7s on this head; without Z.AI 43.7s -> 1.3s.
Opening the desktop model picker could sit on skeleton placeholders for 70s+
because a normal open (refresh=False) ran live provider catalog probes inline:
the serial row pass fetched each stale provider's /v1/models itself, and the
parallel prefetch joined every worker, so one degraded provider (hanging
endpoint, failed auth probe) held the whole response.
A normal open is now a read path:
* cached_provider_model_ids(non_blocking=True) serves the same-credentials
disk entry of any age and refreshes it in a daemon thread; a cold row
returns [] so the row keeps its curated list.
* list_authenticated_providers(non_blocking_catalogs=True) skips the joining
prefetch and reads every row cache-only; build_model_options_payload turns
it on for refresh=False (api-server / dashboard / TUI model.options).
* rows whose catalog is still warming carry catalog_pending, so a GUI can
tell "not resolved yet" from "that is the provider's catalog".
* Ollama Cloud's 8s probe becomes a cached read + background warm; the
loopback LM Studio probe stays (1.5s, cannot be a degraded remote).
* The SWR write now takes the cache lock: the read path spawns one warm per
stale provider, and concurrent load-modify-save dropped rows.
An explicit refresh (Refresh Models) still probes live and blocking.
(cherry picked from commit 0f2c2e7a3631f2c8f3b5140642306eaf2d688682)
The keyless OpenCode free tier was the only provider that ever set
`HermesOverlay.keyless`, so the flag and everything keyed off it is now
unreachable: the `keyless=` field on `HermesOverlay` and
`ProviderDescriptor`, the `_overlay_has_creds` early return, both
`_provider_is_keyless` copies (auth.py and inventory.py), the
`get_api_key_provider_status` keyless short-circuit and its
`key_source: "keyless"` placeholder, and the empty
`_KEYLESS_STABLE_CACHE_PROVIDERS` set whose `_credential_fingerprint`
branch could never match.
Dropping the two catalog-derived test exemptions follows: they computed
the empty set.
Reconcile plugin declarations and validation through PM's atomic generation publication; preserve external runtimes, target markers, and conflict refusal. Keep one source-update completion owner and port upstream lifecycle changes to the PM desktop/runtime paths.
Review follow-up for #112359:
- gateway `_format_session_info` (the /model info block) printed only
`Model: <preset> / Provider: moa`, so the messaging surfaces still hid
who pays; append the same "Acting model (billed for the run)" line the
CLI switch summary prints.
- `_provider_mismatch_notice` compared providers case-sensitively and
treated the routing pseudo-provider `auto` as a billing seat, printing a
misleading "not to OpenAI" / "not to auto" line; lower-case both sides
and skip `auto`.
- "references only advise once per user turn" is only true for the
default `fanout: user_turn`; say "by default" on the inventory row, the
`hermes moa list` header, the Desktop pill/description (en/zh/zh-hant)
and the docs line.
Follow-up to the cherry-picked #112368 so the whole class lands in one PR:
- `hermes model` inventory row (also the gateway picker): the virtual `moa`
row's warning now says the aggregator is the acting model billed for the
run and references only advise once per user turn (ported from #112362).
- In-session `/model` switch onto a MoA preset prints
`Acting model (billed for the run): <provider>:<model>` under the Provider
line — the preset name alone hides who pays (issue suggestion 3; reuses the
same aggregator lookup the picker rows already do).
- Desktop: the MoA section blurb moves behind a `moaDescription` i18n key
(en/zh/zh-hant; the other locales inherit English via `defineLocale`) instead
of hardcoded component text, following #112362's shape.
- Tests trimmed to two CLI invariants (notice fires on provider mismatch /
stays silent when providers match or the main provider is unknown) and one
Desktop assertion on the aggregator row pill.
- Docs: `website/docs/user-guide/features/mixture-of-agents.md` gains a
"Who pays for a MoA run" callout and documents the mismatch notice.
WHY: a Codex-subscription user put the aggregator on another provider and
had the entire tool loop billed there (#112359). The aggregator is the acting
model on every step, so each surface that shows a preset must say so.
Co-authored-by: KoNit-K <124019182+KoNit-K@users.noreply.github.com>
Activation reaches plugin discovery before the application dependencies
exist. Give PM its own locked Python project and runtime so it can install
or repair the application without importing that dependency tree.
Keep PM outside the application workspace. A shared uv workspace resolves
the application graph and cannot provide this isolation. Route mutations
through an isolated worker and preserve transaction callbacks, cancellation,
custom package registrations, and correlated receipts.
Use the same runtime builder for source installs and packaged payloads.
Keep offline wheelhouse support in that builder. Nix builds the independent
PM lock as a separate derivation. Refuse lazy-disabled bootstrap before
installing tools or dependencies.
Move first-party YAML readers and writers to ruamel. Keep the application
lock's transitive PyYAML requirements for third-party packages.
Verification:
- Focused canonical Python suite: 177 passed, 1 host-gated skip.
- Electron backend probes: 12 passed. Electron typecheck passed.
- Both uv locks, scoped lint, Bash syntax, and whitespace checks passed.
- Cold activation, corrupt-app repair, offline staging, and relocation ran.
- Built and exercised the Nix PM runtime and standalone YAML merge script.
Six broader caller test files retain the same 24 failing test IDs as an
archive of HEAD. The existing real-home guard blocks those tests before
they can exercise the affected paths. No full-suite pass is claimed.
Native Windows signing and full Bionic package execution remain unverified.
* feat(desktop): free-tier state over RPC, status routes that name it, and a sign-in that keeps connectors
The desktop learns about the Nous free tier by reading local auth state (pull): free_tier.status
answers has_guest / enabled / carries_inference / notice_pending with zero network, and
free_tier.ack_notice persists the one-time notice flag on the identity itself. setup.runtime_check
reports free_tier for the selected route; /api/portal, the Nous card in /api/providers/oauth and
billing.state carry free_tier (billing answers the free tier locally instead of a portal call that
can only fail). The free-tier picker row carries an explicit free_tier_row flag and is never priced or
locked. POST /api/providers/oauth/nous/start over a free-tier identity registers the connector
transfer and returns its code and consent URL; the poller waits for the transfer before the token
grant, persists the account, runs settle_after_upgrade, and the poll response gains reason,
account_email and model.
* feat(desktop): free tier on Hermes Desktop: ready screen, notice strip, status chip, Billing view, one sign-in dialog
The renderer reads the free tier from free_tier.status (pull) into one store; the first-launch
intro is the same state rendered two ways, keyed on the backend's one-time flag: the onboarding
overlay opens on a ready screen when the free tier carries inference, else a one-time strip above
the composer. Settings > Billing gains a free_tier view (notice with one Sign in, Plan / Model /
Connectors summary, plan card, footnote; no payment or usage rows). A status-bar chip names the
tier and model while it carries inference. Every entry point opens one claimed sign-in dialog that
drives the extended oauth/nous route and maps the poll's status and reason to the ruled screens;
Done settles billing, model options, providers and re-homes a session still on nous/welcome. The
picker badge also fires on free_tier_row. Docs: Desktop section in the free-tier guide, AGENTS notes.
* fix(desktop): free_tier.status starts the free tier's background setup when no identity exists
A served backend has no session-setup moment like the CLI's, so beside an explicit provider the free
tier was never set up on the desktop: no connectors, no notice strip. The first status read now
starts the same one-attempt background setup; the call itself never waits.
* fix(desktop): one Sign in on the Billing page; Settings > Providers names the free tier, never Connected
The free-tier plan card is the what-you-get text alone (the notice carries the page's one Sign in).
The Nous provider row reads Nous · free tier with a Free tier tag while the identity is the free
tier, instead of Nous Portal · Connected.
* fix(desktop): Settings > Providers never files the free tier under Connected
* fix(desktop): the intro's shape is keyed on the route, not on the identity
free_tier.status reports available (an identity exists and the tier is on); whether inference
runs on the free tier is setup.runtime_check.free_tier, keyed on the resolved endpoint. The ready
screen shows when that route is the free tier; the composer strip when the user's own provider
carries inference. An own-key install used to get the ready screen.
* docs(desktop): say what the free-tier chip is keyed on
* fix(desktop): the featured Nous row's pitch on the free tier says what signing in adds
* fix(desktop): a cancelled or superseded sign-in attempt can no longer change the identity or hide the intro
Four lifecycle holes from review. The Nous poller checks the session's cancelled flag after the
transfer wait, after the token grant, and once more under the session lock together with the
save, so a sign-in the user abandoned never persists. The renderer's sign-in store carries an
attempt generation that every continuation checks after each await, so a poll from a closed
attempt cannot publish over the one on screen (and its backend session is cancelled). The ready
screen comes down only after the backend recorded the acknowledgement. A composer still mounted
takes over the notice claim when its owner unmounts. One thin test per hole.
No runtime consumer read the proxy (terminal_tool/environments call is_interrupted()/set_interrupt()
directly); its only users were tests patching tools.interrupt._interrupt_event, which had no effect on
the code under test. tools/terminal_tool.py's own re-export of the name is owned by another worker.
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
The naive line scanner's open() regex matched the human-readable phrase
"next picker open (or refresh)." inside the warning string, tripping the
Windows footgun gate. Reword to "next picker open or refresh."