- The R2 mirror is now asked with a 2 s timeout (or the caller's, if shorter) before
the Portal fallback. Before, a mirror that hung rather than refused used the
caller's whole 5 s budget first, doubling the worst-case uncached picker wait.
- The gateway's catalog refresh also counts a NOUS_API_KEY (read via get_secret, so
profile-scoped) as a Nous account, so env-key setups keep their warm cache.
The gateway's model-catalog watcher force-fetched the Portal's
/api/nous/recommended-models every 20 minutes on every install, whether or
not the profile had a Nous account, and always from the default Portal.
Nothing outside a Nous account reads that payload.
- refresh_catalogs() refreshes the recommendations only when the profile
holds a non-guest providers.nous login or pooled nous credential, and
for the Portal it signed in to.
- fetch_nous_recommended_models() reads the copy each Portal publishes to
R2 at https://web-assets.nousresearch.com/dynamic/<portal host>/api/nous/recommended-models
instead of the Portal origin, and falls back to the Portal itself when
the mirror has no copy (404) or fails. A loopback (dev) Portal is asked
directly. Disk cache keys are unchanged.
Every cache keyed on a file's stat signature had the bug the config caches had: a same-size
in-place rewrite in one coarse timestamp tick keeps mtime, ctime, size and inode, so the older
parse was served for the rest of the process. Move the helper to utils.file_cache_version
(file_signature + content digest while the file is under 2 s old; always_digest for signatures
compared much later, where the racy digest going empty would read as a change) and key every
cache that can hold a secret, token, pairing/allowlist, route or config on it:
- auth.py: global auth-store memo, Nous auth-status memo (was mtime only)
- gateway/pairing.py approved-users cache (a revocation kept access)
- run_profile_reconcile: served-profile signature (always_digest: a false change reconnects
adapters) and the hook-consent signature
- webhook dynamic routes (route HMAC secrets), Feishu comment pairing/rules cache (mtime only)
- MCP OAuth tokens-file reload check (mtime only; always_digest: a reload tears the session down)
- config parse-failure record (always_digest), named-custom-provider memo, model aliases,
gateway.standalone memo, profile model read, MoA preset, agent raw config,
tui_gateway raw config cache, onboarding due stamp, free-tier inventory stamp,
provider model-list credential fingerprint, git safe.directory key, skills prompt
manifest
config_cache_version takes its stat through config_version, so its errors and seams are unchanged.
Left alone: the tool-definition cache key and the platform manifest stamp (a safe worker must
never open config.yaml or a plugin file; the MoA preset cache is skipped in one instead) and the
CLI MCP watcher seed (pinned to file_signature by a main test).
sync_plugin_provider_catalog copied every profile's static_models into the process-wide
_PROVIDER_MODELS with setdefault: the first served home won forever, so a second home that
registers the same provider name with other models defaulted to the first home's model, and a
home without the plugin listed (and could switch to) a provider it does not have.
Nothing is copied any more. static_catalog(provider) answers from the built-in row, else from the
bound home's profile at lookup time; static_catalog_providers() lists built-ins plus this home's
plugin rows. The catalog readers (defaults, detection, pickers, setup) use them.
hermes_cli/models.py no longer carries any Copilot code (2977 -> ~2640 lines): the live /models
catalog + caches, context windows, id normalization + alias table, reasoning-effort helpers,
catalog-token fallbacks and editor headers move to plugins/model-providers/copilot/catalog.py;
the copilot-acp session memo moves to plugins/model-providers/copilot-acp/catalog.py. The curated
copilot / copilot-acp rows leave models_catalog_static.py.
Core reaches them through generic ProviderProfile seams (providers/base.py, I2-cat block):
- picker_catalog(force_refresh): a provider-owned picker catalog, tried in the slot of a built-in
_PROVIDER_CATALOG_FETCHERS row (presence = a live source, so the static tail stays a placeholder)
- static_models: curated ids registered as the provider's core static-catalog row
(sync_plugin_provider_catalog), so detection/defaults/validation keep seeing them
- probe_models(base_url, api_key, timeout): probe_api_models asks the host's profile
(profile_for_host, metadata hosts included) before the generic HTTP probe; the dead
api.githubcopilot.com header branch behind the old early return is gone
- invalidate_catalog_cache(): /model --refresh drops provider-owned memos
- catalog_credential_files: credential files folded into every cached catalog's fingerprint
(same slot/order as before, so fingerprints are byte-identical)
Plugin callers import from .catalog; tests re-targeted (patch.object on the plugin modules),
plugin-only test files moved under tests/plugins/model_providers/.
- providers.profile_for_host is the single host->profile lookup (declared hostnames, exact or
subdomain), memoized per (hermes_home_key, host, metadata) and invalidated by a registry
generation counter bumped on every registration (process-wide or per-home layer).
- agent/provider_route_hooks.route_profiles = named profile, then profile_for_host(base_url);
replaces L1's every-profile scan, L2's conversation_loop._credential_refresh_profile host scan
and L3's agent/endpoint_profile.py + ProviderProfile.serves_endpoint (deleted).
- Copilot hostnames gain models.github.ai (the L3 Responses/reasoning gate host); per-site
differences (carriers, editor headers, initiator) stay in the plugin hooks keyed on base_url.
- Pure per-request hooks (request_headers, max_tokens_param) are memoized per argument set so a
plugins.isolation: host proxy pays one IPC call per request shape.
- hermes_cli/models.py: delete _should_use_copilot_responses_api / copilot_model_api_mode;
runtime_provider routes per-model providers through api_mode_for_model generically.
- credential_refresh_notice seam restores main's Copilot refresh status lines.
- auth._env_key_auto_detected: ambient-credential check reads list_providers once instead of a
per-pid get_provider_profile miss that walked the provider ladder (welcome_trial regression).
Every CLI start imports all provider plugins (hermes_cli.config lists their env vars), and
fireworks/gmi/xai/router/kimi/opencode plus auth_constants, models, model_catalog,
auxiliary_client, gemini_native_adapter, web_server_messaging, slack, yuanbao and perplexity
built a `<product>/<release>` string at module level. In a source checkout the release comes
from the 7-call git provenance walk (`git tag --merged HEAD` alone is ~0.35 s in a large
clone), so `hermes sessions list` paid it for headers it never sends.
Provider profiles take a LazyHeaders mapping (resolved on first read by the client builders,
which already copy with dict()); core modules call version_info.hermes_user_agent() where the
request is built. Header values are unchanged.
Greptile "Expiry test replaces the deadline": the expiry check zeroed
FETCH_RETRY_DELAY_SECONDS and forced a second failure, so it never proved a
plain call retries once the original window ends. Advance time.monotonic past
the window and call get_catalog() unforced instead.
cached_provider_model_ids and cached_fetch_api_models loaded the cache,
fetched live, then saved that pre-fetch snapshot unlocked, so a slower
prefetch worker, SWR thread or other process dropped rows written
meanwhile and the picker fell back to curated lists. _store_cache_entry
now always re-reads under the thread lock plus a cross-process flock.
Drop the prefetch worker's compensating update_provider_cache_entry
re-persist: it re-stamped rows the canonical path deliberately leaves
untouched (stale catalog served on a failed fetch looked fresh for a TTL),
stripped the curated-fallback flag, and keyed ollama as "custom".
A free-tier guest who only uses connectors or managed tools no longer meets
the free-inference browser challenge. The connectors-side resolver
(resolve_nous_access_token: tool gateway, NAS connector routes, account
reads) serves whichever guest token is live (an inference one covers it) and
otherwise mints with purpose "connectors" (hermes-portal#1516), which NAS
never challenges. An inference token is minted, inside run_with_challenge,
only when the free model is called.
The connectors-only token is stored in providers.nous.connectors_token, next
to the existing inference slot, so auth.json written by current releases
loads unchanged. Which slot a token fills is read from its JWT scope claim,
so a NAS that predates #1516 (it ignores purpose and returns an inference
token, or answers 428) keeps working through today's challenge path.
Two non-chat paths no longer mint inference for a guest behind its back:
the auth keepalive skips a guest (its tokens are minted on demand, matching
the start-time guard), and the Nous model catalog and pricing reads run as
background callers, so they fall back to the curated list instead of opening
a browser challenge.
opencode-go's catalog carries claude-haiku-5-5, but the Go entry of _OPENCODE_API_MODE_PREFIXES had no claude- prefix, so it fell through to chat_completions and the relay rejected it with HTTP 400 ModelProtocolUnsupported (non-retryable, so the turn died on its first call). Route claude-* on Go to anthropic_messages, matching Zen. Regression asserts folded into the existing Go api-mode table test.
Fixes#134844
Co-authored-by: Mark S. <274530371+unsupportedpastels@users.noreply.github.com>
Review follow-up on the TokenHub relay fix. The comment claimed the registry
endpoint counts only "when the profile leaves it empty"; the code (correctly)
counts both, and no provider has two different non-empty URLs. The set is now
built from two named values instead of an inline hanging comprehension.
Considered and not taken: reusing agent_init._provider_default_routes. It also
counts the other Moonshot region and Gemini's OpenAI-compat path as canonical,
which would turn a kimi-coding user pinned to the other region's host from a
relay probe into native discovery. That is a behaviour change for a separate PR.
#134320 gave tencent-tokenhub a profile whose base_url is empty (its auth registry row owns
the endpoint). _configured_relay_base_url decides "relay or canonical" from the profile's
base_url only, so a model.base_url that `hermes model` saved as TokenHub's normal endpoint
read as a relay: the picker probed {endpoint}/models and a successful reply replaced the
curated Hy list, dropping curated previews the live list lacks. Before #134320 the profile
lookup failed and the curated list stood.
The canonical endpoint is now the profile's OR the registry row's inference_base_url, both
through normalize_route_base_url. A different path on the same host is still a relay.
Reported by the review bot on #134320.
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.
Per-user-quota OAuth inference for Hermes Agent, hidden by default until
public launch is cleared. Auth (OAuth2 + PKCE with the user's account) is
brokered by nous-account-service, which holds the confidential client secret;
inference goes direct to the per-user-quota endpoint.
Built fresh on current main; commit history carries only the codename.
Provider surface:
- plugins/model-providers/solstice/ — profile + hidden enable gate
- hermes_cli/solstice.py — PKCE loopback login, NAS-brokered config/exchange/
refresh, token store, quarantine; callback path unchanged
- agent/solstice_adapter.py — per-user-quota transport over the native
adapter's OpenAI-compatible facade
- providers/: _HIDDEN_GATES + register_hidden_provider_gate + a hidden filter
in list_providers (kept out of the picker/registry/doctor until enabled)
- wired into main.py (_PROVIDER_MODEL_FLOWS), auth_commands.py (_PROVIDER_ALIASES,
_OAUTH_ADD_SPECS, _is_known_provider allowlist), models.py (catalog fetcher),
runtime_provider.py (resolution rung), model_setup_flows.py, agent_runtime_helpers.py
Kept verbatim (the live wire contract, until the broker is renamed): the
inference host, the OAuth scope, the deployed broker routes, and the
registered redirect callback path.
The enable gate is unchanged (open item: gate on stored credentials).
Verified: 226 focused tests pass; runtime resolution, client construction
and auth-add all exercise the real paths.
The sign-in / re-auth picker (_pick_nous_model_after_login) built its own
paid list and skipped union_with_nous_on_sale_models, so a discounted model
the curated list and paidRecommendedModels omit never showed there. Apply
it after the paid recommendation union and before policy narrowing, as the
other two pickers do.
Also keep image/video generation rows out of the on-sale union: the Nous
pricing fetch flags them with the chat-catalog rule from 296ec08dcf.
A Nous sale exists only in the live /v1/models pricing.original. The paid
picker unions the curated manifest with the Portal's paidRecommendedModels,
so a model missing from both never appears even while it is the deepest
discount on the gateway (inception/mercury-2.5 at -80%); sale chrome only
badged rows that were already listed.
Paid-tier Nous pickers (hermes model and the GUI/in-chat picker) now append
every discounted, tool-capable, non-free row from the cached catalog,
deepest discount first, before org policy narrows the list. Free tier is
unchanged (freeRecommendedModels). The Nous pricing fetch marks rows whose
supported_parameters omit tools so the union can skip them.
Rebase onto current main and rework the recommended-default fix per
maintainer feedback on #51493 (teknium1 + DavidMetcalfe).
Premise of the original Opus-only filter rotted: current Nous curated
list leads with anthropic/claude-fable-5, then Opus. An Opus-only filter
would leave Fable selected and fail to establish cost-safe onboarding.
Current main already routes get_recommended_default_model through
pick_silent_default_model for both nous and non-nous providers, but the
helper still fell through to model_ids[0] when the catalog-labeled
preferred default wasn't present in the (Portal-augmented) list. That is
the remaining billing hole.
Changes:
- Add _is_anthropic_frontier_tier covering Opus + Fable, anchored on the
claude- prefix so community/distill slugs like qwopus3.6-27b-coder are
rejected and future releases (claude-opus-5-0, claude-fable-6) keep
matching without code changes.
- Harden pick_silent_default_model fallback:
preferred catalog label -> first non-frontier entry -> model_ids[0] -> empty.
Single shared policy used by both nous and openrouter callsites.
- Replace brittle Opus-first endpoint assumptions with:
parametrized opus_first / fable_first_main / override_beats_ordering,
falls_back_when_all_frontier, empty-list edge case, and unit coverage
for the frontier predicate.
web_server.py needs no further change -- it already consumes
pick_silent_default_model. Hardening the helper covers every consumer.
Fixes#51491
Maintainer decision on the FASTTIER review: drop the "Daybreak/cyber aliases
offer no speed tiers" rule this stack introduced. It flipped
model_supports_fast_mode to False for gpt-daybreak-* and gpt-5.6-cyber, which
also hid /fast and the Desktop Fast option for models that accepted Priority
before. Restore the pre-stack predicate verbatim, make the kept invariant
assert Daybreak is fast-but-not-ultrafast (the proxy route stays the no-speed
case) and remove the Daybreak sentences from the speed docs.
methods_session.py is already past 2000 lines, so the exact-tier parse that
#130990 grew in place moves with the rest of the composer overrides into
methods_session_model_guard.py (the session.create param gate), and the
strict "unknown word is an error, normal words pin ''" rule becomes
agent.fast_mode.parse_exact_service_tier next to the tier word table it
reads. The Daybreak/cyber exclusion folds into _is_openai_fast_model's
single return so hermes_cli/models.py does not grow.
Drops the PR's unused contextlib import in prompt_turn.py (no use was
added with it).
Co-authored-by: FroRaut <79215537+Froraut@users.noreply.github.com>
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)
Follow-up to #131892. The live+static merge landed in curated_models_for_provider,
which has no production callers on main: every real picker surface (CLI/Desktop/
Telegram /model, hermes model) resolves through provider_model_ids, whose stepfun
fetcher (_api_key_provider_live) returned the live Step Plan list unmerged — so a
working Step Plan API still hid step-3.7-flash (#41147).
Apply the merge where the stepfun live catalog is fetched, following
_anthropic_catalog's _merge_unique pattern: a new _stepfun_catalog fetcher merges
live rows first with the curated floor (deduped via _model_dedup_key), and a declined
probe (no creds / failure) still falls through to the generic profile path whose
merge_profile_catalog already serves the curated placeholder. The setup wizard's
_model_flow_stepfun now offers the same merged list via provider_model_ids. The
redundant dead-path merge in curated_models_for_provider is removed; its stepfun
test keeps passing because the merge now flows through provider_model_ids.
Fixes#41147
The StepFun Step Plan API only returns 2 models (step-3.5-flash,
step-3.5-flash-2603), but step-3.7-flash is available via the Standard
API. When the configured base_url points to Step Plan, the live fetch
overwrites the static catalog and step-3.7-flash disappears from the
/model picker.
Fix: add step-3.7-flash to _PROVIDER_MODELS["stepfun"] and merge live
API results with the static catalog in curated_models_for_provider()
so all known models appear regardless of which API endpoint is used.
Fixes#41147
get_codex_model_ids returns CuratedFallbackModels directly instead of a
second codex-only marker that _codex_catalog re-wrapped; the class moves to
the static catalog leaf so codex_models can use it. The catalog identity
normalizes its route with normalize_route_base_url like every other route
key.
_anthropic_catalog() returned the curated list as a plain list when the live
/v1/models fetch failed, so a transient outage on a proxy base_url was cached
with the full 1h TTL as if it were the account's/proxy's real catalog, and
neither a same-credentials restart nor Refresh Models could shake it before the
TTL lapsed. Wrap the fallback return in CuratedFallbackModels, the placeholder
type #107391 introduced for the same class of bug.
Salvaged from #121248 (the Anthropic half; the Codex half lands via the
typed-fallback commit before this one).
A failed ChatGPT Codex catalog fetch returned the static offline hints as if
they were the account's catalog, so the picker cached them and dropped
account-gated rows such as GPT-6 Astra until the cache expired. The hints are
now typed (CodexFallbackModels) and cached as short-lived curated fallback
rows that never replace a verified account fetch, and the catalog cache key
includes the resolved route, not only the ChatGPT principal.
Treat openai-api as the first-party api.openai.com route in _fast_mode_route_supported. This closes the route gate introduced by c7e2e0b779 while preserving the existing host check, so proxies and aggregators remain excluded. The shared service_tier parser already accepts operator literals, including ultrafast, and the existing static and bounded-mode paths thread the selected literal through request_overrides.
OpenAI's Ultrafast service tier (service_tier="ultrafast") is broadly
available for GPT-6 Astra in the API and Codex (Pro 500 / Enterprise),
billed at 6x Standard. GPT-6.1 Sol Ultrafast is announced as coming soon.
- One tier table: agent.fast_mode.parse_service_tier / STATIC_TIERS now
back the CLI, gateway and TUI config loaders (three hand-copied parsers).
- resolve_fast_mode_overrides(tier="ultrafast") sends the tier only for
Ultrafast models on api.openai.com / chatgpt.com; anything else gets
nothing rather than a silent swap to another paid tier.
- /fast ultrafast on CLI, gateway (typed + picker when supported) and TUI;
static-tier attach sites pass the tier through.
- Pricing: the response's SERVED service_tier is folded into usage (Codex
stream assembler keeps it); served ultrafast prices from a published
6x row (272K whole-request tier included). A request asking for
Ultrafast but served at default bills at Standard.
- i18n: 4 new keys in all 17 locales; option lists mention ultrafast.
* refactor(plugins): remove the Sep 2026 decomposition compat layer on schedule
The PLUGIN-COMPAT layer (2776813df3 + d63e380324 + 0a5164cebe) kept pre-#102117 import paths
alive for external plugins until 2026-09-14. That window closed two weeks ago; since then the loader
has already been skipping plugins that use the old paths. This removes the layer itself:
- 328 appended `PLUGIN-COMPAT` blocks (lazy `__getattr__` pointer tables, re-exported third-party
names, restored dead definitions) and the three re-export stub modules
(gateway/startup_watchdog, hermes_cli/observability/relay_runtime, tools/environments/modal_utils)
- COMPAT_MANIFEST.md, compat_manifest.json, scripts/check_compat_pointers.py and its lint step
- the reporting surfaces: CLI banner notice, `hermes plugins compat`, the `hermes doctor` section,
the post-update notice, the Desktop one-time dialog, the loader's pre-import skip and the
`plugins.allow_deprecated_imports` escape hatch
An external plugin that still imports an old path now fails to load with its ImportError as the
reason in `hermes plugins list`, the same path as any broken plugin.
hermes_cli/plugin_compat.py stays as three inert stubs (compat_report, removal_in_effect,
summary_lines): an already-running pre-removal `hermes update` lazy-imports them after the checkout
swap (tests/compat/old_updater_surface.json).
In-tree fallout, both already dead: hermes_cli/setup.py::_check_espeak_ng (no callers; its
`shutil` came from a compat block) and gateway/config.py::SessionResetPolicy ("retained solely for
the scheduled plugin-compat window"). Two test_run_agent patches targeted the removed
`run_agent.handle_function_call` pointer; they now patch `model_tools.handle_function_call`, the
seam production reads, like every sibling test in that file.
* chore: retrigger CI (zero-job startup_failure phantom)
* test: drop resolution allowlist rows for the two deleted which() sites
hermes_cli/setup.py::_check_espeak_ng (dead) and tools/skillevaluator_scan.py::scanner_available
(a restored definition inside a PLUGIN-COMPAT block) no longer exist; the stale-row gate requires
their allowlist entries go with them.
Follow-up to the #103857 salvage. The Copilot provider profile and the
main-agent GitHub reasoning path each carried the same clamp-then-medium
fallback. Both now call hermes_cli.models.clamp_github_reasoning_effort.
The offline Astra tests move next to the other Copilot effort tests, along
with a check that a structured catalog entry still wins. The main-agent
clamp now has a test pinning max/ultra -> high on the GPT-5 ladder. The
transport test no longer writes config.yaml. The two effort comments now
say the same thing.
Follow-up to the #103857 salvage. The Copilot pattern fallback now uses
is_astra_model (the shared exact set) instead of a gpt-6-astra prefix, so
speed-tier or unknown suffixes such as gpt-6-astra-pro stay off the Astra
ladder, matching every other Astra gate. Also drops the stale
'"max" is gpt-5.6-only' comment in the auxiliary Responses builder.
Follow-up to the #123592 salvage. The canonical endpoint now comes from the
provider profile, which also covers OpenRouter (absent from PROVIDER_REGISTRY),
so pinning https://openrouter.ai/api/v1 keeps the native catalog too. Both
sides go through normalize_route_base_url, the helper the rest of the route
comparisons use, so scheme/host case and default ports no longer read as a
relay. The provider is normalized once.
Chat catalogs and the session switch treated image and video generation
models as chat. Exclude them by the capability type and name shape the
catalog already publishes, reject selecting one as the session model, and
do not restore a primary already known to be non-chat. Desktop shows the
fallback switch in the transcript.
Addresses two P1 review findings on #121614.
1. `provider_model_ids`: a failed or empty relay probe fell through to the
canonical per-provider fetcher, sending the provider credential to exactly
the vendor host the user routed away from — recreating #121387 on the
failure path. A configured `model.base_url` relay is now TERMINAL for live
catalog egress and degrades to the local curated list instead. The curated
tail is extracted as `_static_catalog` and shared by both paths.
Fetchers that already resolve `model.base_url` themselves and degrade
locally (`_anthropic_catalog`, `_custom_catalog`, `_openai_catalog`, the
simple api-key fetchers) are excluded from interception via
`_RELAY_AWARE_CATALOG_FETCHERS` — they already satisfy the invariant and
produce a better-merged catalog.
2. `_try_anthropic`: an `explicit_base_url` that failed
`_is_anthropic_compatible_host` was silently dropped, leaving `base_url` at
the ambient/canonical host and continuing with the explicit credential —
a silent retarget of authority, not the refusal the PR body claimed. It now
returns unavailable before client construction.
Regressions: an egress-sentinel test pins that no vendor fetcher, profile
catalog or models.dev merge is reached after a relay 404/hang; the Anthropic
test now asserts no client and zero SDK builder calls.
Follow-up to the two contributor commits for #121486. The picker, the
image plugin and the auxiliary Codex client still composed a pooled
gateway key with a base re-read from ambient state (HERMES_CODEX_BASE_URL
or the chatgpt.com default), so a model.base_url-only gateway (env unset)
still sent its key to chatgpt.com.
- auth_codex: resolve_codex_runtime_credentials reports the host a pooled
credential actually routes to (runtime_provider._pool_entry_mode_and_url:
env > model.base_url while the row is canonical > row URL) instead of the
ambient default; get_codex_auth_status carries the same bound base_url.
- picker: get_codex_model_ids(access_token, base_url=) now receives the base
resolved with the token from hermes_cli/models.py, the CLI default-model
swap (self.base_url) and the `hermes model` Codex flow.
- aux/image: _resolve_codex_credential_and_base() returns (token, base) from
one pool selection; the image plugin, _build_codex_client and the raw
Codex client use it (profile-scoped override from #121497 still wins).
- model_metadata: the non-JWT refusal now applies only when the target is
chatgpt.com; a gateway key may probe its own gateway's /models.
Adversarial regressions: model.base_url with env unset, env/route mismatch,
opaque + JWT gateway keys, pool-selected credential, pool row with its own
gateway URL, direct-ChatGPT positive control.
Addresses @andrexibiza's review on #121508.
provider_model_ids() probed the provider's canonical host even when
model.base_url pointed the configured provider at a relay or proxy, so
the picker listed the vendor's models and sent the listing request to a
host the user never chose. Discovery now probes the same endpoint
inference uses, and any probe failure falls through to the canonical
fetchers unchanged.
Fixes#121387