Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(model-hub): read keyless Exa catalog (#2955)
Call Whiteb9631e3306f7
diff --git a/config/v2_config.py b/config/v2_config.pyindex 3f46b6ee0..3a6bf8dea 100644--- a/config/v2_config.py+++ b/config/v2_config.py@@ -3131,11 +3131,57 @@ class ModelHubImageModelChoice:return {"source_id": self.source_id, "model_id": self.model_id}+# Built-in keyless Exa is a dormant reader contract in KEX-1. KEX-3 flips this+# predicate together with the producer and public disclosure.+KEYLESS_EXA_ACTIVE = False+KEYLESS_EXA_SOURCE_ID = "src_exakeyless"+KEYLESS_EXA_VENDOR_ID = "exa-mcp"+KEYLESS_EXA_SERVICE_ID = "exa/mcp"+KEYLESS_EXA_DISPLAY_NAME = "Exa (free)"+++def is_keyless_exa_source(source: "ModelHubSourceConfig") -> bool:+ """Whether ``source`` is the credential-free synthetic Exa identity."""++ return (+ source.id == KEYLESS_EXA_SOURCE_ID+ and source.vendor == KEYLESS_EXA_VENDOR_ID+ and source.protocol == "search"+ and source.supply_channel == "hub"+ and source.credential_ref is None+ and source.base_url is None+ )+++def model_hub_keyless_exa_source() -> "ModelHubSourceConfig":+ """The in-memory Source shape used by readers; it is never persisted."""++ return ModelHubSourceConfig(+ id=KEYLESS_EXA_SOURCE_ID,+ kind="api_key",+ vendor=KEYLESS_EXA_VENDOR_ID,+ display_name=KEYLESS_EXA_DISPLAY_NAME,+ protocol="search",+ supply_channel="hub",+ billing="metered",+ state=ModelHubSourceStateConfig(status="active"),+ models=[],+ )+++def is_keyless_exa_source_id(value: object) -> bool:+ return value == KEYLESS_EXA_SOURCE_ID++++def model_hub_search_service(source: ModelHubSourceConfig) -> Optional[dict[str, Any]]:- """Catalog capability, independent of health and opt-in; never a relay or subscription."""+ """Catalog capability, including the credential-free built-in Exa identity."""from vibe.model_hub_runtime.api_key_vendors import search_service+ if is_keyless_exa_source(source):+ return search_service(KEYLESS_EXA_VENDOR_ID, "search", None)if source.kind != "api_key" or source.supply_channel != "hub" or not source.credential_ref:return Nonereturn search_service(source.vendor, source.protocol, source.base_url)@@ -3190,9 +3236,15 @@ def _search_service_settings_from_payload(for source_id, raw in payload.items():# Removed Sources have no settings. Keep an extant but retargeted/retired Source's choices:# forgetting an opt-out would silently re-enrol it if its search capability returns later.- if live is not None and source_id not in live:+ if live is not None and source_id not in live and not is_keyless_exa_source_id(source_id):continue- service = model_hub_search_service(live[source_id]) if live is not None else None+ service = (+ model_hub_search_service(live[source_id])+ if live is not None and source_id in live+ else model_hub_search_service(model_hub_keyless_exa_source())+ if is_keyless_exa_source_id(source_id)+ else None+ )saved = ModelHubSearchServiceSettings.from_payload(raw)# Only the in-memory parse is normalized. V2Config.load never writes it back; an authorized# writer later serializes these clamped overrides without freezing any absent default.@@ -3208,7 +3260,7 @@ def _executor_order_kinds_from_payload(if isinstance(payload, dict):live = {source.id for source in sources} if sources is not None else Nonenamed = {key: value for key, value in payload.items()- if key in (order or ()) and (live is None or key in live)}+ if key in (order or ()) and (live is None or key in live or is_keyless_exa_source_id(key))}if all(isinstance(value, str) and value in {"service", "model"} for value in named.values()):return namedlogger.warning("Config 'model_hub.hosted_tools.web_search.executor_order_kinds': ignoring damaged role map")diff --git a/core/agent_core/messages.py b/core/agent_core/messages.pyindex fb721c6e1..78198cea2 100644--- a/core/agent_core/messages.py+++ b/core/agent_core/messages.py@@ -79,6 +79,7 @@ HOSTED_ERROR_CODES: tuple[str, ...] = ("service_balance","service_limit","service_unavailable",+ "service_rate_limited","service_refused","service_unreadable","search_query_too_long",diff --git a/core/handlers/model_hub/adapter.py b/core/handlers/model_hub/adapter.pyindex 0919aab72..142575d31 100644--- a/core/handlers/model_hub/adapter.py+++ b/core/handlers/model_hub/adapter.py@@ -1,4 +1,4 @@-"""Model Hub EngineAdapter interface. FINAL CONTRACT v20 (2026-10-21).+"""Model Hub EngineAdapter interface. FINAL CONTRACT v21 (2026-10-21).This file is the canonical adapter boundary and must remain byte-identical to``core/handlers/model_hub/adapter.py``. The adapter owns one-Source operations:diff --git a/core/handlers/model_hub/hosted_tools.py b/core/handlers/model_hub/hosted_tools.pyindex e6f0d321d..2a561b030 100644--- a/core/handlers/model_hub/hosted_tools.py+++ b/core/handlers/model_hub/hosted_tools.py@@ -26,6 +26,8 @@ from pathlib import Pathfrom typing import Any, Callable, Final, Literal, Mapping, Optionalfrom config.v2_config import (+ KEYLESS_EXA_ACTIVE,+ KEYLESS_EXA_SOURCE_ID,MODEL_HUB_HOSTED_TOOLS,MODEL_HUB_SEARCH_TOOLS,ModelHubConfig,@@ -37,6 +39,7 @@ from config.v2_config import (is_model_hub_model_id,is_model_hub_source_id,model_hub_executor_order,+ model_hub_keyless_exa_source,model_hub_search_service,)from vibe.backend_model_catalog import (@@ -263,6 +266,8 @@ def _search_chain(remaining = dict(models)disabled: list[ExecutorCandidate] = []ordered = _vibey_order(config)+ if KEYLESS_EXA_ACTIVE:+ ordered.append(model_hub_keyless_exa_source())by_id = {source.id: source for source in ordered}first = [by_id[sid] for sid in (setting.service_order or ()) if sid in by_id and by_id[sid].protocol == "search"]sources = first + [s for s in ordered if s.protocol == "search" and s not in first]@@ -584,27 +589,32 @@ def _service_candidate_payload(def _service_vendors(config: ModelHubConfig) -> list[dict[str, Any]]:from vibe.model_hub_runtime.api_key_vendors import api_key_vendor_catalog- return [- {+ vendors: list[dict[str, Any]] = []+ for vendor in api_key_vendor_catalog():+ service = vendor.search+ if service is None or (vendor.built_in and not KEYLESS_EXA_ACTIVE):+ continue+ source_ids = [+ source.id for source in config.sources+ if source.vendor == vendor.id and model_hub_search_service(source) is not None+ ]+ if vendor.built_in and KEYLESS_EXA_ACTIVE:+ source_ids.append(KEYLESS_EXA_SOURCE_ID)+ vendors.append({"id": vendor.id,"name": vendor.label,"price": {**service["price"], "extra": [dict(part) for part in service["price"]["extra"]]},- # No free-tier promise has been verified in the bundled catalog. Null is unknown, never zero.- "free_tier": None,+ "free_tier": "Free; IP rate-limited" if vendor.built_in else None,"facts": {"tool_only": service["tool_only"],"auto_enroll": bool(service.get("auto_enroll")),"free_check": service["free_check"] is not None,+ **({"built_in": True, "requires_setup": False} if vendor.built_in else {}),},"results_max": service["limits"]["results_max"],- "source_ids": [- source.id for source in config.sources- if source.vendor == vendor.id and model_hub_search_service(source) is not None- ],- }- for vendor in api_key_vendor_catalog()- if (service := vendor.search) is not None- ]+ "source_ids": source_ids,+ })+ return vendorsdef _price_payload(price: Any) -> dict[str, Any] | None:@@ -637,6 +647,7 @@ def _status("""The status lines' data: the latest success, the current refusals, and the per-pair successes."""live = {source.id: source for source in config.sources}+ live[KEYLESS_EXA_SOURCE_ID] = model_hub_keyless_exa_source()refused: list[dict[str, Any]] = []successes: list[tuple[datetime, str, str, Optional[str]]] = []for record in evidence.store.records():@@ -720,9 +731,18 @@ def hosted_tools_status(entry["services"] = {source_id: saved.clamped(service).to_payload()for source_id, saved in setting.services.items()- if source_id in sources and (service := model_hub_search_service(sources[source_id])) is not None+ if (+ source_id in sources+ and (service := model_hub_search_service(sources[source_id])) is not None+ ) or (+ source_id == KEYLESS_EXA_SOURCE_ID+ and (service := model_hub_search_service(model_hub_keyless_exa_source())) is not None+ )}- entry["service_order"] = [source_id for source_id in (setting.service_order or ()) if source_id in sources]+ entry["service_order"] = [+ source_id for source_id in (setting.service_order or ())+ if source_id in sources or source_id == KEYLESS_EXA_SOURCE_ID+ ]if SEARCH_SERVICES_ACTIVE:entry["service_vendors"] = _service_vendors(config)else:@@ -803,6 +823,7 @@ def apply_hosted_tool_put(config: ModelHubConfig, tool: str, payload: object) ->setting = replace(hosted_tool_setting(config, tool), **changes)if tool == "web_search" and "executor_order" in payload:live = {source.id: source for source in config.sources}+ live[KEYLESS_EXA_SOURCE_ID] = model_hub_keyless_exa_source()setting = replace(setting, executor_order_kinds=({source_id: search_executor_kind(live[source_id], setting)for source_id in setting.executor_order if source_id in live}@@ -822,7 +843,7 @@ def _patch_search_services(config: ModelHubConfig, payload: object) -> dict[str,if patch is None:saved.pop(source_id, None)continue- source = live.get(source_id)+ source = live.get(source_id) or (model_hub_keyless_exa_source() if source_id == KEYLESS_EXA_SOURCE_ID else None)service = model_hub_search_service(source) if source is not None else Noneif service is None or not isinstance(patch, dict) or set(patch) - {"results", "enabled"}:raise ValueError("services must name a search-capable Source and known fields")diff --git a/core/handlers/model_hub/provenance.py b/core/handlers/model_hub/provenance.pyindex 770fa9ed8..81a9e03b9 100644--- a/core/handlers/model_hub/provenance.py+++ b/core/handlers/model_hub/provenance.py@@ -2759,7 +2759,7 @@ class TurnCorrelationRegistry:self.store.put({- "contract_version": 20,+ "contract_version": 21,"turn_id": normalized_turn_id,"ts": ts or _utc_now_iso(),"agent": trace.agent,diff --git a/core/handlers/model_hub/search_chain.py b/core/handlers/model_hub/search_chain.pyindex 9f90380ab..eb0d7dbc0 100644--- a/core/handlers/model_hub/search_chain.py+++ b/core/handlers/model_hub/search_chain.py@@ -11,7 +11,13 @@ import asynciofrom dataclasses import replacefrom typing import TYPE_CHECKING, Any, Callable-from config.v2_config import ModelHubSourceStateConfig, model_hub_search_service+from config.v2_config import (+ KEYLESS_EXA_ACTIVE,+ KEYLESS_EXA_SOURCE_ID,+ ModelHubSourceStateConfig,+ model_hub_keyless_exa_source,+ model_hub_search_service,+)from .adapter import SearchResponsefrom .async_owner import await_owned_task@@ -57,7 +63,11 @@ class SearchChain:advances any fence. Runs on a worker over the final-admission snapshot."""owner = self.owner- source = next((s for s in config.sources if s.id == slot.source_id), None)+ source = (+ model_hub_keyless_exa_source()+ if slot.source_id == KEYLESS_EXA_SOURCE_ID and KEYLESS_EXA_ACTIVE+ else next((s for s in config.sources if s.id == slot.source_id), None)+ )fact = {"source_id": slot.source_id, "label": slot.label or slot.source_id, "kind": slot.kind, "outcome": "skipped"}unavailable = source is None or identity_digest(source) != slot.identityservice = None@@ -65,7 +75,9 @@ class SearchChain:fact["label"] = source.display_name[:64]if slot.kind == "service":service = model_hub_search_service(source)- unavailable = service is None or service["service_id"] != slot.model_id or not source.credential_ref+ unavailable = service is None or service["service_id"] != slot.model_id or (+ not slot.source_id == KEYLESS_EXA_SOURCE_ID and not source.credential_ref+ )else:unavailable = owner._admitted_executor(slot, self.call.tool) is Noneif unavailable:diff --git a/core/handlers/model_hub/search_services.py b/core/handlers/model_hub/search_services.pyindex a41750c8f..81b8f29d5 100644--- a/core/handlers/model_hub/search_services.py+++ b/core/handlers/model_hub/search_services.py@@ -14,7 +14,12 @@ from datetime import datetime, timedeltafrom typing import Any, Callable, Mappingfrom urllib.parse import urlsplit-from config.v2_config import ModelHubConfig, ModelHubSourceConfig+from config.v2_config import (+ KEYLESS_EXA_SOURCE_ID,+ ModelHubConfig,+ ModelHubSourceConfig,+ model_hub_keyless_exa_source,+)from core.agent_core.messages import HostedCostfrom .adapter import SearchResponse@@ -207,6 +212,7 @@ class ServiceCooldowns:def reconcile(self, config: ModelHubConfig) -> None:live = {source.id: source_identity(source) for source in config.sources}+ live[KEYLESS_EXA_SOURCE_ID] = source_identity(model_hub_keyless_exa_source())self._states = {key: state for key, state in self._states.items() if live.get(key[0]) == state.identity}def advance(self, source: ModelHubSourceConfig, service_id: str, *, clear: bool = False) -> int:diff --git a/core/handlers/model_hub/service.py b/core/handlers/model_hub/service.pyindex be4ffadf7..55023efee 100644--- a/core/handlers/model_hub/service.py+++ b/core/handlers/model_hub/service.py@@ -22,6 +22,8 @@ from config import pathsfrom modules.agents.catalog import NATIVE_CLI_BACKENDSfrom config.v2_config import (CONFIG_LOCK,+ KEYLESS_EXA_DISPLAY_NAME,+ KEYLESS_EXA_SOURCE_ID,MODEL_HUB_BACKENDS,ModelHubAgentSupplyConfig,ModelHubBackendModelConfig,@@ -42,6 +44,7 @@ from config.v2_config import (normalize_storable_backend_model_text,normalize_model_hub_base_url,normalize_model_hub_vendor_id,+ model_hub_keyless_exa_source,model_hub_search_service,normalized_model_hub_override,validate_model_hub_protocol_vendor,@@ -265,7 +268,7 @@ from .usage import (local_usage_day,)-CONTRACT_VERSION = 20+CONTRACT_VERSION = 21def seeded_source_name(vendor: str) -> str:@@ -388,8 +391,8 @@ def _described_as_unfit_for_agent_turns(match: Mapping[str, Any]) -> bool:)-AGENT_CHAIN_CONTRACT_VERSION = 20-PROBE_RESULT_CONTRACT_VERSION = 20+AGENT_CHAIN_CONTRACT_VERSION = 21+PROBE_RESULT_CONTRACT_VERSION = 21_SOURCE_DISCOVERY_TIMEOUT_SECONDS = 15_SOURCE_PROBE_TIMEOUT_SECONDS = 60# Background inventory refresh. The first tick doubles as the startup delay, so@@ -1393,7 +1396,7 @@ def _runtime_payload(status: EngineStatus, *, enabled: bool) -> dict:manager = EngineRuntimeManager()return {- "contract_version": 20,+ "contract_version": 21,"enabled": enabled,"host_platform": status.host_platform or manager.host_platform(),"manifest": manager.contract_manifest(),@@ -1648,6 +1651,12 @@ class ModelHubService:raise ModelHubError("source_not_found", status=404)return source+ @staticmethod+ def _evidence_sources(config: ModelHubConfig) -> list[ModelHubSourceConfig]:+ """Config Sources plus the stable synthetic identity for evidence joins."""++ return [*config.sources, model_hub_keyless_exa_source()]+@staticmethoddef _agent(config: ModelHubConfig, backend: str) -> ModelHubAgentSupplyConfig:agent = config.agents.get(backend)@@ -7006,7 +7015,7 @@ class ModelHubService:"""Clear under the Source mutation lock, so the identities it keeps are the ones the config holds."""try:- await asyncio.to_thread(self.capability_evidence.clear, matches, live=lambda: config.sources)+ await asyncio.to_thread(self.capability_evidence.clear, matches, live=lambda: self._evidence_sources(config))except OSError:logger.warning("Model Hub could not persist an evidence clear; nothing changed", exc_info=True)raise ModelHubError("state_write_failed", status=500) from None@@ -7038,7 +7047,7 @@ class ModelHubService:await asyncio.to_thread(self.capability_evidence.write_refusals,records,- live=lambda: self.store.load().sources,+ live=lambda: self._evidence_sources(self.store.load()),wire_for=evidence.wire_for,)@@ -7058,7 +7067,7 @@ class ModelHubService:mode=mode, # type: ignore[arg-type])await asyncio.to_thread(- self.capability_evidence.note_success, record, live=lambda: self.store.load().sources, now=record.observed_at,+ self.capability_evidence.note_success, record, live=lambda: self._evidence_sources(self.store.load()), now=record.observed_at,)def _effort_refused(self, source: ModelHubSourceConfig, model_id: str, request: Any) -> bool:@@ -7167,7 +7176,7 @@ class ModelHubService:source_identity=identity_digest(source),detail=learned.detail,),- live=lambda: self.store.load().sources,+ live=lambda: self._evidence_sources(self.store.load()),wire_for=evidence.wire_for,)return learned@@ -7246,19 +7255,30 @@ class ModelHubService:return executor_candidate(source, slot.model_id, tool, evidence=self.hosted_evidence(), spec_for=hosted_tool_spec)def _search_visible_cooldown(self, source_id: str, service_id: str) -> str | None:- config = self.store.load()- source = next((item for item in config.sources if item.id == source_id), None)+ source = (+ model_hub_keyless_exa_source()+ if source_id == KEYLESS_EXA_SOURCE_ID+ else next((item for item in self.store.load().sources if item.id == source_id), None)+ )if source is None:return Noneuntil = self._service_cooldowns.until(source, service_id, self.now())- return utc_text(until) if until is not None and (until - self.now()).total_seconds() > 60 else None+ if until is None:+ return None+ # Keyless Exa's UI must expose even a short active cooldown so Retry now+ # remains available for provider rate limits.+ return utc_text(until) if source_id == KEYLESS_EXA_SOURCE_ID or (until - self.now()).total_seconds() > 60 else Noneasync def clear_service_cooldown(self, source_id: str, service_id: str | None = None, payload: object = None) -> dict:if payload not in (None, {}):raise ModelHubError("invalid_parameter", status=400)async with self._mutation_lock:config = await asyncio.to_thread(self.store.load)- source = self._source(config, source_id)+ source = (+ model_hub_keyless_exa_source()+ if source_id == KEYLESS_EXA_SOURCE_ID+ else self._source(config, source_id)+ )service = model_hub_search_service(source)if service is None or (service_id is not None and service["service_id"] != service_id):raise ModelHubError("source_not_found", status=404)@@ -8636,6 +8656,11 @@ class ModelHubService:)for source in config.sources]+ identities.append(SourceIdentity(+ source_id=KEYLESS_EXA_SOURCE_ID,+ label=KEYLESS_EXA_DISPLAY_NAME,+ model_ids=[],+ ))# The release's search services label and value service rows, as the price# table values model tokens; a row a later catalog dropped stays unpriced.service_catalog = [diff --git a/core/hosted_activity.py b/core/hosted_activity.pyindex b84b8202a..1330d4292 100644--- a/core/hosted_activity.py+++ b/core/hosted_activity.py@@ -70,6 +70,7 @@ _FAILURE_REASONS = ("service_balance","service_limit","service_unavailable",+ "service_rate_limited","service_refused","service_unreadable",)diff --git a/docs/plans/model-hub-contracts/README.md b/docs/plans/model-hub-contracts/README.mdindex 6ae9c3cae..003755c8e 100644--- a/docs/plans/model-hub-contracts/README.md+++ b/docs/plans/model-hub-contracts/README.md@@ -1,7 +1,18 @@# Model Hub contracts-Status: **contract_version 20**, 2026-10-22: active web-search services (S2b-2).-`gh-v3.2.3rc1` and `gh-v3.2.3rc2` carry v19, so activation opens v20 rather than+Status: **contract_version 21**, 2026-10-24: keyless Exa readers (KEX-1).+`gh-v3.2.3rc3` through `rc6` carry v20, so this dormant reader event opens v21.+The versioned mirrors advance together; persisted TurnProvenance retains v5–v20 and adds v21.+KEX-1 adds only optional built-in catalog/read metadata, the synthetic `src_exakeyless`+Source identity (`exa-mcp` / `exa/mcp`), keyless cooldown retry classification, and+compatibility-safe readers. `KEYLESS_EXA_ACTIVE = false`; no producer or live Exa call+ships in this event. A later activation may populate the shape, and an older release+must ignore the additive fields while retaining ordinary service settings and orders.+The localized hosted-activity vocabulary adds `service_rate_limited` as a fallback+reason; it never creates a credential health blocker for the synthetic Source.++It builds on v20 (2026-10-22): active web-search services (S2b-2).+`gh-v3.2.3rc1` and `gh-v3.2.3rc2` carried v19, so activation opened v20 rather thanchanging the released event. `SEARCH_SERVICES_ACTIVE = True` activates service candidates,`service_vendors`, frozen turn settings and the mixed search chain together with S6 disclosure.The versioned mirrors advance together; persisted TurnProvenance retains v5–v19 and adds v20.@@ -345,7 +356,7 @@ comparison. A gate may not report success by comparing stale input with itself.## Version closure-`contract_version` 20 must coexist in all registered version locations on the same tested head:+`contract_version` 21 must coexist in all registered version locations on the same tested head:- `mirror-registry.json`- `agent-chain.schema.json`diff --git a/docs/plans/model-hub-contracts/adapter-interface.py b/docs/plans/model-hub-contracts/adapter-interface.pyindex 0919aab72..142575d31 100644--- a/docs/plans/model-hub-contracts/adapter-interface.py+++ b/docs/plans/model-hub-contracts/adapter-interface.py@@ -1,4 +1,4 @@-"""Model Hub EngineAdapter interface. FINAL CONTRACT v20 (2026-10-21).+"""Model Hub EngineAdapter interface. FINAL CONTRACT v21 (2026-10-21).This file is the canonical adapter boundary and must remain byte-identical to``core/handlers/model_hub/adapter.py``. The adapter owns one-Source operations:diff --git a/docs/plans/model-hub-contracts/agent-chain.schema.json b/docs/plans/model-hub-contracts/agent-chain.schema.jsonindex adf8f4680..92ae038c7 100644--- a/docs/plans/model-hub-contracts/agent-chain.schema.json+++ b/docs/plans/model-hub-contracts/agent-chain.schema.json@@ -7,7 +7,7 @@"required": ["contract_version", "backend", "model_id", "manual_override", "route_origin", "chain", "current", "supply_state"],"additionalProperties": false,"properties": {- "contract_version": { "const": 20 },+ "contract_version": { "const": 21 },"backend": { "enum": ["claude", "codex", "opencode", "vibey"] },"model_id": { "type": "string" },"manual_override": {@@ -255,7 +255,7 @@],"examples": [{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","model_id": "unlisted-model","manual_override": null,@@ -265,7 +265,7 @@"supply_state": "ok"},{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -275,7 +275,7 @@"supply_state": "ok"},{- "contract_version": 20,+ "contract_version": 21,"backend": "claude","model_id": "claude-opus-4-6","manual_override": null,@@ -285,7 +285,7 @@"supply_state": "waiting"},{- "contract_version": 20,+ "contract_version": 21,"backend": "opencode","model_id": "glm-5.2","manual_override": { "hops": [{ "source_id": "src_relay9c1x", "model_id": "glm-5.2" }] },@@ -295,7 +295,7 @@"supply_state": "waiting"},{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -305,7 +305,7 @@"supply_state": "interrupted"},{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -315,7 +315,7 @@"supply_state": "interrupted"},{- "contract_version": 20,+ "contract_version": 21,"backend": "claude","model_id": "claude-haiku-4-5","manual_override": null,diff --git a/docs/plans/model-hub-contracts/api-response.schema.json b/docs/plans/model-hub-contracts/api-response.schema.jsonindex e85f90252..d24eb7493 100644--- a/docs/plans/model-hub-contracts/api-response.schema.json+++ b/docs/plans/model-hub-contracts/api-response.schema.json@@ -62,7 +62,7 @@"required": ["ok", "contract_version", "probe"],"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"probe": {"$ref": "model-hub/source-probe-result.schema.json"}}},@@ -161,7 +161,7 @@"SuccessCore": {"properties": {"ok": {"const": true},- "contract_version": {"const": 20}+ "contract_version": {"const": 21}}},"SourceListResponse": {@@ -170,7 +170,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"sources": {"type": "array", "items": {"$ref": "#/definitions/SourceApi"}}}},@@ -180,7 +180,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"observation": {"$ref": "model-hub/observation-result.schema.json"}}},@@ -190,7 +190,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"source": {"$ref": "#/definitions/SourceApi"},"added_to": {"type": "array", "items": {"$ref": "#/definitions/AddedTo"}},"adopted_by": {"type": "array", "items": {"$ref": "#/definitions/AdoptedBy"}, "uniqueItems": true}@@ -202,7 +202,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"source": {"$ref": "#/definitions/SourceApi"}}},@@ -212,7 +212,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"source": {"$ref": "#/definitions/SourceApi"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}@@ -224,7 +224,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"source": {"allOf": [{"$ref": "#/definitions/SourceApi"},@@ -242,7 +242,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}}@@ -253,7 +253,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"agents": {"type": "array", "items": {"$ref": "#/definitions/AgentSupplyApi"}}}},@@ -263,7 +263,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"agent": {"$ref": "#/definitions/AgentSupplyApi"}}},@@ -280,7 +280,7 @@],"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"agent": {"$ref": "#/definitions/AgentSupplyApi"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}, "uniqueItems": true},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}, "uniqueItems": true}@@ -305,7 +305,7 @@"additionalProperties": false,"properties": {"ok": {"const": false},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"error": {"const": "candidate_suppliers_changed"},"detail": {"type": "string", "minLength": 1},"changed": {@@ -325,7 +325,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"agent": {"type": "object","required": ["backend", "mode", "catalog_models"],@@ -426,7 +426,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"candidates": {"type": "object","required": ["builtin", "providers", "in_list"],@@ -445,7 +445,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"matches": {"type": "array","maxItems": 8,@@ -479,7 +479,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"chain": {"$ref": "model-hub/agent-chain.schema.json"}}},@@ -489,7 +489,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"chains": {"type": "array", "items": {"$ref": "model-hub/agent-chain.schema.json"}}}},@@ -499,7 +499,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"chain": {"$ref": "model-hub/agent-chain.schema.json"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}@@ -511,7 +511,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"probe": {"$ref": "model-hub/probe-result.schema.json"}}},@@ -521,7 +521,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"events": {"type": "array", "items": {"$ref": "model-hub/resolution-event.schema.json"}}}},@@ -531,7 +531,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"usage": {"$ref": "model-hub/usage-summary.schema.json"}}},@@ -541,7 +541,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"quota": {"$ref": "model-hub/quota-summary.schema.json"}}},@@ -551,7 +551,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"hosted_tools": {"$ref": "model-hub/hosted-tools-status.schema.json"}}},@@ -561,7 +561,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -583,7 +583,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -606,7 +606,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -631,7 +631,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20}+ "contract_version": {"const": 21}}},"RuntimeApi": {@@ -653,7 +653,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"scan": {"$ref": "model-hub/migration-scan.schema.json"}}},@@ -663,7 +663,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"applied": {"type": "integer", "minimum": 0},"sources": {"type": "array", "items": {"$ref": "#/definitions/SourceApi"}},"added_to": {"type": "array", "items": {"$ref": "#/definitions/AddedTo"}}@@ -675,7 +675,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"provenance": {"$ref": "model-hub/turn-provenance.schema.json"}}},@@ -686,7 +686,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"provenance": {"anyOf": [{"$ref": "model-hub/turn-provenance.schema.json"},@@ -701,7 +701,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 20},+ "contract_version": {"const": 21},"runtime": {"$ref": "#/definitions/RuntimeApi"}}}diff --git a/docs/plans/model-hub-contracts/api.md b/docs/plans/model-hub-contracts/api.mdindex cf882fc11..967d0d24b 100644--- a/docs/plans/model-hub-contracts/api.md+++ b/docs/plans/model-hub-contracts/api.md@@ -8,11 +8,11 @@ credential redaction and supply-impact confirmation rules still apply; unknownAPI siblings retain the Owner default.-Status: **Normative, `contract_version` 20** — Model Hub implementations must conform, and the response conformance guard enumerates this route table and validates one real server response for every route.+Status: **Normative, `contract_version` 21** — Model Hub implementations must conform, and the response conformance guard enumerates this route table and validates one real server response for every route.-Success envelope: `{ok: true, contract_version: 20, ...}`.+Success envelope: `{ok: true, contract_version: 21, ...}`.Failure envelope:-`{ok: false, contract_version: 20, error: <machine_code>, detail?: <i18n_key>}`.+`{ok: false, contract_version: 21, error: <machine_code>, detail?: <i18n_key>}`.`detail` is always a string. Structured error data lives in a named sibling.Guarded mutation refusals specialize that envelope through`guard-refusal.schema.json`; both report arrays are required and together form the plan@@ -24,7 +24,7 @@ table. The contract guard requires the two endpoint sets to be identical, requirexercised HTTP response for every registry entry, and validates that response againstthe route's named schema.-The shared envelope and every versioned nested contract carry `contract_version` 20, the+The shared envelope and every versioned nested contract carry `contract_version` 21, theterminal value. Supported persisted config shapes and historical TurnProvenanceremain readable; ephemeral envelopes use only the terminal version.@@ -84,7 +84,7 @@ runtime open. Once models are configured it participates in the runtime Stop gua| POST `/api/models/migration/scan` | → `{scan: MigrationScan}` | Read-only. || POST `/api/models/migration/apply` | `{item_ids: string[], clean_api_keys?: boolean}` → `{applied, sources, added_to}` | Applies one grouped, server-owned custody transaction. It checks saved configuration and custody locally, copies API keys without upstream validation, upgrades an existing native subscription Source in place when present, and commits Source/Routes/backend mode atomically. API-key originals are kept unless cleanup was selected. Pre-exposure failure is reversible; post-exposure recovery is forward-only and keeps the backend blocked until terminalized. || GET `/api/models/turns/<turn_id>/provenance` | → `{provenance: TurnProvenance}` or documented absence error | Debug read for exactly attributed Hub turns. |-| GET `/api/models/runtime/status` | → `{runtime: RuntimeDependency}` | Read-only managed engine status. The nested object carries `contract_version` 20 and persisted user intent in `enabled`; `not_started` is installed lazy-start idleness, not an alarm. |+| GET `/api/models/runtime/status` | → `{runtime: RuntimeDependency}` | Read-only managed engine status. The nested object carries `contract_version` 21 and persisted user intent in `enabled`; `not_started` is installed lazy-start idleness, not an alarm. || POST `/api/models/runtime/install` | → `{runtime: RuntimeDependency}` | Idempotently starts server-owned installation. It returns and persists `installing`; reload reads the same state. Uses the existing mutation authentication and CSRF guards. || POST `/api/models/runtime/start` | → `{runtime: RuntimeDependency}` | Persists `enabled: true` and explicitly starts the managed engine. Service startup restores this intent; runtime availability has no separate enable-confirmation step. Uses the existing mutation authentication and CSRF guards; status reads never start it. || POST `/api/models/runtime/stop` | → `{runtime: RuntimeDependency}` | Explicitly stops the managed engine, persists `enabled: false`, and returns it to `not_started`. The mutation is rejected with `runtime_in_use` while any native backend is configured for Hub mode or Avibe has catalog models, so disabling the shared runtime cannot strand a configured route. An empty Avibe catalog does not keep the runtime open. |@@ -116,13 +116,24 @@ The service variant is defined in `hosted-tools-status.schema.json`:`settings` holds effective `{results, enabled}`;`state` is the Source's health, `trial_pending` covers both armed and in-flightone-shot trials, and `cooldown_until` is non-null only while a service cooldown has more than 60 seconds-remaining. Retry advances that cooldown's independent generation, so an older in-flight failure cannot restore it;+remaining, except the built-in keyless row, whose active short cooldown is exposed so+its Retry now control remains usable. Retry advances that cooldown's independent generation, so an older in-flight failure cannot restore it;it neither clears a Source blocker nor sends a request.`service_vendors` contains `{id, name, price, free_tier, facts, results_max,-source_ids}`. Facts are the catalog's-`{tool_only, auto_enroll, free_check}` booleans. A free tier not verified in the+source_ids}`. Facts are the catalog's `{tool_only, auto_enroll, free_check}` booleans,+with optional `built_in` and `requires_setup` for a catalog-provided row. A free tier not verified in thecatalog reads as null, never a promise of zero cost. `source_ids` includes-opted-out search-capable Sources, but not relays or subscriptions.+opted-out search-capable Sources, and a built-in vendor includes its synthetic Source;+relays and subscriptions are excluded.++KEX-1 adds the dormant built-in `exa-mcp` catalog row (`service_id: "exa/mcp"`) and+synthetic Source id `src_exakeyless`. It has no credential row, `auth: "none"`, exact+zero list price, `free_tier: "Free; IP rate-limited"`, and `facts.built_in: true` /+`requires_setup: false`; it is never addable or removable. Its saved partial settings,+role-map entry and deliberate `executor_order` placement are read and serialized by+Source id, while a release that does not know the id safely skips it. The synthetic+identity is also used for status/evidence, usage labels, activity and retry cooldowns;+no config migration is performed. The KEX-1 build keeps `KEYLESS_EXA_ACTIVE = false`.PUT accepts `prefer_native` and `services` only for `web_search`. `prefer_native`is a boolean, not nullable. `services` is a Source-keyed patch: an absent Source@@ -721,7 +732,7 @@ The terminal result of both ordinary API-key creation and OAuth creation is:```json{"ok": true,- "contract_version": 20,+ "contract_version": 21,"source": {"id": "src_anthkey01","kind": "api_key",@@ -831,7 +842,7 @@ Every guarded Source/inventory mutation uses the §4.5 envelope matrix and the c```json{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "source_last_supplier","would_remove_hops": [],"would_interrupt": [@@ -970,7 +981,7 @@ API-key success:```json{"ok": true,- "contract_version": 20,+ "contract_version": 21,"source": {"id": "src_relay9c1x","kind": "api_key",@@ -1065,7 +1076,7 @@ Status and submit return the same terminal shape:```json{"ok": true,- "contract_version": 20,+ "contract_version": 21,"flow": {"flow_id": "oaf_claude01","client_nonce": "ofn_01j5w8z7p4n6q2rt",@@ -1138,9 +1149,9 @@ a valid `interrupted` chain.```json{"ok": true,- "contract_version": 20,+ "contract_version": 21,"chain": {- "contract_version": 20,+ "contract_version": 21,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -1167,7 +1178,7 @@ In Direct mode both chain and probe refuse with:```json{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "direct_mode","detail": "models.hub.direct_mode"}@@ -1181,9 +1192,9 @@ A successful probe nests its result:```json{"ok": true,- "contract_version": 20,+ "contract_version": 21,"probe": {- "contract_version": 20,+ "contract_version": 21,"backend": "claude","channel": "hub","reachable": false,@@ -1206,7 +1217,7 @@ not-ready carries the closed i18n key `models.probe.native_cli_unavailable`.```json{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","channel": "native_cli","reachable": true,@@ -1219,7 +1230,7 @@ not-ready carries the closed i18n key `models.probe.native_cli_unavailable`.```json{- "contract_version": 20,+ "contract_version": 21,"backend": "codex","channel": "native_cli","reachable": false,@@ -1235,7 +1246,7 @@ No candidate is an API error with a typed model-scoped state:```json{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "probe_no_candidate","detail": "models.probe.no_candidate.waiting","supply": {@@ -1426,7 +1437,7 @@ The store retains at most 500 exactly attributed settled turns with its existingwrites. Ambiguous attribution remains excluded; this is not a log of every upstreamrequest. Null means no matching retained record, including eviction. A newer served,canceled or other record without a terminal error supersedes older error display.-Success uses exactly `{ok: true, contract_version: 20, provenance: TurnProvenance | null}`;+Success uses exactly `{ok: true, contract_version: 21, provenance: TurnProvenance | null}`;there is no `success` field or envelope exception.Local `engine_down` records may also contain `local_error_detail`, an OS-generated@@ -1530,7 +1541,7 @@ ambiguous absence are explicit and distinguishable from an unknown turn:```json{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "provenance_unavailable","detail": "models.provenance.direct_mode"}@@ -1539,7 +1550,7 @@ ambiguous absence are explicit and distinguishable from an unknown turn:```json{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "provenance_unavailable","detail": "models.provenance.attribution_ambiguous"}diff --git a/docs/plans/model-hub-contracts/guard-refusal.schema.json b/docs/plans/model-hub-contracts/guard-refusal.schema.jsonindex faca6db29..d80ba256e 100644--- a/docs/plans/model-hub-contracts/guard-refusal.schema.json+++ b/docs/plans/model-hub-contracts/guard-refusal.schema.json@@ -61,7 +61,7 @@],"properties": {"ok": { "const": false },- "contract_version": { "const": 20 },+ "contract_version": { "const": 21 },"error": {"enum": ["source_last_supplier",@@ -116,7 +116,7 @@"examples": [{"ok": false,- "contract_version": 20,+ "contract_version": 21,"error": "source_model_in_route_chain","detail": "modelHub.errors.source_model_in_route_chain","would_remove_hops": [diff --git a/docs/plans/model-hub-contracts/hosted-tools-status.schema.json b/docs/plans/model-hub-contracts/hosted-tools-status.schema.jsonindex e6abcb36c..fd3797f94 100644--- a/docs/plans/model-hub-contracts/hosted-tools-status.schema.json+++ b/docs/plans/model-hub-contracts/hosted-tools-status.schema.json@@ -154,7 +154,7 @@"id": { "type": "string", "minLength": 1 },"name": { "type": "string", "minLength": 1 },"price": { "$ref": "#/definitions/ServiceListPrice" },- "free_tier": { "type": ["string", "null"], "description": "Catalog-verified free-tier description, null when unknown (not a claim of no free tier). Currently null for every vendor." },+ "free_tier": { "type": ["string", "null"], "description": "Catalog-verified free-tier description, null when unknown (not a claim of no free tier). The built-in keyless Exa row may state its free IP-rate-limited access." },"facts": {"type": "object","additionalProperties": false,@@ -162,11 +162,12 @@"properties": {"tool_only": { "type": "boolean" },"auto_enroll": { "type": "boolean" },- "free_check": { "type": "boolean" }- }+ "free_check": { "type": "boolean" },+ "built_in": { "type": "boolean", "description": "True for a catalog-provided Source that needs no setup and is not addable." },+ "requires_setup": { "type": "boolean" } }},"results_max": { "type": "integer", "minimum": 1, "maximum": 100 },- "source_ids": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/definitions/SourceId" }, "description": "All current search-capable Sources for this vendor, including opted-out Sources. Empty means not added." }+ "source_ids": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/definitions/SourceId" }, "description": "All current search-capable Sources for this vendor, including opted-out Sources. A built-in vendor contains its synthetic Source id; empty means not added for ordinary vendors." }}},"SearchTool": {diff --git a/docs/plans/model-hub-contracts/mirror-registry.json b/docs/plans/model-hub-contracts/mirror-registry.jsonindex 9f58e4f9a..756e90cc7 100644--- a/docs/plans/model-hub-contracts/mirror-registry.json+++ b/docs/plans/model-hub-contracts/mirror-registry.json@@ -1,5 +1,5 @@{- "contract_version": 20,+ "contract_version": 21,"input_generation": {"mode": "same_run_live_files","external_snapshot": "content_fingerprint_required"diff --git a/docs/plans/model-hub-contracts/observation-result.schema.json b/docs/plans/model-hub-contracts/observation-result.schema.jsonindex 458aff8cf..80d325c96 100644--- a/docs/plans/model-hub-contracts/observation-result.schema.json+++ b/docs/plans/model-hub-contracts/observation-result.schema.json@@ -16,7 +16,7 @@],"additionalProperties": false,"properties": {- "contract_version": { "const": 20 },+ "contract_version": { "const": 21 },"outcome": {"enum": ["observed",@@ -150,7 +150,7 @@],"examples": [{- "contract_version": 20,+ "contract_version": 21,"outcome": "observed","reachable": true,"authenticated": "authenticated",@@ -165,7 +165,7 @@]},{- "contract_version": 20,+ "contract_version": 21,"outcome": "authentication_failed","reachable": true,"authenticated": "rejected",@@ -175,7 +175,7 @@"model_metadata": []},{- "contract_version": 20,+ "contract_version": 21,"outcome": "ambiguous","reachable": true,"authenticated": "unknown",@@ -185,7 +185,7 @@"model_metadata": []},{- "contract_version": 20,+ "contract_version": 21,"outcome": "unreachable","reachable": false,"authenticated": "unknown",@@ -195,7 +195,7 @@"model_metadata": []},{- "contract_version": 20,+ "contract_version": 21,"outcome": "adapter_error","reachable": null,"authenticated": "unknown",@@ -205,7 +205,7 @@"model_metadata": []},{- "contract_version": 20,+ "contract_version": 21,"outcome": "timeout","reachable": null,"authenticated": "unknown",diff --git a/docs/plans/model-hub-contracts/probe-result.schema.json b/docs/plans/model-hub-contracts/probe-result.schema.jsonindex 0d56dd1cc..2239e1417 100644--- a/docs/plans/model-hub-contracts/probe-result.schema.json+++ b/docs/plans/model-hub-contracts/probe-result.schema.json@@ -7,7 +7,7 @@"required": ["contract_version", "backend", "channel", "reachable", "source_id", "model_id", "latency_ms", "error"],"additionalProperties": false,"properties": {- "contract_version": { "const": 20 },+ "contract_version": { "const": 21 },"backend": { "enum": ["claude", "codex", "opencode", "vibey"] },"channel": { "enum": ["hub", "native_cli"] },"reachable": { "type": "boolean" },@@ -68,10 +68,10 @@}],"examples": [- { "contract_version": 20, "backend": "codex", "channel": "hub", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": 412, "error": null },- { "contract_version": 20, "backend": "claude", "channel": "hub", "reachable": false, "source_id": "src_relay9c1x", "model_id": "glm-5.2", "latency_ms": 287, "error": "models.source.needs_action.balance_exhausted" },- { "contract_version": 20, "backend": "codex", "channel": "hub", "reachable": false, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": "models.source.backoff.connection_failed" },- { "contract_version": 20, "backend": "codex", "channel": "native_cli", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": null },- { "contract_version": 20, "backend": "codex", "channel": "native_cli", "reachable": false, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": "models.probe.native_cli_unavailable" }+ { "contract_version": 21, "backend": "codex", "channel": "hub", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": 412, "error": null },+ { "contract_version": 21, "backend": "claude", "channel": "hub", "reachable": false, "source_id": "src_relay9c1x", "model_id": "glm-5.2", "latency_ms": 287, "error": "models.source.needs_action.balance_exhausted" },+ { "contract_version": 21, "backend": "codex", "channel": "hub", "reachable": false, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": "models.source.backoff.connection_failed" },+ { "contract_version": 21, "backend": "codex", "channel": "native_cli", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": null },+ { "contract_version": 21, "backend": "codex", "channel": "native_cli", "reachable": false, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": "models.probe.native_cli_unavailable" }]}diff --git a/docs/plans/model-hub-contracts/runtime-dependency.schema.json b/docs/plans/model-hub-contracts/runtime-dependency.schema.jsonindex b75389f90..8fe2fd5fa 100644--- a/docs/plans/model-hub-contracts/runtime-dependency.schema.json+++ b/docs/plans/model-hub-contracts/runtime-dependency.schema.json@@ -7,7 +7,7 @@"required": ["contract_version", "manifest", "status"],"additionalProperties": false,"properties": {- "contract_version": { "const": 20 },+ "contract_version": { "const": 21 },"enabled": {"type": "boolean","description": "Persisted user intent for the managed gateway. Fresh/default configuration is true; explicit stop persists false."@@ -131,7 +131,7 @@},"examples": [{- "contract_version": 20,+ "contract_version": 21,"host_platform": "darwin-arm64","manifest": {"name": "cliproxyapi",diff --git a/docs/plans/model-hub-contracts/turn-provenance.schema.json b/docs/plans/model-hub-contracts/turn-provenance.schema.jsonindex 33ffd6648..6d423a9c7 100644--- a/docs/plans/model-hub-contracts/turn-provenance.schema.json+++ b/docs/plans/model-hub-contracts/turn-provenance.schema.json@@ -54,7 +54,7 @@"additionalProperties": false,"properties": {"contract_version": {- "enum": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],+ "enum": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],"$comment": "The only versioned object written to disk, so released versions form a set rather than a constant. Historical records validate after the existing persistence-read normalization of retired reasons; tests/fixtures/model_hub/released_v5_permission_denied.json exercises that boundary, not raw-file validation. Reading preserves the writer generation and requires no new route fields. New records carry the terminal member. Other versioned objects are ephemeral envelopes pinned to that value alone.","description": "Generation that wrote this record. Readers retain every supported released value, apply existing retired-reason normalization independently of version, and do not require route_origin or manual_override."},@@ -527,7 +527,7 @@],"examples": [{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_01k9x2m4","ts": "2026-07-29T06:32:11Z","agent": "claude",@@ -552,7 +552,7 @@"blockers": []},{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_01k9x33p","ts": "2026-07-29T06:41:02Z","agent": "opencode",@@ -573,7 +573,7 @@"blockers": []},{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_01k9x3zq","ts": "2026-07-29T06:48:20Z","agent": "codex",@@ -593,7 +593,7 @@]},{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_01k9x4b7","ts": "2026-07-29T07:02:44Z","agent": "claude",@@ -613,7 +613,7 @@"blockers": []},{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_modelmissing01","ts": "2026-09-05T17:31:10Z","agent": "claude",@@ -635,7 +635,7 @@"blockers": []},{- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_01k9x5ca","ts": "2026-07-29T07:08:00Z","agent": "codex",diff --git a/modules/agents/vibey/agent.py b/modules/agents/vibey/agent.pyindex 66094a84f..dce4b68b0 100644--- a/modules/agents/vibey/agent.py+++ b/modules/agents/vibey/agent.py@@ -1697,14 +1697,15 @@ class VibeyAgent(BaseAgent):return {}, Nonedef read() -> tuple[dict[str, str], dict[str, dict[str, Any]]]:- from config.v2_config import hosted_tool_setting+ from config.v2_config import hosted_tool_setting, model_hub_keyless_exa_sourcefrom core.handlers.model_hub.hosted_tools import search_service_settingshub = runtime.snapshot()web_search = hosted_tool_setting(hub, "web_search")- names = {source.id: source.display_name for source in hub.sources if source.display_name}+ display_sources = [*hub.sources, model_hub_keyless_exa_source()]+ names = {source.id: source.display_name for source in display_sources if source.display_name}states: dict[str, dict[str, Any]] = {}- for source in hub.sources:+ for source in display_sources:state: dict[str, Any] = {"protocol": source.protocol, "vendor": source.vendor}if source.state.status in ("needs_action", "error"):state["needs_action"] = source.state.detail_keydiff --git a/tests/e2e/test_model_hub_runtime.py b/tests/e2e/test_model_hub_runtime.pyindex d25565557..6f9844a45 100644--- a/tests/e2e/test_model_hub_runtime.py+++ b/tests/e2e/test_model_hub_runtime.py@@ -684,7 +684,7 @@ def test_a1_feature_flag_disables_the_complete_models_api(assert response.status == 404, (method, path, body)assert body == {"ok": False,- "contract_version": 20,+ "contract_version": 21,"error": "feature_disabled",}diff --git a/tests/e2e/test_model_hub_sources.py b/tests/e2e/test_model_hub_sources.pyindex 9a28c461c..08a9e13a3 100644--- a/tests/e2e/test_model_hub_sources.py+++ b/tests/e2e/test_model_hub_sources.py@@ -13,7 +13,7 @@ from tests.e2e.drivers.mock_llm_upstream import MockLLMUpstreampytestmark = pytest.mark.e2e_model_hub-CONTRACT_VERSION = 20+CONTRACT_VERSION = 21MENU_MODEL = "claude-sonnet-4-6"SYNTHETIC_API_KEY = "sk-model-hub-e2e-not-real"diff --git a/tests/fixtures/model_hub/keyless_exa_v21.json b/tests/fixtures/model_hub/keyless_exa_v21.jsonnew file mode 100644index 000000000..ace20d68e--- /dev/null+++ b/tests/fixtures/model_hub/keyless_exa_v21.json@@ -0,0 +1,10 @@+{+ "enabled": true,+ "executor_order": ["src_exakeyless", "src_tavily01"],+ "executor_order_kinds": {"src_exakeyless": "service", "src_tavily01": "service"},+ "service_order": ["src_exakeyless", "src_tavily01"],+ "services": {+ "src_exakeyless": {"results": 9, "enabled": false},+ "src_tavily01": {"results": 7, "enabled": false}+ }+}diff --git a/tests/fixtures/model_hub/released_search_v20.json b/tests/fixtures/model_hub/released_search_v20.jsonnew file mode 100644index 000000000..c67d71da5--- /dev/null+++ b/tests/fixtures/model_hub/released_search_v20.json@@ -0,0 +1,7 @@+{+ "enabled": true,+ "executor_order": ["src_tavily01"],+ "services": {+ "src_tavily01": {"results": 7, "enabled": false}+ }+}diff --git a/tests/test_model_hub_api.py b/tests/test_model_hub_api.pyindex e98b89f30..57bcd709f 100644--- a/tests/test_model_hub_api.py+++ b/tests/test_model_hub_api.py@@ -1062,7 +1062,7 @@ def test_runtime_start_is_explicit_and_returns_v4_status(tmp_path):assert adapter.start_calls == 1assert store.config.enabled is Trueassert runtime["enabled"] is True- assert runtime["contract_version"] == 20+ assert runtime["contract_version"] == 21assert runtime["status"]["health"] == "ok"_assert_valid("runtime-dependency.schema.json", runtime)@@ -1369,7 +1369,7 @@ def test_runtime_start_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 20, "status": {"health": "ok"}}+ return {"contract_version": 21, "status": {"health": "ok"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1386,7 +1386,7 @@ def test_runtime_stop_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 20, "status": {"health": "not_started"}}+ return {"contract_version": 21, "status": {"health": "not_started"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1403,7 +1403,7 @@ def test_runtime_install_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 20, "status": {"health": "installing"}}+ return {"contract_version": 21, "status": {"health": "installing"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1421,7 +1421,7 @@ def test_runtime_dependency_ensure_crosses_the_controller_rpc_boundary(monkeypatdef rpc(operation, payload=None):calls.append((operation, payload))return {- "contract_version": 20,+ "contract_version": 21,"changed": True,"status": {"health": "not_started", "verified": True},}@@ -4895,7 +4895,7 @@ def test_agent_models_route_returns_only_picker_catalog_fields(monkeypatch):assert response.status_code == 200assert response.get_json() == {"ok": True,- "contract_version": 20,+ "contract_version": 21,"agent": {"backend": "codex","mode": "hub",@@ -10174,7 +10174,7 @@ def test_runtime_start_route_requires_csrf_before_starting_engine(monkeypatch, tassert accepted.status_code == 200runtime = accepted.get_json()["runtime"]assert adapter.start_calls == 1- assert runtime["contract_version"] == 20+ assert runtime["contract_version"] == 21_assert_valid("runtime-dependency.schema.json", runtime)diff --git a/tests/test_model_hub_config.py b/tests/test_model_hub_config.pyindex b4431d203..be809e02d 100644--- a/tests/test_model_hub_config.py+++ b/tests/test_model_hub_config.py@@ -97,7 +97,7 @@ def test_auto_detect_asks_for_responses_before_chat():def test_unsaved_observation_schema_closes_all_terminal_shapes():schema = _schema("observation-result.schema.json")- assert schema["properties"]["contract_version"]["const"] == 20+ assert schema["properties"]["contract_version"]["const"] == 21assert tuple(schema["properties"]["outcome"]["enum"]) == tuple(member.value for member in ObservationOutcome)@@ -121,7 +121,7 @@ def test_observation_terminal_authority_and_schema_accept_the_same_products():def payload(observation: SourceObservation) -> dict:return {- "contract_version": 20,+ "contract_version": 21,"outcome": observation.outcome.value,"reachable": observation.reachable,"authenticated": (@@ -737,7 +737,7 @@ def test_guard_refusal_error_requires_its_corresponding_nonempty_plan_array():route_refusal = {"ok": False,- "contract_version": 20,+ "contract_version": 21,"error": "source_in_route_chain","detail": "modelHub.errors.source_in_route_chain","would_remove_hops": [hop],@@ -753,7 +753,7 @@ def test_guard_refusal_error_requires_its_corresponding_nonempty_plan_array():}candidate_refusal = {"ok": False,- "contract_version": 20,+ "contract_version": 21,"error": "candidate_suppliers_changed","detail": "modelHub.errors.candidate_suppliers_changed","changed": {@@ -837,7 +837,7 @@ def test_v8_mirror_registry_is_executable_and_complete():registry = json.loads((CONTRACTS / "mirror-registry.json").read_text(encoding="utf-8"))schemas = _mirror_schemas(registry)- assert registry["contract_version"] == 20+ assert registry["contract_version"] == 21ids = [entry["id"] for entry in registry["entries"]]assert idsassert len(ids) == len(set(ids))@@ -974,8 +974,8 @@ def test_model_hub_authority_closure_anchors_the_persisted_version_floor(monkeyp"kind": "contract_version_schema_drift","domain": "V1","file": "docs/plans/model-hub-contracts/turn-provenance.schema.json",- "values": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],- "expected": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],+ "values": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],+ "expected": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],} in result["findings"]@@ -993,7 +993,17 @@ def _versioned_nodes(node):yield from _versioned_nodes(item)-def test_api_response_envelope_stays_versioned():+def test_turn_provenance_keeps_released_v20_and_current_v21_read_shapes():+ """KEX-1: the v21 mirror still accepts the released v20 provenance version."""+ schema = _schema("turn-provenance.schema.json")+ validator = Draft7Validator(schema)+ for version in (20, 21):+ example = copy.deepcopy(schema["examples"][0])+ example["contract_version"] = version+ validator.validate(example)+++assert any(_versioned_nodes(_schema("api-response.schema.json")))@@ -1344,7 +1354,7 @@ def test_v5_shape_amendments_reject_the_false_states_they_replace():with pytest.raises(ValidationError):chain_validator.validate(interrupted)exact_hop = {- "contract_version": 20,+ "contract_version": 21,"backend": "claude","model_id": "claude-opus-4-6","manual_override": None,diff --git a/tests/test_model_hub_l3.py b/tests/test_model_hub_l3.pyindex 2117ab5e9..5e69e86bf 100644--- a/tests/test_model_hub_l3.py+++ b/tests/test_model_hub_l3.py@@ -5580,7 +5580,7 @@ def test_backend_failure_keeps_the_gateway_terminal_error_no_later_request_superdef test_released_backend_rejection_records_read_unchanged(tmp_path: Path) -> None:"""Records the earlier bridge wrote stay as written: no reason or phase is re-derived on read."""released = {- "contract_version": 20,+ "contract_version": 21,"turn_id": "turn_released_rejection","ts": NOW.isoformat(),"agent": "vibey",@@ -7056,7 +7056,7 @@ def test_source_observation_reduces_the_order_at_the_first_authenticated_proof(_assert_valid("observation-result.schema.json",{- "contract_version": 20,+ "contract_version": 21,"outcome": "adapter_error","reachable": True,"authenticated": "unknown",@@ -9590,7 +9590,7 @@ def test_native_chain_visibility_and_probe_readiness(tmp_path: Path) -> None:probe = asyncio.run(service.probe_agent("codex", "shared-model"))assert probe == {- "contract_version": 20,+ "contract_version": 21,"backend": "codex","channel": "native_cli","reachable": True,diff --git a/tests/test_model_hub_provenance.py b/tests/test_model_hub_provenance.pyindex 00b9eb5cf..507cf271d 100644--- a/tests/test_model_hub_provenance.py+++ b/tests/test_model_hub_provenance.py@@ -261,7 +261,7 @@ def test_live_recovery_snapshots_never_revive_invalid_or_terminal_owners(tmp_patdef _record(turn_id, *, backend="claude", model=MODEL, outcome="failed_terminal"):identity = {"source_id": "src_deleted01", "configured_model_id": "unknown-model", "channel": "hub"}return {- "contract_version": 20,+ "contract_version": 21,"turn_id": turn_id,"ts": "2026-09-06T00:00:00Z","agent": backend,@@ -707,6 +707,6 @@ def test_model_history_client_rpc_http_share_nullable_read_only_result(monkeypatf"/api/models/agents/claude/provenance?model={MODEL}", headers=csrf_headers(client, origin), base_url=origin)assert response.status_code == 200- assert response.get_json() == {"ok": True, "contract_version": 20, "provenance": record}+ assert response.get_json() == {"ok": True, "contract_version": 21, "provenance": record}assert store.config.to_payload() == beforeassert adapter.synced == []diff --git a/tests/test_model_hub_resolution.py b/tests/test_model_hub_resolution.pyindex fd92b8116..7bc177350 100644--- a/tests/test_model_hub_resolution.py+++ b/tests/test_model_hub_resolution.py@@ -1808,7 +1808,7 @@ def test_service_accepts_authoritative_reachable_adapter_error(tmp_path):)assert result["observation"] == {- "contract_version": 20,+ "contract_version": 21,"outcome": "adapter_error","reachable": True,"authenticated": "unknown",@@ -1839,7 +1839,7 @@ def test_unknown_adapter_error_does_not_claim_connection(tmp_path):assert exc.value.code == "discovery_failed"assert exc.value.detail == "modelHub.errors.adapter_error"assert exc.value.data["observation"] == {- "contract_version": 20,+ "contract_version": 21,"outcome": "adapter_error","reachable": None,"authenticated": "unknown",diff --git a/tests/test_model_hub_runtime.py b/tests/test_model_hub_runtime.pyindex 0fece09bf..f9c946f79 100644--- a/tests/test_model_hub_runtime.py+++ b/tests/test_model_hub_runtime.py@@ -1367,7 +1367,7 @@ def test_manifest_resolution_drives_admission_persistence_and_schema(installer=manager,state_store=EngineStateStore(tmp_path / "state"),)- projected = {"contract_version": 20, **supervisor.status()}+ projected = {"contract_version": 21, **supervisor.status()}schema = json.loads(Path("docs/plans/model-hub-contracts/runtime-dependency.schema.json").read_text(encoding="utf-8"@@ -2820,7 +2820,7 @@ def test_search_query_limits_use_only_documented_vendor_bounds() -> None:assert {entry.id: entry.search["limits"]["query_max_chars"]for entry in api_key_vendor_catalog() if entry.search is not None- } == {"deepseek": 128, "tavily": None, "exa": None}+ } == {"deepseek": 128, "tavily": None, "exa": None, "exa-mcp": None}def test_only_deepseek_search_auto_enrolls_model_sources() -> None:diff --git a/tests/test_model_hub_search_chain.py b/tests/test_model_hub_search_chain.pyindex 2465f3ea7..6fc77986f 100644--- a/tests/test_model_hub_search_chain.py+++ b/tests/test_model_hub_search_chain.py@@ -13,7 +13,12 @@ from datetime import timedeltaimport pytest-from config.v2_config import ModelHubConfig, ModelHubSourceStateConfig+from config.v2_config import (+ KEYLESS_EXA_SERVICE_ID,+ KEYLESS_EXA_SOURCE_ID,+ ModelHubConfig, ModelHubSourceStateConfig,+ model_hub_keyless_exa_source,+)from core.handlers.model_hub import hosted_toolsfrom core.handlers.model_hub.adapter import SearchCredentialCheck, SearchResponsefrom core.handlers.model_hub.capability_evidence import EvidenceFeature@@ -308,6 +313,17 @@ async def test_skip_precedence_terminal_reason_and_attempts_without_execution(tm_hosted_result("web_search", result)+async def test_keyless_retry_branch_accepts_the_synthetic_source_while_flag_is_off(tmp_path):+ """KEX-1: a downgraded reader can clear a built-in cooldown without a Source row or network call."""+ service = owner(tmp_path, ("exa",))+ source = model_hub_keyless_exa_source()+ generation = service._service_cooldowns.advance(source, KEYLESS_EXA_SERVICE_ID)+ assert service._service_cooldowns.current(source, KEYLESS_EXA_SERVICE_ID, generation)+ assert await service.clear_service_cooldown(KEYLESS_EXA_SOURCE_ID, KEYLESS_EXA_SERVICE_ID) == {}+ assert not service._service_cooldowns.current(source, KEYLESS_EXA_SERVICE_ID, generation)++@pytest.mark.asyncioasync def test_service_retry_advice_backoff_and_clear_are_independent_of_model_calls(tmp_path, monkeypatch):service = owner(tmp_path, ("deepseek",))@@ -929,7 +945,7 @@ def test_retry_http_client_rpc_clears_only_the_service_fence_with_plain_success(response = client.post(f"/api/models/hosted-tools/web_search/services/{EXA}/retry", json={},headers=csrf_headers(client, "http://127.0.0.1:15131"))assert response.status_code == 200- assert response.get_json() == {"ok": True, "contract_version": 20}+ assert response.get_json() == {"ok": True, "contract_version": 21}assert calls == [("clear_service_cooldown", {"source_id": EXA, "service_id": None})]assert not service._service_cooldowns.current(source, "exa/search", generation)assert service.store.load().sources[0].state == source.statediff --git a/tests/test_model_hub_search_settings.py b/tests/test_model_hub_search_settings.pyindex 7b13d9eb1..2bc016d2c 100644--- a/tests/test_model_hub_search_settings.py+++ b/tests/test_model_hub_search_settings.py@@ -19,7 +19,12 @@ import pytestfrom jsonschema import Draft7Validator, ValidationErrorfrom config import paths-from config.v2_config import ModelHubConfig, ModelHubSourceStateConfig, V2Config, hosted_tool_setting+from config.v2_config import (+ KEYLESS_EXA_SERVICE_ID,+ KEYLESS_EXA_SOURCE_ID,+ ModelHubConfig, ModelHubSourceStateConfig, V2Config, hosted_tool_setting,+ model_hub_keyless_exa_source, model_hub_search_service,+)from core.handlers.model_hub import hosted_toolsfrom core.handlers.model_hub.service import ModelHubError, V2ModelHubConfigStorefrom core.services.settings import default_config@@ -34,6 +39,7 @@ DEEPSEEK = "src_deepseek1"MODEL = SOURCE["id"]GONE = "src_gone0001"CONTRACT = "model-hub/hosted-tools-status.schema.json"+FIXTURES = Path(__file__).parent / "fixtures" / "model_hub"def _source(source_id, vendor, protocol="search"):@@ -75,6 +81,59 @@ def _catalog_change(monkeypatch, vendor_id, **changes):if key == vendor_id else original(key))+def test_keyless_catalog_is_built_in_and_credential_free():+ """KEX-1: the catalog reader exposes the stable free Exa service without a key."""+ entry = api_key_vendors.api_key_vendor_entry("exa-mcp")+ assert entry is not None and entry.built_in is True+ assert entry.search is not None+ assert entry.search["service_id"] == KEYLESS_EXA_SERVICE_ID+ assert entry.search["auth"] == "none"+ assert model_hub_search_service(model_hub_keyless_exa_source()) == entry.search++[email protected]("fixture_name", ["released_search_v20.json", "keyless_exa_v21.json"])+def test_released_and_keyless_search_settings_read_without_a_migration_write(fixture_name):+ """KEX-1: both the shipped v20 shape and the future additive v21 shape stay round-trippable."""+ raw = json.loads((FIXTURES / fixture_name).read_text(encoding="utf-8"))+ config = _config(raw)+ setting = config.hosted_tools["web_search"]+ assert setting.to_payload() == raw+ assert setting.executor_order == tuple(raw["executor_order"])+ if KEYLESS_EXA_SOURCE_ID in raw["services"]:+ assert setting.services[KEYLESS_EXA_SOURCE_ID].to_payload() == {"results": 9, "enabled": False}+++def test_keyless_candidate_and_catalog_are_dormant_by_default_and_readable_when_enabled(tmp_path, monkeypatch):+ """KEX-1: the shipped flag-off read is unchanged; a future flip reads the built-in candidate."""+ config = _config()+ assert hosted_tools.KEYLESS_EXA_ACTIVE is False+ assert all(vendor["id"] != "exa-mcp" for vendor in hosted_tools._service_vendors(config))+ service, _, _ = _disk_service(tmp_path, config)+ monkeypatch.setattr(hosted_tools, "KEYLESS_EXA_ACTIVE", True)+ visible = _web(service)+ assert any(row["source_id"] == KEYLESS_EXA_SOURCE_ID and row["model_id"] == KEYLESS_EXA_SERVICE_ID+ for row in visible["executor_candidates"])+ vendor = next(row for row in visible["service_vendors"] if row["id"] == "exa-mcp")+ assert vendor["facts"] == {"tool_only": True, "auto_enroll": False, "free_check": False,+ "built_in": True, "requires_setup": False}+ assert vendor["source_ids"] == [KEYLESS_EXA_SOURCE_ID]+++async def test_keyless_override_role_and_cooldown_survive_an_unrelated_config_write(tmp_path):+ """KEX-1: synthetic state is preserved by a later real V2 save, even while dormant."""+ raw = json.loads((FIXTURES / "keyless_exa_v21.json").read_text(encoding="utf-8"))+ service, path, _ = _disk_service(tmp_path, _config(raw))+ source = model_hub_keyless_exa_source()+ generation = service._service_cooldowns.advance(source, KEYLESS_EXA_SERVICE_ID)+ await service.set_hosted_tool("x_search", {"enabled": False})+ saved = json.loads(path.read_text(encoding="utf-8"))["model_hub"]["hosted_tools"]["web_search"]+ assert saved["executor_order"] == [KEYLESS_EXA_SOURCE_ID, TAVILY]+ assert saved["executor_order_kinds"][KEYLESS_EXA_SOURCE_ID] == "service"+ assert saved["services"][KEYLESS_EXA_SOURCE_ID] == {"results": 9, "enabled": False}+ assert service._service_cooldowns.current(source, KEYLESS_EXA_SERVICE_ID, generation)++def test_defaults_follow_catalog_without_freezing_overrides(monkeypatch):"""Default counts and opt-in evolve with catalog facts, not saved effective settings."""config = _config()diff --git a/tests/test_model_hub_vibey_contract_matrix.py b/tests/test_model_hub_vibey_contract_matrix.pyindex a0b89ab15..8684558fa 100644--- a/tests/test_model_hub_vibey_contract_matrix.py+++ b/tests/test_model_hub_vibey_contract_matrix.py@@ -48,13 +48,13 @@ def _fixture(kind):# Start from a valid native response so no Hub latency constraint can# accidentally reject the Avibe/native pairing for an unrelated cause.return {- "contract_version": 20, "backend": "claude", "channel": "native_cli", "reachable": True,+ "contract_version": 21, "backend": "claude", "channel": "native_cli", "reachable": True,"source_id": "src_fixture01", "model_id": "fixture-model", "latency_ms": None,"error": None,}if kind == "chain":return {- "contract_version": 20, "backend": "vibey", "model_id": "fixture-model",+ "contract_version": 21, "backend": "vibey", "model_id": "fixture-model","manual_override": None, "route_origin": "automatic","chain": [{"source_id": "src_fixture01", "model_id": "fixture-model", "channel": "hub","health": "healthy", "runnable": True, "reason": None, "retry_at": None}],@@ -66,7 +66,7 @@ def _fixture(kind):"proposed_action": "import", "selected": False,}return {- "contract_version": 20, "turn_id": "turn-fixture", "ts": "2026-10-02T07:00:00Z",+ "contract_version": 21, "turn_id": "turn-fixture", "ts": "2026-10-02T07:00:00Z","agent": "vibey", "requested_model_id": "fixture-model", "outcome": kind,"failed_attempts": [{**identity, "reason": "rate_limited"}] if kind == "exhausted" else [],"served": identity if kind == "served" else None,diff --git a/ui/e2e/chat-interactions/interactions.spec.ts b/ui/e2e/chat-interactions/interactions.spec.tsindex 75ae381d5..0058e5e4a 100644--- a/ui/e2e/chat-interactions/interactions.spec.ts+++ b/ui/e2e/chat-interactions/interactions.spec.ts@@ -11,7 +11,7 @@ for (const lang of ['en', 'zh'] as const) {if (url.origin !== 'http://127.0.0.1:5227' || route.request().method() !== 'GET') return route.abort();if (url.pathname === `/api/models/turns/${TURN}/provenance`) {return route.fulfill({ json: { provenance: {- contract_version: 20, turn_id: TURN, agent: 'codex', requested_model_id: 'fixture-model',+ contract_version: 21, turn_id: TURN, agent: 'codex', requested_model_id: 'fixture-model',outcome: 'failed_terminal', failed_attempts: [], blockers: [],terminal_error: { source_id: 'fixture-source', configured_model_id: 'fixture-model', reason: 'engine_down' },} } });diff --git a/ui/e2e/model-catalog/gatewayFixture.tsx b/ui/e2e/model-catalog/gatewayFixture.tsxindex 6cfdbd288..06d4e8327 100644--- a/ui/e2e/model-catalog/gatewayFixture.tsx+++ b/ui/e2e/model-catalog/gatewayFixture.tsx@@ -35,13 +35,13 @@ export function GatewayFixture() {}],};const chains = Object.fromEntries(ids.map((model_id, index) => [modelChainKey(backend, model_id), readyRegion<AgentChain>({- contract_version: 20, backend, model_id, route_origin: origins[index],+ contract_version: 21, backend, model_id, route_origin: origins[index],manual_override: origins[index] === 'manual' ? { hops: [{ source_id: source.id, model_id }] } : null,current: { source_id: source.id, model_id }, supply_state: 'ok',chain: [{ source_id: source.id, model_id, channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }],})]));const runtime = freshRuntimeProjection(readyRegion({- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1.0.0', source_sha: 'fixture', assets: [] },status: { installed_version: '1.0.0', verified: true, listening: null, health: 'ok', last_check: null },}));diff --git a/ui/e2e/model-catalog/routeFixture.tsx b/ui/e2e/model-catalog/routeFixture.tsxindex bdd741099..2ca94cfbf 100644--- a/ui/e2e/model-catalog/routeFixture.tsx+++ b/ui/e2e/model-catalog/routeFixture.tsx@@ -28,7 +28,7 @@ const supply: AgentSupply = {sources: { order: sources.map((source) => source.id), eligibility: sources.map((source) => ({ source_id: source.id, eligible: true })) },};const makeChain = (hops: RouteHop[], manual: boolean): AgentChain => ({- contract_version: 20, backend, model_id: modelId,+ contract_version: 21, backend, model_id: modelId,manual_override: manual ? { hops } : null,route_origin: manual ? 'manual' : origin === 'passthrough' ? 'passthrough' : 'automatic',current: hops[0] ?? null, supply_state: hops.length ? 'ok' : 'interrupted',diff --git a/ui/e2e/model-routing-origin.spec.ts b/ui/e2e/model-routing-origin.spec.tsindex 93261fc40..80f90528f 100644--- a/ui/e2e/model-routing-origin.spec.ts+++ b/ui/e2e/model-routing-origin.spec.ts@@ -102,7 +102,7 @@ test('MH-ROUTING-007 follow-defaults switch, undo, cancel, and save preserve expwould_remove_hops: [{ backend: gateway.backend, menu_model: gateway.model, ...manual.hops[0], position: 1 }],would_interrupt: [],};- expect(await refused.json()).toMatchObject({ ok: false, contract_version: 20, error: 'source_in_route_chain', ...plan });+ expect(await refused.json()).toMatchObject({ ok: false, contract_version: 21, error: 'source_in_route_chain', ...plan });expect((await api.agentChain(gateway.backend, gateway.model)).manual_override).toEqual(manual);// The one question is its own modal over the chain the user was editing.const guard = hub.dialogTitled(copy('guard.title.saveRoute', { menuModel: gateway.model }));diff --git a/ui/e2e/onboarding-fidelity/hub-ownership.spec.ts b/ui/e2e/onboarding-fidelity/hub-ownership.spec.tsindex 97431a511..6f45395cb 100644--- a/ui/e2e/onboarding-fidelity/hub-ownership.spec.ts+++ b/ui/e2e/onboarding-fidelity/hub-ownership.spec.ts@@ -92,7 +92,7 @@ for (const width of [1200, 390]) {if (path === '/api/models/runtime/status') return answer({ok: true,runtime: {- contract_version: 20, enabled: true, host_platform: 'linux',+ contract_version: 21, enabled: true, host_platform: 'linux',manifest: { name: 'cliproxyapi', resolution: 'resolved', version: 'fixture', source_sha: 'a'.repeat(40), assets: [] },status: { installed_version: 'fixture', verified: true, health: 'ok' },},diff --git a/ui/e2e/onboarding-fidelity/pm-main-flow.spec.ts b/ui/e2e/onboarding-fidelity/pm-main-flow.spec.tsindex 4c8b3a039..397421057 100644--- a/ui/e2e/onboarding-fidelity/pm-main-flow.spec.ts+++ b/ui/e2e/onboarding-fidelity/pm-main-flow.spec.ts@@ -18,7 +18,7 @@ for (const [width,chosen] of [[1200,"claude"],[390,"claude"],[1200,"codex"]] asconst config=()=>({version:'v2',mode:'self_host',setup_completed:completed,setup_state:{needs_setup:!completed},capabilities:{model_hub:{enabled:true}},platforms:{primary:'slack',enabled:[]},runtime:{},agents:Object.fromEntries(['claude','codex','opencode'].map(b=>[b,{enabled:b!=='opencode',cli_path:b}])),agent:{default_cwd:'/fixture/work'},model_hub:{enabled:true,runtime_default_applied:true}});const source={id:'src_fixture',kind:'api_key',vendor:'openai',display_name:'Fixture source',protocol:'openai_chat',supply_channel:'hub',billing:'metered',state:{status:'active'},masked_credential:'fixture-only',models:hops.map(h=>({id:h.model_id,display_name:h.model_id==='gpt-5'?'GPT-5':undefined,origin:'discovered',reasoning_efforts:[],reasoning_efforts_source:null})),last_discovered_at:null};const supply=(b:string)=>({backend:b,cli_present:true,mode:'hub',menu_kind:'fixed',sources:{order:[source.id],eligibility:[{source_id:source.id,eligible:true}]},routes:{},builtin_models:[],catalog_models:[],menu:null,model_supply:[],named_agents:[{name:b,effective_model_id:agent(b).model,supply_status:saved[b].length?'ok':'unavailable'}],supply_status:saved[b].length?'ok':'unavailable'});- const chain=(b:string,hs=saved[b])=>({contract_version:20,backend:b,model_id:agent(b).model,manual_override:hs.length?{hops:hs}:null,route_origin:hs.length?'manual':'automatic',current:hs[0]??null,chain:hs.map(h=>({...h,channel:'hub',health:'healthy',runnable:true,reason:null,retry_at:null})),supply_state:hs.length?'ok':'unavailable'});+ const chain=(b:string,hs=saved[b])=>({contract_version:21,backend:b,model_id:agent(b).model,manual_override:hs.length?{hops:hs}:null,route_origin:hs.length?'manual':'automatic',current:hs[0]??null,chain:hs.map(h=>({...h,channel:'hub',health:'healthy',runnable:true,reason:null,retry_at:null})),supply_state:hs.length?'ok':'unavailable'});await page.addInitScript(()=>localStorage.setItem('i18nextLng','en'));await page.route(`${ORIGIN}/api/**`,async route=>{const req=route.request(),path=new URL(req.url()).pathname;@@ -34,7 +34,7 @@ for (const [width,chosen] of [[1200,"claude"],[390,"claude"],[1200,"codex"]] as}if(path==='/api/agents')return answer({ok:true,default_agent_name:defaultName,agents:[agent('claude'),agent('codex')]});if(/^\/api\/agents\/(claude|codex)$/.test(path))return answer({ok:true,agent:agent(path.split('/').at(-1)!),default_agent_name:defaultName});- if(path==='/api/models/runtime/status')return answer({ok:true,runtime:{contract_version:20,enabled:true,host_platform:'linux',manifest:{name:'cliproxyapi',resolution:'resolved',version:'fixture',source_sha:'a'.repeat(40),assets:[]},status:{installed_version:'fixture',verified:true,health:'ok'}}});+ if(path==='/api/models/runtime/status')return answer({ok:true,runtime:{contract_version:21,enabled:true,host_platform:'linux',manifest:{name:'cliproxyapi',resolution:'resolved',version:'fixture',source_sha:'a'.repeat(40),assets:[]},status:{installed_version:'fixture',verified:true,health:'ok'}}});if(path==='/api/models/sources')return answer({ok:true,sources:[source]});if(path==='/api/models/agents')return answer({ok:true,agents:[supply('claude'),supply('codex')]});if(/\/api\/models\/agents\/(claude|codex)\/chains$/.test(path)){diff --git a/ui/e2e/onboarding-fidelity/provider-support.ts b/ui/e2e/onboarding-fidelity/provider-support.tsindex 05f12357b..1f289e747 100644--- a/ui/e2e/onboarding-fidelity/provider-support.ts+++ b/ui/e2e/onboarding-fidelity/provider-support.ts@@ -129,7 +129,7 @@ const CONFIG = {/** Installed, verified and serving: the screen's `gatewayIntent` reads `running` and* starts no install, which is the state every proof below is about something else. */const RUNTIME = {- contract_version: 20,+ contract_version: 21,enabled: true,host_platform: 'darwin',manifest: {diff --git a/ui/e2e/onboarding-fidelity/support.ts b/ui/e2e/onboarding-fidelity/support.tsindex a2e32235a..7a88918f4 100644--- a/ui/e2e/onboarding-fidelity/support.ts+++ b/ui/e2e/onboarding-fidelity/support.ts@@ -87,7 +87,7 @@ export async function serveProduct(page: Page) {const backend = new URL(route.request().url()).pathname.split('/')[4];return route.fulfill({ json: { ok: true, agent: { backend, mode: 'direct', sources: { order: [], eligibility: [] }, routes: {}, builtin_models: [], catalog_models: [], named_agents: [], menu: null, model_supply: [], supply_status: 'unavailable' } } });});- await page.route('**/api/models/runtime/status', (route) => route.fulfill({ json: { ok: true, runtime: { contract_version: 20, enabled: true, host_platform: 'linux', manifest: { name: 'cliproxyapi', resolution: 'resolved', version: 'fixture', source_sha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', assets: [] }, status: { installed_version: 'fixture', verified: true, health: 'ok' } } } }));+ await page.route('**/api/models/runtime/status', (route) => route.fulfill({ json: { ok: true, runtime: { contract_version: 21, enabled: true, host_platform: 'linux', manifest: { name: 'cliproxyapi', resolution: 'resolved', version: 'fixture', source_sha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', assets: [] }, status: { installed_version: 'fixture', verified: true, health: 'ok' } } } }));await page.route(`${ORIGIN}/status`, (route) => route.fulfill({ json: { state: 'running' } }));await page.route('**/api/backend/*/connection', (route) => route.fulfill({ json: { ok: true, backend: new URL(route.request().url()).pathname.split('/').at(-2), installed: true, enabled: true, auth: 'none', application: 'applied', ready: false, entry_eligible: false } }));await page.route('**/api/config', (route) => route.fulfill({ json: CONFIG }));diff --git a/ui/e2e/support/api.ts b/ui/e2e/support/api.tsindex a3d5e82bb..bff7922e9 100644--- a/ui/e2e/support/api.ts+++ b/ui/e2e/support/api.ts@@ -358,7 +358,7 @@ export class HubApi {const payload = await this.read<{ ok: boolean; contract_version: number; provenance: RecordedTurn | null }>(`/api/models/agents/${backend}/provenance?model=${encodeURIComponent(model)}`,);- if (payload.ok !== true || payload.contract_version !== 20 || !('provenance' in payload)) {+ if (payload.ok !== true || payload.contract_version !== 21 || !('provenance' in payload)) {throw new Error('Latest recorded turn did not use the v20 provenance envelope');}return payload.provenance;diff --git a/ui/e2e/workbench-general/geometry.spec.ts b/ui/e2e/workbench-general/geometry.spec.tsindex 7d88233df..5758d90af 100644--- a/ui/e2e/workbench-general/geometry.spec.ts+++ b/ui/e2e/workbench-general/geometry.spec.ts@@ -48,7 +48,7 @@ const MODEL_HUB_AGENT = {};const MODEL_HUB_RUNTIME = {- contract_version: 20,+ contract_version: 21,enabled: true,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: 'fixture', source_sha: 'f'.repeat(40), assets: [] },status: { installed_version: 'fixture', verified: true, listening: { host: '127.0.0.1', port: 43123 }, health: 'ok' },diff --git a/ui/src/components/onboarding/AssistantSetup.test.tsx b/ui/src/components/onboarding/AssistantSetup.test.tsxindex 4086fe665..cfe4a41d7 100644--- a/ui/src/components/onboarding/AssistantSetup.test.tsx+++ b/ui/src/components/onboarding/AssistantSetup.test.tsx@@ -50,7 +50,7 @@ const hubAgent = (enabled = true) => ({system_prompt: null, created_at: '', metadata: { builtin_default: true },});const hubChain = (modelId: string) => ({- contract_version: 20, backend: 'claude', model_id: 'opus-5',+ contract_version: 21, backend: 'claude', model_id: 'opus-5',manual_override: { hops: [{ source_id: 'src_a', model_id: modelId }] },route_origin: 'manual', current: { source_id: 'src_a', model_id: modelId },chain: [{ source_id: 'src_a', model_id: modelId, channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }],@@ -354,7 +354,7 @@ describe('assistant installation presentation', () => {mock.api.getVibeAgent.mockResolvedValue({ ok: true, agent });mock.models.listSources.mockResolvedValue([]);const chain = {- contract_version: 20, backend: 'claude', model_id: 'opus-5',+ contract_version: 21, backend: 'claude', model_id: 'opus-5',manual_override: { hops: [{ source_id: 'src_a', model_id: 'opus-5' }, { source_id: 'src_b', model_id: 'opus-5' }] },route_origin: 'manual', current: { source_id: 'src_a', model_id: 'opus-5' },chain: [diff --git a/ui/src/components/onboarding/BuiltinAssistant.test.tsx b/ui/src/components/onboarding/BuiltinAssistant.test.tsxindex 9cf7fceca..f36381ef4 100644--- a/ui/src/components/onboarding/BuiltinAssistant.test.tsx+++ b/ui/src/components/onboarding/BuiltinAssistant.test.tsx@@ -65,7 +65,7 @@ const vibeyAgent = (model: string | null) => ({system_prompt: null, created_at: '', metadata: { builtin_default: true, lock_delete: true },});const chain = (modelId: string) => ({- contract_version: 20, backend: 'vibey', model_id: modelId,+ contract_version: 21, backend: 'vibey', model_id: modelId,manual_override: null, route_origin: 'automatic', current: { source_id: 'src_openai', model_id: modelId },chain: [{ source_id: 'src_openai', model_id: modelId, channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }],supply_state: 'ok',diff --git a/ui/src/components/onboarding/providers/ProvidersScreen.test.tsx b/ui/src/components/onboarding/providers/ProvidersScreen.test.tsxindex 7c2e8d71f..1019e6b80 100644--- a/ui/src/components/onboarding/providers/ProvidersScreen.test.tsx+++ b/ui/src/components/onboarding/providers/ProvidersScreen.test.tsx@@ -79,7 +79,7 @@ const supply = (over: Partial<AgentSupply> & { backend: AgentSupply['backend'] }});const runtimeOf = (health: RuntimeHealth, over: Partial<RuntimeDependency> = {}): RuntimeDependency => ({- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1.0.0', source_sha: 'sha', assets: [] },status: { verified: true, health },...over,diff --git a/ui/src/components/onboarding/providers/providerStage.test.ts b/ui/src/components/onboarding/providers/providerStage.test.tsindex ed332b87e..ee8c78399 100644--- a/ui/src/components/onboarding/providers/providerStage.test.ts+++ b/ui/src/components/onboarding/providers/providerStage.test.ts@@ -660,7 +660,7 @@ describe('adoptionBackend', () => {});const runtime = (health: RuntimeHealth, over: Partial<RuntimeDependency> = {}): RuntimeDependency => ({- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1.0.0', source_sha: 'sha', assets: [] },status: { verified: true, health },...over,diff --git a/ui/src/components/settings/models/AddSearchServiceDialog.tsx b/ui/src/components/settings/models/AddSearchServiceDialog.tsxindex cb7348cc3..3bb0c6328 100644--- a/ui/src/components/settings/models/AddSearchServiceDialog.tsx+++ b/ui/src/components/settings/models/AddSearchServiceDialog.tsx@@ -33,17 +33,22 @@ export const AddSearchServiceDialog: React.FC<{</DialogHeader><div className="grid gap-3 sm:grid-cols-2">{tool.service_vendors?.map((vendor) => {+ const vendorName = t(`settings.models.searchServices.vendorName.${vendor.id}`, { defaultValue: vendor.name }) as string;+ const builtIn = vendor.facts.built_in === true;const added = vendor.source_ids.length > 0;const enabled = vendor.source_ids.some((id) => serviceSettings(tool, vendor, id).enabled);const state = vendor.facts.tool_only ? 'added' : enabled ? 'inOrder' : 'addedUnused';- return <section key={vendor.id} aria-label={vendor.name} className="flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-background p-4">- <div className="flex items-center gap-3"><SearchVendorGlyph vendor={vendor.id} /><h3 className="min-w-0 flex-1 font-semibold text-foreground">{vendor.name}</h3></div>+ return <section key={vendor.id} aria-label={vendorName} className="flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-background p-4">+ <div className="flex items-center gap-3"><SearchVendorGlyph vendor={vendor.id} /><h3 className="min-w-0 flex-1 font-semibold text-foreground">{vendorName}</h3></div><SearchVendorFacts vendor={vendor} /><SearchServicePrice price={vendor.price} />- {added ? <>+ {builtIn ? <>+ <span className="model-hub-pill model-hub-accent-pill--neutral self-start border">{t('settings.models.searchServices.builtIn')}</span>+ <Button variant="outline" size="sm" disabled={pending} onClick={() => onOpenSource(vendor.source_ids[0])}>{t('settings.models.searchServices.viewOrder')}<ChevronRight aria-hidden /></Button>+ </> : added ? <><span className="model-hub-pill model-hub-accent-pill--neutral self-start border">{t(`settings.models.searchServices.${state}`)}</span>- <Button variant="outline" size="sm" disabled={pending} onClick={() => onOpenSource(vendor.source_ids.find((id) => !serviceSettings(tool, vendor, id).enabled) ?? vendor.source_ids[0])}>{t('settings.models.searchServices.openDetail', { vendor: vendor.name })}</Button>- </> : <Button variant="outline" size="sm" disabled={pending} onClick={() => setSelectedId(vendor.id)}>{t('settings.models.searchServices.addVendor', { vendor: vendor.name })}<ChevronRight aria-hidden /></Button>}+ <Button variant="outline" size="sm" disabled={pending} onClick={() => onOpenSource(vendor.source_ids.find((id) => !serviceSettings(tool, vendor, id).enabled) ?? vendor.source_ids[0])}>{t('settings.models.searchServices.openDetail', { vendor: vendorName })}</Button>+ </> : <Button variant="outline" size="sm" disabled={pending} onClick={() => setSelectedId(vendor.id)}>{t('settings.models.searchServices.addVendor', { vendor: vendorName })}<ChevronRight aria-hidden /></Button>}</section>;})}</div>diff --git a/ui/src/components/settings/models/AgentCard.test.tsx b/ui/src/components/settings/models/AgentCard.test.tsxindex 7424d0a92..ab1a79716 100644--- a/ui/src/components/settings/models/AgentCard.test.tsx+++ b/ui/src/components/settings/models/AgentCard.test.tsx@@ -17,7 +17,7 @@ import { freshRuntimeProjection } from './runtimeLifecycle';import type { AgentSupply, RuntimeDependency, Source } from './types';const runtime: RuntimeDependency = {- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1.0.0', source_sha: 'fixture', assets: [] },status: { installed_version: '1.0.0', verified: true, listening: null, health: 'ok', last_check: null },};@@ -414,7 +414,7 @@ describe('AgentCard', () => {['zh', 'Backup → claude-opus-4-6(已自动切换)', '打开 claude-opus-4-6 的路由 · Backup → claude-opus-4-6(已自动切换)'],] as const)('derives and announces takeover from the exact current hop in %s', (lng, mappingCopy, accessibleName) => {const key = modelChainKey('claude', 'claude-opus-4-6');- render(<I18nextProvider i18n={localeInstance(lng)}><AgentCard agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 20, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);+ render(<I18nextProvider i18n={localeInstance(lng)}><AgentCard agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 21, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);expect(screen.getByText(/Backup/)).toBeTruthy();expect(screen.getByTitle(mappingCopy)).toBeTruthy();expect(screen.getByRole('button', { name: accessibleName })).toBeTruthy();@@ -434,7 +434,7 @@ describe('AgentCard', () => {sources={[source('src_b', 'Backup source')]}chains={{[key]: readyRegion({ manual_override: {hops:[{source_id:'src_b',model_id:'routed-opus'}]}, route_origin: "manual" as const,- contract_version: 20,+ contract_version: 21,backend: 'claude',model_id: 'claude-opus-4-6',current: { source_id: 'src_b', model_id: 'routed-opus' },@@ -467,7 +467,7 @@ describe('AgentCard', () => {it('does not call a later current hop takeover unless the head is unavailable for cooldown', () => {const key = modelChainKey('claude', 'claude-opus-4-6');- render(<I18nextProvider i18n={i18n}><AgentCard agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 20, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'native_cli', health: 'healthy', runnable: false, reason: 'native_cli_unavailable', retry_at: null }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);+ render(<I18nextProvider i18n={i18n}><AgentCard agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 21, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'native_cli', health: 'healthy', runnable: false, reason: 'native_cli_unavailable', retry_at: null }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);expect(screen.getByText(/Backup/)).toBeTruthy();expect(screen.queryByText(/takeover/i)).toBeNull();});@@ -475,7 +475,7 @@ describe('AgentCard', () => {it('hides current and takeover projections while the runtime is stopped', () => {const key = modelChainKey('claude', 'claude-opus-4-6');const stopped = { ...runtime, status: { ...runtime.status, health: 'down' as const } };- render(<I18nextProvider i18n={i18n}><RuntimeAgentCard runtime={freshRuntimeProjection(readyRegion(stopped))} agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 20, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenModels={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);+ render(<I18nextProvider i18n={i18n}><RuntimeAgentCard runtime={freshRuntimeProjection(readyRegion(stopped))} agents={[hubAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 21, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenModels={vi.fn()} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);expect(screen.queryByText(/Backup/)).toBeNull();expect(screen.queryByText(/takeover/i)).toBeNull();@@ -487,7 +487,7 @@ describe('AgentCard', () => {const onOpenModels = vi.fn();const key = modelChainKey('claude', 'claude-opus-4-6');const directAgent: AgentSupply = { ...hubAgent, mode: 'direct', sources: null, routes: null, supply_status: null, model_supply: null };- render(<I18nextProvider i18n={i18n}><AgentCard agents={[directAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 20, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenModels={onOpenModels} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);+ render(<I18nextProvider i18n={i18n}><AgentCard agents={[directAgent]} sources={[source('src_a', 'Primary'), source('src_b', 'Backup')]} chains={{ [key]: readyRegion({ manual_override: {hops:[{source_id:'src_a',model_id:'claude-opus-4-6'},{source_id:'src_b',model_id:'claude-opus-4-6'}]}, route_origin: "manual" as const, contract_version: 21, backend: 'claude', model_id: 'claude-opus-4-6', current: { source_id: 'src_b', model_id: 'claude-opus-4-6' }, chain: [{ source_id: 'src_a', model_id: 'claude-opus-4-6', channel: 'hub', health: 'cooldown', runnable: false, reason: null, retry_at: '2099-01-01T00:00:00Z' }, { source_id: 'src_b', model_id: 'claude-opus-4-6', channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null }], supply_state: 'ok' }) }} pendingBackends={new Set()} switchFailures={new Set()} connectingBackend={null} onConnectHub={vi.fn()} onSwitchDirect={vi.fn()} onOpenModels={onOpenModels} onOpenOrder={vi.fn()} onOpenRoute={vi.fn()} onProbeSettled={vi.fn()} /></I18nextProvider>);expect(screen.queryByText(/Adjust priority/i)).toBeNull();expect(screen.queryByRole('button', { name: /route chain/i })).toBeNull();expect(screen.queryByText(/Backup/)).toBeNull();diff --git a/ui/src/components/settings/models/BackendSupplyModeCard.test.tsx b/ui/src/components/settings/models/BackendSupplyModeCard.test.tsxindex 042af51da..fddd0cb66 100644--- a/ui/src/components/settings/models/BackendSupplyModeCard.test.tsx+++ b/ui/src/components/settings/models/BackendSupplyModeCard.test.tsx@@ -34,7 +34,7 @@ const CLAUDE_KEY: MigrationItem = {};const RUNTIME: RuntimeDependency = {- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1', source_sha: 'a'.repeat(40), assets: [] },status: { installed_version: '1', verified: true, health: 'ok' },};diff --git a/ui/src/components/settings/models/RouteChainDialog.directEdit.test.tsx b/ui/src/components/settings/models/RouteChainDialog.directEdit.test.tsxindex faaf39f1e..ab6fb148a 100644--- a/ui/src/components/settings/models/RouteChainDialog.directEdit.test.tsx+++ b/ui/src/components/settings/models/RouteChainDialog.directEdit.test.tsx@@ -17,7 +17,7 @@ const sources: Source[] = ['a', 'b'].map((id) => ({}));const hops = sources.map((source) => ({ source_id: source.id, model_id: 'gpt-test' }));const makeChain = (backend: AgentSupply['backend'], routeOrigin: 'automatic' | 'passthrough' | 'manual'): AgentChain => ({- contract_version: 20, backend, model_id: 'gpt-test', route_origin: routeOrigin,+ contract_version: 21, backend, model_id: 'gpt-test', route_origin: routeOrigin,manual_override: routeOrigin === 'manual' ? { hops } : null,current: hops[0], supply_state: 'ok',chain: hops.map((hop) => ({ ...hop, channel: 'hub', health: 'healthy', runnable: true, reason: null, retry_at: null })),diff --git a/ui/src/components/settings/models/RouteChainDialog.test.tsx b/ui/src/components/settings/models/RouteChainDialog.test.tsxindex aaa150a27..35f548fc7 100644--- a/ui/src/components/settings/models/RouteChainDialog.test.tsx+++ b/ui/src/components/settings/models/RouteChainDialog.test.tsx@@ -57,7 +57,7 @@ const sources: Source[] = [},];const chain: AgentChain = { manual_override: {hops:[{source_id:"src_a",model_id:"claude-opus-5"},{source_id:"src_b",model_id:"opus-5"}]}, route_origin: "manual" as const,- contract_version: 20,+ contract_version: 21,backend: "claude",model_id: "opus-5",current: { source_id: "src_b", model_id: "opus-5" },diff --git a/ui/src/components/settings/models/RouteRecordedTurn.test.tsx b/ui/src/components/settings/models/RouteRecordedTurn.test.tsxindex d83235b20..2ac937107 100644--- a/ui/src/components/settings/models/RouteRecordedTurn.test.tsx+++ b/ui/src/components/settings/models/RouteRecordedTurn.test.tsx@@ -15,7 +15,7 @@ import { PERSISTED_TURN_CONTRACT_VERSIONS } from './types';import type { RouteHop, TurnProvenance } from './types';const record: TurnProvenance = {- contract_version: 20, turn_id: 'turn-recorded', ts: '2026-09-05T15:00:00Z', agent: 'codex', requested_model_id: 'requested-model',+ contract_version: 21, turn_id: 'turn-recorded', ts: '2026-09-05T15:00:00Z', agent: 'codex', requested_model_id: 'requested-model',outcome: 'failed_terminal', failed_attempts: [], served: null, canceled_attempt: null, model_supply_state: null, blockers: [],terminal_error: { source_id: 'src_historical', configured_model_id: 'historical-model', channel: 'hub', reason: 'invalid_parameter', stream_started: false, http_status: 404, upstream_error_code: 'model_not_found' },};diff --git a/ui/src/components/settings/models/RuntimeNotStartedAction.test.tsx b/ui/src/components/settings/models/RuntimeNotStartedAction.test.tsxindex 1c2c782f3..1218027e2 100644--- a/ui/src/components/settings/models/RuntimeNotStartedAction.test.tsx+++ b/ui/src/components/settings/models/RuntimeNotStartedAction.test.tsx@@ -31,7 +31,7 @@ const runtime = (? 'unresolved' as const: hostPlatform === 'linux-amd64' ? 'unsupported' as const : 'resolved' as const;return {- contract_version: 20,+ contract_version: 21,...(hostPlatform === undefined ? {} : { host_platform: hostPlatform }),manifest: resolution === 'unresolved'? { name: 'cliproxyapi', resolution, assets: [] }diff --git a/ui/src/components/settings/models/SearchServiceParts.tsx b/ui/src/components/settings/models/SearchServiceParts.tsxindex ad6616659..bae7abfe6 100644--- a/ui/src/components/settings/models/SearchServiceParts.tsx+++ b/ui/src/components/settings/models/SearchServiceParts.tsx@@ -24,7 +24,7 @@ export const SearchVendorGlyph: React.FC<{ vendor: string }> = ({ vendor }) => (export const SearchServicePrice: React.FC<{ price: HostedServiceListPrice }> = ({ price }) => {const { t } = useTranslation();return <span className="flex flex-col gap-0.5">- <span className="font-semibold text-foreground">{t('settings.models.searchServices.price', { usd: formatSmallUsd(price.usd_per_1k) })}</span>+ <span className="font-semibold text-foreground">{price.usd_per_1k === 0 ? t('settings.models.searchServices.free') : t('settings.models.searchServices.price', { usd: formatSmallUsd(price.usd_per_1k) })}</span><a href={price.url} target="_blank" rel="noopener noreferrer" className="model-hub-tool-cost-note underline underline-offset-2">{t('settings.models.searchServices.priceDate', { date: price.as_of })}</a></span>;};@@ -79,7 +79,8 @@ export const SearchVendorFacts: React.FC<{ vendor: HostedSearchServiceVendor }>return <><p className="model-hub-tool-note">{t(`settings.models.searchServices.vendor.${vendor.id}`, { defaultValue: t(vendor.facts.tool_only ? 'settings.models.searchServices.noModels' : 'settings.models.searchServices.modelsAndSearch') })}</p><span className="model-hub-tool-note flex flex-wrap gap-2">- {vendor.free_tier !== null && <span className="model-hub-pill border border-border">{vendor.free_tier}</span>}+ {vendor.free_tier !== null && <span className="model-hub-pill border border-border">{vendor.facts.built_in ? t('settings.models.searchServices.freeTier') : vendor.free_tier}</span>}+ {vendor.facts.built_in && <span className="model-hub-pill border border-border">{t('settings.models.searchServices.noSetup')}</span>}<span className="model-hub-pill border border-border">{t('settings.models.searchServices.maxResults', { count: vendor.results_max })}</span>{vendor.id === 'deepseek' && <span className="model-hub-pill border border-border">{t('settings.models.searchServices.deepseekFacts')}</span>}</span>diff --git a/ui/src/components/settings/models/SearchServices.test.tsx b/ui/src/components/settings/models/SearchServices.test.tsxindex 3133cac88..50dd7d327 100644--- a/ui/src/components/settings/models/SearchServices.test.tsx+++ b/ui/src/components/settings/models/SearchServices.test.tsx@@ -16,7 +16,7 @@ import { createSourceCollectionReadAuthority } from './collectionReadAuthority';import { ApiCallError, modelsApi } from './modelsApi';import type { SourceMutationSettlement, TrackSourceMutation } from './mutationSettlement';import { readyRegion } from './regionRead';-import { ACTIVE_SEARCH, SEARCH_SOURCES } from './searchServices.fixtures';+import { ACTIVE_SEARCH, KEYLESS_ACTIVE_SEARCH, SEARCH_SOURCES } from './searchServices.fixtures';import { SourceDetailPanel } from './SourceDetailPanel';import { SourcesCard } from './SourcesCard';import { ToolsTab } from './ToolsTab';@@ -120,6 +120,17 @@ describe('search service activation and mixed order', () => {expect(screen.getByRole('heading', { name: 'Status by Source' })).toBeTruthy();});+ it('renders the built-in keyless Exa row as free and non-addable', async () => {+ tab(KEYLESS_ACTIVE_SEARCH);+ expect(screen.getByText('Exa (free)')).toBeTruthy();+ expect(screen.getByText('Free')).toBeTruthy();+ const { onOpenSource } = addDialog(KEYLESS_ACTIVE_SEARCH);+ expect(screen.getByText('Free; IP rate-limited')).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Add Exa (free)' })).toBeNull();+ await userEvent.click(screen.getByRole('button', { name: 'View search order' }));+ expect(onOpenSource).toHaveBeenCalledWith('src_exakeyless');+ });+it('keeps keyboard focus on a usable arrow when the last movable row is followed by disabled Sources', async () => {const view = tab();await userEvent.click(screen.getByRole('button', { name: 'Move Exa down' }));diff --git a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsxindex 9de48c8a4..ec214ff96 100644--- a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx+++ b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx@@ -49,7 +49,7 @@ const manifest = {} satisfies RuntimeManifest;const runtime: RuntimeDependency = {- contract_version: 20,+ contract_version: 21,manifest,status: { installed_version: '1', verified: true, health: 'ok' },};@@ -120,7 +120,7 @@ const takeoverAgent: AgentSupply = {};const takeoverChain: AgentChain = { manual_override: {hops:[{source_id:'src_head',model_id:'gpt-5.6-sol'},{source_id:'src_relay',model_id:'gpt-5.6-sol'}]}, route_origin: "manual" as const,- contract_version: 20,+ contract_version: 21,backend: 'codex',model_id: 'gpt-5.6-sol',current: { source_id: 'src_relay', model_id: 'gpt-5.6-sol' },@@ -224,7 +224,7 @@ const routedHubAgent: AgentSupply = {const routedChain: AgentChain = {manual_override: { hops: [{ source_id: retainedSource.id, model_id: routedModelId }] },route_origin: 'manual' as const,- contract_version: 20,+ contract_version: 21,backend: 'claude',model_id: routedModelId,current: { source_id: retainedSource.id, model_id: routedModelId },diff --git a/ui/src/components/settings/models/SupplyGraph.test.ts b/ui/src/components/settings/models/SupplyGraph.test.tsindex 1c5cf0b08..94aefd059 100644--- a/ui/src/components/settings/models/SupplyGraph.test.ts+++ b/ui/src/components/settings/models/SupplyGraph.test.ts@@ -7,7 +7,7 @@ import { buildSupplyRelations as buildRelations } from './supplyRelations';import type { AgentChain, AgentSupply, RuntimeDependency, Source } from './types';const runtime: RuntimeDependency = {- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1.0.0', source_sha: 'fixture', assets: [] },status: { installed_version: '1.0.0', verified: true, listening: null, health: 'ok', last_check: null },};@@ -47,7 +47,7 @@ const agent: AgentSupply = {};const chain = (current: string, headHealth: AgentChain['chain'][number]['health'] = 'healthy', headRunnable = true, reason: AgentChain['chain'][number]['reason'] = null): AgentChain => ({ manual_override: {hops:[{source_id:'native',model_id:'model-a'},{source_id:'relay',model_id:'model-a'},{source_id:'unused',model_id:'model-a'}]}, route_origin: "manual" as const,- contract_version: 20,+ contract_version: 21,backend: 'claude',model_id: 'model-a',current: { source_id: current, model_id: 'model-a' },diff --git a/ui/src/components/settings/models/ToolsTab.tsx b/ui/src/components/settings/models/ToolsTab.tsxindex 504e74f86..2ee306004 100644--- a/ui/src/components/settings/models/ToolsTab.tsx+++ b/ui/src/components/settings/models/ToolsTab.tsx@@ -240,7 +240,11 @@ const ExecutorOrder: React.FC<{ tool: HostedSearchToolStatus; lookup: SourceLook<ol ref={list} className="flex flex-col gap-1.5" aria-label={t(activeWeb ? 'settings.models.searchServices.order' : 'settings.models.tools.order.title') as string}>{candidates.map((candidate, index) => {const source = lookup.source(candidate.source_id);- const name = lookup.name(candidate.source_id);+ const vendor = candidate.kind === 'service'+ ? activeWeb?.service_vendors?.find((item) => item.source_ids.includes(candidate.source_id))+ : undefined;+ const name = source?.display_name+ ?? (vendor ? t(`settings.models.searchServices.vendorName.${vendor.id}`, { defaultValue: vendor.name }) as string : lookup.name(candidate.source_id));const disabledService = candidate.kind === 'service' && !candidate.settings.enabled;const arrow = (direction: -1 | 1) => {const blocked = disabledService || (direction === -1 ? index === 0 : index === movable.length - 1);@@ -270,7 +274,7 @@ const ExecutorOrder: React.FC<{ tool: HostedSearchToolStatus; lookup: SourceLook<li key={candidate.source_id} className="model-hub-tool-executor-row grid items-center rounded-lg border border-border bg-background" data-executor={candidate.source_id}><span className={cn('model-hub-order-ordinal', index === 0 && 'is-first')}>{disabledService ? '—' : index + 1}</span>{activeWeb ? <div className="flex min-w-0 items-center gap-3">- {source ? <SearchVendorGlyph vendor={source.vendor} /> : <SourceGlyph source={source} />}+ {source ? <SearchVendorGlyph vendor={source.vendor} /> : candidate.kind === 'service' ? <SearchVendorGlyph vendor={vendor?.id ?? candidate.model_id} /> : <SourceGlyph source={source} />}<div className="flex min-w-0 flex-col gap-1"><div className="flex flex-wrap items-center gap-2">{candidate.kind === 'service' ? <button type="button" data-search-source={candidate.source_id} className="truncate text-left font-semibold text-foreground hover:underline" onClick={(event) => onOpenService?.(candidate.source_id, event.currentTarget)}>{name}</button> : <span className="truncate font-semibold text-foreground">{name}</span>}diff --git a/ui/src/components/settings/models/apiFailure.test.ts b/ui/src/components/settings/models/apiFailure.test.tsindex fa546c5e4..9ff39f631 100644--- a/ui/src/components/settings/models/apiFailure.test.ts+++ b/ui/src/components/settings/models/apiFailure.test.ts@@ -33,7 +33,7 @@ afterEach(() => {describe('apiFailure — whether the route named the failure', () => {it('posts installation to the dedicated runtime route', async () => {const runtime = {- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1', source_sha: 'sha', assets: [] },status: { installed_version: null, verified: false, listening: null, health: 'installing', last_check: null },} as const;diff --git a/ui/src/components/settings/models/gatewayAdoption.test.ts b/ui/src/components/settings/models/gatewayAdoption.test.tsindex 8bf0bf5b7..386188d69 100644--- a/ui/src/components/settings/models/gatewayAdoption.test.ts+++ b/ui/src/components/settings/models/gatewayAdoption.test.ts@@ -14,7 +14,7 @@ const agent = (mode: AgentSupply['mode']): AgentSupply => ({});const runtime = (health: RuntimeDependency['status']['health']): RuntimeDependency => ({- contract_version: 20,+ contract_version: 21,manifest: { name: 'cliproxyapi', resolution: 'resolved', version: '1', source_sha: 'a'.repeat(40), assets: [] },status: { installed_version: health === 'not_installed' ? null : '1', verified: health !== 'not_installed', health },});diff --git a/ui/src/components/settings/models/routeProjectionReconciliation.test.ts b/ui/src/components/settings/models/routeProjectionReconciliation.test.tsindex fea87e377..70cdd785b 100644--- a/ui/src/components/settings/models/routeProjectionReconciliation.test.ts+++ b/ui/src/components/settings/models/routeProjectionReconciliation.test.ts@@ -24,7 +24,7 @@ const source: Source = {};const report: RouteReport = {chain: {- contract_version: 20,+ contract_version: 21,backend: "claude",model_id: "模型/opus",manual_override: null,diff --git a/ui/src/components/settings/models/runtimeLifecycle.test.ts b/ui/src/components/settings/models/runtimeLifecycle.test.tsindex 2db5c0376..71fc9c52f 100644--- a/ui/src/components/settings/models/runtimeLifecycle.test.ts+++ b/ui/src/components/settings/models/runtimeLifecycle.test.ts@@ -11,7 +11,7 @@ const asset = (platform: 'darwin-arm64' | 'linux-amd64') => ({});const runtime = (resolution: 'resolved' | 'unresolved' | 'unsupported'): RuntimeDependency => ({- contract_version: 20,+ contract_version: 21,host_platform: 'darwin-arm64',manifest: resolution === 'unresolved'? { name: 'cliproxyapi', resolution, assets: [] }diff --git a/ui/src/components/settings/models/searchServices.fixtures.ts b/ui/src/components/settings/models/searchServices.fixtures.tsindex 4dc33531c..b6681ab48 100644--- a/ui/src/components/settings/models/searchServices.fixtures.ts+++ b/ui/src/components/settings/models/searchServices.fixtures.ts@@ -36,3 +36,19 @@ export const ACTIVE_SEARCH: HostedWebSearchToolStatus = {{ id: 'exa', name: 'Exa', results_max: 10, price: price(7), free_tier: null, source_ids: ['src_exa000001'], facts: { tool_only: true, auto_enroll: false, free_check: false } },],};++export const KEYLESS_ACTIVE_SEARCH: HostedWebSearchToolStatus = {+ ...ACTIVE_SEARCH,+ services: { src_exakeyless: { enabled: true, results: 5 } },+ effective_order: ['src_tavily001', 'src_exa000001', 'src_deepseek1', 'src_exakeyless', 'src_claude001'],+ executor_candidates: [+ ...ACTIVE_SEARCH.executor_candidates.slice(0, 2),+ { kind: 'service', source_id: 'src_exakeyless', model_id: 'exa/mcp', billing: 'metered', relay: false,+ price: price(0), settings: { results: 5, enabled: true }, state: { status: 'active' }, trial_pending: false, cooldown_until: null },+ ...ACTIVE_SEARCH.executor_candidates.slice(2),+ ],+ service_vendors: [...ACTIVE_SEARCH.service_vendors!, {+ id: 'exa-mcp', name: 'Exa (free)', results_max: 100, price: price(0), free_tier: 'Free; IP rate-limited',+ source_ids: ['src_exakeyless'], facts: { tool_only: true, auto_enroll: false, free_check: false, built_in: true, requires_setup: false },+ }],+};diff --git a/ui/src/components/settings/models/types.ts b/ui/src/components/settings/models/types.tsindex 084cec4c4..24e0cf4c6 100644--- a/ui/src/components/settings/models/types.ts+++ b/ui/src/components/settings/models/types.ts@@ -10,8 +10,8 @@// and the PR records the server implementation and feature-flag activation// edge. The client never synthesizes a fallback payload shape.-export const CONTRACT_VERSION = 20 as const;-export const PERSISTED_TURN_CONTRACT_VERSIONS = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] as const;+export const CONTRACT_VERSION = 21 as const;+export const PERSISTED_TURN_CONTRACT_VERSIONS = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] as const;export const AGENT_CHAIN_CONTRACT_VERSION = CONTRACT_VERSION;export const PROBE_RESULT_CONTRACT_VERSION = CONTRACT_VERSION;@@ -1192,7 +1192,7 @@ export type HostedSearchServiceVendor = {price: HostedServiceListPrice;/** Catalog-verified description; null means unknown, not no free tier. */free_tier: string | null;- facts: { tool_only: boolean; auto_enroll: boolean; free_check: boolean };+ facts: { tool_only: boolean; auto_enroll: boolean; free_check: boolean; built_in?: boolean; requires_setup?: boolean };results_max: number;/** Includes opted-out Sources, so a disabled DeepSeek still reads as already added. */source_ids: string[];diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex bbb0f374f..4ddc98d5d 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -2540,6 +2540,8 @@"addVendor": "Add {{vendor}}","empty": "Add a search service to search before model executors. List prices: {{prices}}. Plans and actual bills may differ.","price": "${{usd}} / 1k searches",+ "free": "Free",+ "freeTier": "Free; IP rate-limited","vendorPrice": "{{vendor}} ${{usd}} / 1k searches","priceDate": "API list price · {{date}}","priceNote": "Prices are the catalog's dated API list prices. Free allowances, plans and actual bills may differ.",@@ -2554,6 +2556,9 @@"added": "Added","inOrder": "Already in search order","addedUnused": "Added · not used for search",+ "builtIn": "Built in · free",+ "viewOrder": "View search order",+ "noSetup": "No key or setup required","openDetail": "Manage {{vendor}}","maxResults_one": "Up to {{count}} result","maxResults_other": "Up to {{count}} results",@@ -2582,10 +2587,14 @@"monthEstimate": "API list-price estimate {{usd}}","monthReported": "vendor-reported {{usd}}","openUsage": "View usage",+ "vendorName": {+ "exa-mcp": "Exa (free)"+ },"vendor": {"deepseek": "Search through the official DeepSeek provider. Only searches with results are billed; empty results, failures and timeouts are not.","tavily": "Basic web search with query-relevant snippets, designed for AI agents.",- "exa": "Semantic web search with query-relevant highlights included in the search price."+ "exa": "Semantic web search with query-relevant highlights included in the search price.",+ "exa-mcp": "Keyless Exa search. Free and IP rate-limited; no key or setup is required."}},"capability": {@@ -5105,6 +5114,7 @@"service_balance": "The search service account has no balance.","service_limit": "The search service limit has been reached.","service_unavailable": "The search service is unavailable.",+ "service_rate_limited": "The search service is rate-limited; the next source was tried.","service_refused": "The search service refused this query.","service_unreadable": "The search service returned an unreadable response.","search_query_too_long": "The search query is too long; shorten it and try again.",@@ -5138,6 +5148,7 @@"service_balance": "is out of balance","service_limit": "reached its usage limit","service_unavailable": "was unavailable",+ "service_rate_limited": "was rate-limited; the next source was tried","service_refused": "refused this query","service_unreadable": "returned an unreadable response"},diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 5b9a61036..658036668 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -2540,6 +2540,8 @@"addVendor": "添加 {{vendor}}","empty": "添加搜索服务,会在模型代搜之前搜索。标价:{{prices}}。套餐和实际账单可能不同。","price": "${{usd}} / 千次",+ "free": "免费",+ "freeTier": "免费;按 IP 限流","vendorPrice": "{{vendor}} ${{usd}} / 千次","priceDate": "API 标价 · {{date}}","priceNote": "价格为目录标注日期的 API 标价,免费额度、套餐与实际账单可能不同。",@@ -2554,6 +2556,9 @@"added": "已添加","inOrder": "已在搜索顺序中","addedUnused": "已添加 · 未用于搜索",+ "builtIn": "已内置 · 免费",+ "viewOrder": "查看搜索顺序",+ "noSetup": "无需密钥或设置","openDetail": "管理 {{vendor}}","maxResults_one": "最多 {{count}} 条结果","maxResults_other": "最多 {{count}} 条结果",@@ -2582,10 +2587,14 @@"monthEstimate": "按 API 标价估算 {{usd}}","monthReported": "厂商报告 {{usd}}","openUsage": "查看用量",+ "vendorName": {+ "exa-mcp": "Exa(免费)"+ },"vendor": {"deepseek": "通过官方 DeepSeek 供应商搜索,有结果才计费,空结果、失败和超时不计费。","tavily": "为 AI Agent 设计的基础网页搜索,返回与搜索词相关的片段。",- "exa": "语义网页搜索,查询相关的高亮片段已包含在搜索价格中。"+ "exa": "语义网页搜索,查询相关的高亮片段已包含在搜索价格中。",+ "exa-mcp": "无需密钥的 Exa 搜索,免费但按 IP 限流;无需设置。"}},"capability": {@@ -5105,6 +5114,7 @@"service_balance": "搜索服务账户余额不足。","service_limit": "搜索服务已达到用量上限。","service_unavailable": "搜索服务暂时不可用。",+ "service_rate_limited": "搜索服务受到限流,已尝试下一个来源。","service_refused": "搜索服务拒绝了这次搜索。","service_unreadable": "搜索服务返回了无法读取的结果。","search_query_too_long": "搜索词太长,请缩短后重试。",@@ -5138,6 +5148,7 @@"service_balance": "余额不足","service_limit": "已达用量上限","service_unavailable": "暂时不可用",+ "service_rate_limited": "受到限流,已尝试下一个来源","service_refused": "拒绝了这次搜索","service_unreadable": "返回了无法读取的结果"},diff --git a/vibe/data/api_key_vendors.json b/vibe/data/api_key_vendors.jsonindex bb6747742..ffe8dd20d 100644--- a/vibe/data/api_key_vendors.json+++ b/vibe/data/api_key_vendors.json@@ -232,5 +232,52 @@"billing": {"nonempty_only": false, "unbilled_errors": []},"tool_only": true}+ },+ {+ "id": "exa-mcp",+ "label": "Exa (free)",+ "official_base_url": "https://mcp.exa.ai/mcp",+ "protocol": "search",+ "built_in": true,+ "search": {+ "service_id": "exa/mcp",+ "endpoint": "https://mcp.exa.ai/mcp?tools=web_search_advanced_exa,web_fetch_exa",+ "auth": "none",+ "request": {+ "method": "POST",+ "query": "query",+ "results": "numResults",+ "defaults": {+ "type": "auto",+ "enableHighlights": true,+ "highlightsMaxCharacters": 1000,+ "textMaxCharacters": 1+ }+ },+ "result": {+ "results": "results",+ "url": "url",+ "title": "title",+ "snippet": "highlights",+ "page_age": "publishedDate"+ },+ "limits": {+ "results_min": 1,+ "results_max": 100,+ "query_max_chars": null+ },+ "price": {+ "unit": "search",+ "usd_per_1k": 0,+ "extra": [],+ "as_of": "2026-10-22",+ "url": "https://exa.ai/docs/get-started/exa-mcp#authentication"+ },+ "free_check": null,+ "service_refused_statuses": [403],+ "outcomes": {"credential": [], "balance": [], "limit": []},+ "billing": {"nonempty_only": false, "unbilled_errors": []},+ "tool_only": true+ }}]diff --git a/vibe/data/api_key_vendors.schema.json b/vibe/data/api_key_vendors.schema.jsonindex 34dcd9003..08e419284 100644--- a/vibe/data/api_key_vendors.schema.json+++ b/vibe/data/api_key_vendors.schema.json@@ -15,6 +15,7 @@"label": {"type": "string", "minLength": 1},"official_base_url": {"type": "string", "format": "uri", "pattern": "^https://"},"protocol": {"enum": ["anthropic", "openai_responses", "openai_chat", "google", "search"]},+ "built_in": {"type": "boolean"},"models_dev_provider": {"type": ["string", "null"]},"search": {"type": ["object", "null"],@@ -33,7 +34,7 @@"properties": {"service_id": {"type": "string", "minLength": 1},"endpoint": {"type": "string", "format": "uri", "pattern": "^https://"},- "auth": {"enum": ["bearer", "x-api-key"]},+ "auth": {"enum": ["bearer", "x-api-key", "none"]},"request": {"type": "object"},"result": {"type": "object",diff --git a/vibe/i18n/en.json b/vibe/i18n/en.jsonindex a26a07fda..dd222f842 100644--- a/vibe/i18n/en.json+++ b/vibe/i18n/en.json@@ -1864,6 +1864,7 @@"service_balance": "the search service account has no balance","service_limit": "the search service limit has been reached","service_unavailable": "the search service is unavailable",+ "service_rate_limited": "the search service is rate-limited; the next source was tried","service_refused": "the search service refused this query","service_unreadable": "the search service returned an unreadable response","search_query_too_long": "the search query is too long; shorten it and try again",@@ -1917,6 +1918,7 @@"service_balance": "is out of balance","service_limit": "reached its usage limit","service_unavailable": "was unavailable",+ "service_rate_limited": "was rate-limited; the next source was tried","service_refused": "refused this query","service_unreadable": "returned an unreadable response"},diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.jsonindex 2537aa6e5..1149a7a71 100644--- a/vibe/i18n/zh.json+++ b/vibe/i18n/zh.json@@ -1864,6 +1864,7 @@"service_balance": "搜索服务账户余额不足","service_limit": "搜索服务已达到用量上限","service_unavailable": "搜索服务暂时不可用",+ "service_rate_limited": "搜索服务受到限流,已尝试下一个来源","service_refused": "搜索服务拒绝了这次搜索","service_unreadable": "搜索服务返回了无法读取的结果","search_query_too_long": "搜索词太长,请缩短后重试",@@ -1917,6 +1918,7 @@"service_balance": "余额不足","service_limit": "已达用量上限","service_unavailable": "暂时不可用",+ "service_rate_limited": "受到限流,已尝试下一个来源","service_refused": "拒绝了这次搜索","service_unreadable": "返回了无法读取的结果"},diff --git a/vibe/model_hub_runtime/api_key_vendors.py b/vibe/model_hub_runtime/api_key_vendors.pyindex 41dee79dd..45485a12e 100644--- a/vibe/model_hub_runtime/api_key_vendors.py+++ b/vibe/model_hub_runtime/api_key_vendors.py@@ -147,6 +147,8 @@ class APIKeyVendorCatalogEntry:# The models.dev provider whose entries describe what this vendor's# official endpoint accepts; ``None`` when no mapping has been verified.models_dev_provider: str | None = None+ # Built-ins are catalog rows, not addable API-key vendors.+ built_in: bool = False# Bundled wire metadata, never supplied by a caller or a remote catalog.search: dict | None = None@@ -155,7 +157,7 @@ def _catalog_path() -> Path:return Path(__file__).resolve().parents[1] / "data" / "api_key_vendors.json"-def _validate_search_catalog(item: object, *, protocol: str) -> dict[str, Any] | None:+def _validate_search_catalog(item: object, *, protocol: str, built_in: bool = False) -> dict[str, Any] | None:if item is None:return Noneif not isinstance(item, dict):@@ -170,7 +172,7 @@ def _validate_search_catalog(item: object, *, protocol: str) -> dict[str, Any] |raise ValueError("api-key vendor search catalog endpoint is invalid")if not isinstance(item.get("service_id"), str) or not item["service_id"].strip():raise ValueError("api-key vendor search catalog service id is invalid")- if item.get("auth") not in {"bearer", "x-api-key"} or not isinstance(item.get("request"), dict) or not isinstance(item.get("result"), dict) or not isinstance(item.get("limits"), dict):+ if item.get("auth") not in {"bearer", "x-api-key", "none"} or (item.get("auth") == "none" and not built_in) or not isinstance(item.get("request"), dict) or not isinstance(item.get("result"), dict) or not isinstance(item.get("limits"), dict):raise ValueError("api-key vendor search catalog mapping is invalid")if "reported_cost" in item["result"]:reported_cost = item["result"]["reported_cost"]@@ -271,7 +273,10 @@ def api_key_vendor_catalog() -> tuple[APIKeyVendorCatalogEntry, ...]:)):raise ValueError("api-key vendor catalog is invalid")- search = _validate_search_catalog(item.get("search"), protocol=protocol)+ built_in = item.get("built_in", False)+ if not isinstance(built_in, bool) or (built_in and protocol != "search"):+ raise ValueError("api-key vendor catalog is invalid")+ search = _validate_search_catalog(item.get("search"), protocol=protocol, built_in=built_in)if search is not None and search["service_id"] in seen_service_ids:raise ValueError("api-key vendor catalog is invalid")entries.append(@@ -282,6 +287,7 @@ def api_key_vendor_catalog() -> tuple[APIKeyVendorCatalogEntry, ...]:protocol=protocol,models_dev_provider=models_dev_provider.strip() if models_dev_provider else None,search=search,+ built_in=built_in,))seen_ids.add(vendor_id)