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
chore(agents): drop every pre-release compatibility path on avibe-agent (#2386)
Call Whitee4d37520321f
diff --git a/config/v2_config.py b/config/v2_config.pyindex e80c59bab..b6334afeb 100644--- a/config/v2_config.py+++ b/config/v2_config.py@@ -206,7 +206,7 @@ def normalize_model_hub_vendor_id(value: object) -> str:def validate_model_hub_protocol_vendor(vendor: str, protocol: str) -> None:- """Keep Google's v12 explicit custom admission consistent across consumers."""+ """Keep Google's v11 explicit custom admission consistent across consumers."""if protocol == "google" and vendor != "custom":raise ValueError("Google Sources require the custom vendor")diff --git a/config/v2_settings.py b/config/v2_settings.pyindex b0b9968a2..edf148462 100644--- a/config/v2_settings.py+++ b/config/v2_settings.py@@ -11,7 +11,7 @@ from pathlib import Pathfrom typing import Dict, List, Optional, Tuplefrom config import paths-from modules.agents.catalog import AGENT_BACKENDS, NATIVE_CLI_BACKENDS+from modules.agents.catalog import NATIVE_CLI_BACKENDSlogger = logging.getLogger(__name__)@@ -167,7 +167,7 @@ def normalize_routing_settings(routing: Optional[RoutingSettings]) -> RoutingSetif routing is None:return RoutingSettings()agent_name = getattr(routing, "agent_name", None)- builtin_agent_backend = agent_name if agent_name in AGENT_BACKENDS else None+ builtin_agent_backend = agent_name if agent_name in NATIVE_CLI_BACKENDS else Nonemodel = getattr(routing, "model", None)reasoning_effort = getattr(routing, "reasoning_effort", None)return RoutingSettings(@@ -206,7 +206,7 @@ def routing_reasoning_effort_for_backend(def _routing_backend_matches(routing: RoutingSettings, backend: Optional[str]) -> bool:agent_name = getattr(routing, "agent_name", None)- if agent_name in AGENT_BACKENDS:+ if agent_name in NATIVE_CLI_BACKENDS:return agent_name == backendreturn Truediff --git a/core/agent_core/ai/sse.py b/core/agent_core/ai/sse.pyindex 5fa039664..23a28e7ce 100644--- a/core/agent_core/ai/sse.py+++ b/core/agent_core/ai/sse.py@@ -31,12 +31,6 @@ class SSEEvent:event_id: str | None = Noneretry: int | None = None- @property- def id(self) -> str | None:- """Compatibility alias for callers using the SSE field name."""-- return self.event_id-class SSEParser:"""Parse an SSE byte or text stream incrementally."""diff --git a/core/agent_core/harness/projection.py b/core/agent_core/harness/projection.pyindex 5a2d83ad1..f80d804bc 100644--- a/core/agent_core/harness/projection.py+++ b/core/agent_core/harness/projection.py@@ -219,11 +219,10 @@ _PAYLOAD_SHAPES: dict[str, Check] = {"tokens_before": _count,"tokens_after_estimate": _count,"threshold": _integer,+ "kept_inputs": _list(lambda value: _integer(value) and value > 0),},{"previous_compaction_id": _nullable(_string),- # Optional: a row without it keeps no inputs, as rows written before the field existed behave.- "kept_inputs": _list(lambda value: _integer(value) and value > 0),"summarizer": _nullable(_object({"origin": _reads(origin_from_dict), "prompt_version": _string, "rounds": _count})),@@ -326,7 +325,7 @@ def context_view(entries: Sequence[ContextEntry], *, fork_point: Optional[int] =if compaction is not None:# The checkpoint's cut fell inside the in-flight Turn: each of its inputs, the first and every steer, stays as# it was, in order, before the checkpoint and the kept rows (C-9 context.md section 5).- kept = kept_inputs(compaction, inputs, first_is_input=bool(units) and units[0].lead.kind == "input")+ kept = list(compaction.payload["kept_inputs"])if any(seq not in inputs for seq in kept) or kept != sorted(set(kept)):raise ProjectionError(f"compaction row {compaction.row_id} keeps inputs it cannot place: {kept}")units[:0] = [Unit(seq, ((inputs[seq], inputs[seq].message),)) for seq in kept]@@ -346,15 +345,6 @@ def context_view(entries: Sequence[ContextEntry], *, fork_point: Optional[int] =)-def kept_inputs(compaction: ContextEntry, inputs: Mapping[int, ContextEntry], *, first_is_input: bool) -> list[int]:- """The inputs a checkpoint row keeps: its ``kept_inputs``; a row written before that field kept the latest input- before its ``first_kept_seq`` when its cut fell inside a turn (the first kept unit is not an input), and the same- rule reads it now. ``inputs``: the input rows before ``first_kept_seq``, by ``context_seq``."""- if "kept_inputs" in compaction.payload:- return list(compaction.payload["kept_inputs"])- return [max(inputs)] if inputs and not first_is_input else []--def project(entries: Sequence[ContextEntry],*,diff --git a/core/handlers/model_hub/adapter.py b/core/handlers/model_hub/adapter.pyindex 2c68c625d..a02edf915 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 v12 (2026-10-02).+"""Model Hub EngineAdapter interface. FINAL CONTRACT v11 (2026-10-02).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/provenance.py b/core/handlers/model_hub/provenance.pyindex 3cdbe11af..0e4b43095 100644--- a/core/handlers/model_hub/provenance.py+++ b/core/handlers/model_hub/provenance.py@@ -2340,7 +2340,7 @@ class TurnCorrelationRegistry:self.store.put({- "contract_version": 12,+ "contract_version": 11,"turn_id": normalized_turn_id,"ts": ts or _utc_now_iso(),"agent": trace.agent,diff --git a/core/handlers/model_hub/service.py b/core/handlers/model_hub/service.pyindex 1221733df..1e017c6a8 100644--- a/core/handlers/model_hub/service.py+++ b/core/handlers/model_hub/service.py@@ -174,7 +174,7 @@ from .usage import (local_usage_day,)-CONTRACT_VERSION = 12+CONTRACT_VERSION = 11def seeded_source_name(vendor: str) -> str:@@ -276,8 +276,8 @@ _MODELS_DEV_CANDIDATE_FIELDS = ()-AGENT_CHAIN_CONTRACT_VERSION = 12-PROBE_RESULT_CONTRACT_VERSION = 12+AGENT_CHAIN_CONTRACT_VERSION = 11+PROBE_RESULT_CONTRACT_VERSION = 11_SOURCE_DISCOVERY_TIMEOUT_SECONDS = 15_SOURCE_PROBE_TIMEOUT_SECONDS = 60_REORDER_ORDER_UNSET = object()@@ -957,7 +957,7 @@ def _runtime_payload(status: EngineStatus, *, enabled: bool) -> dict:manager = EngineRuntimeManager()return {- "contract_version": 12,+ "contract_version": 11,"enabled": enabled,"host_platform": status.host_platform or manager.host_platform(),"manifest": manager.contract_manifest(),@@ -1939,7 +1939,7 @@ class ModelHubService:if pinned_protocol is not None:return (pinned_protocol,)if vendor == "custom":- # Google is explicit API/config admission in v12, not a new+ # Google is explicit API/config admission in v11, not a new# automatic probe or picker option. Its generation path needs# a model, which non-inference observation must not invent.return tuple(protocol for protocol in SOURCE_PROTOCOLS if protocol != "google")diff --git a/core/handlers/settings_handler.py b/core/handlers/settings_handler.pyindex f25acd479..bdded22df 100644--- a/core/handlers/settings_handler.py+++ b/core/handlers/settings_handler.py@@ -7,6 +7,7 @@ from typing import Optionalfrom modules.agents import get_agent_display_namefrom modules.agents.catalog import (AGENT_BACKENDS,+ NATIVE_CLI_BACKENDS,display_name_for_backend,implicit_default_rank,is_builtin_backend,@@ -552,7 +553,7 @@ class SettingsHandler(BaseHandler):if not agent_name:return Nonename = str(agent_name)- if name in AGENT_BACKENDS:+ if name in NATIVE_CLI_BACKENDS:return namestore = getattr(self.controller, "vibe_agent_store", None)if store is None:@@ -568,7 +569,7 @@ class SettingsHandler(BaseHandler):def _routing_target_from_row(row: dict) -> tuple[str, str, str, str, str]:backend = str(row.get("agent_backend") or "").strip()agent_name = str(row.get("agent_name") or "").strip()- if not agent_name and backend in AGENT_BACKENDS:+ if not agent_name and backend in NATIVE_CLI_BACKENDS:agent_name = backendvariant = str(row.get("agent_variant") or "").strip()if variant == backend and agent_name == backend:diff --git a/core/vibe_agents.py b/core/vibe_agents.pyindex 498f6a7a8..2dafa7b15 100644--- a/core/vibe_agents.py+++ b/core/vibe_agents.py@@ -900,18 +900,9 @@ class VibeAgentStore:return agentdef require_reference(self, name: str) -> VibeAgent:- """Resolve a durable Agent reference, including a disabled archive.+ """Resolve a durable Agent reference, including a disabled archive."""- Routing can hold a backend id, for example while the built-in has the next free name- because a user's Agent holds the id: when no Agent has the name, it means the backend's- built-in Agent.- """-- agent = self.get(name)- backend = str(name or "").strip()- if agent is None and backend in AGENT_BACKENDS:- agent = self.get_builtin_default_agent_for_backend(backend, enabled_only=False)- return self._require_reference_agent(agent if agent is not None else self.require(name))+ return self._require_reference_agent(self.require(name))def routing_name_for_backend(self, backend: str) -> str:"""The Agent name a backend choice routes to: its built-in Agent's, whatever the row is called."""@@ -1706,8 +1697,8 @@ class VibeAgentStore:f"agent '{agent_name}' already exists with backend '{existing.backend}', "f"cannot use it as the built-in default for '{backend}'")- if existing.source != "builtin":- # A user's Agent keeps its own identity.+ if not is_builtin_default_agent(existing):+ # An Agent that is not the built-in keeps its own identity.return existingreturn self._write_builtin_state(existing, metadata={**existing.metadata, **metadata})return self.create(@@ -1749,11 +1740,10 @@ class VibeAgentStore:if not is_builtin_default_agent(agent):return agent- always_enabled = is_always_enabled_agent(agent)- backend_enabled = bool(backend_enabled) or always_enabled+ backend_enabled = bool(backend_enabled) or is_always_enabled_agent(agent)previous_backend_enabled = agent.metadata.get(BUILTIN_BACKEND_ENABLED_META_KEY)metadata = {**agent.metadata, BUILTIN_BACKEND_ENABLED_META_KEY: backend_enabled}- should_enable = (backend_enabled and previous_backend_enabled is not True) or (always_enabled and not agent.enabled)+ should_enable = backend_enabled and previous_backend_enabled is not Trueshould_disable = not backend_enabled and agent.enabledenabled: Any = True if should_enable else False if should_disable else _UNSETreturn self._write_builtin_state(agent, metadata=metadata, enabled=enabled)@@ -1797,12 +1787,9 @@ class VibeAgentStore:def get_builtin_default_agent_for_backend(self, backend: str, *, enabled_only: bool = True) -> Optional[VibeAgent]:"""The backend's built-in Agent: the one owner of built-in identity.- It is a row the store created for the backend (``source == "builtin"``, which no- caller can write), under any name; its markers are only a projection the sync- keeps current. A marked row wins over one an earlier build left without- markers, then the oldest. The legacy instance default, also store-made, is a- backend's built-in only if marked. ``enabled_only`` reports a disabled one as- missing.+ It is the oldest row the store created and marked for the backend+ (``is_builtin_default_agent``; no caller can write either), under any name.+ ``enabled_only`` reports a disabled one as missing."""backend = validate_agent_backend(backend)with self.engine.connect() as conn:@@ -1811,15 +1798,7 @@ class VibeAgentStore:.where(agents.c.backend == backend, agents.c.source == "builtin", agents.c.archived_at.is_(None)).order_by(agents.c.created_at, agents.c.id)).mappings().all()- built_in = min(- (- agent- for agent in map(self._from_row, rows)- if _has_builtin_markers(agent) or agent.normalized_name != DEFAULT_AGENT_NAME- ),- key=lambda agent: not _has_builtin_markers(agent),- default=None,- )+ built_in = next((agent for agent in map(self._from_row, rows) if _has_builtin_markers(agent)), None)if built_in is None or (enabled_only and not built_in.enabled):return Nonereturn built_indiff --git a/docs/plans/agent-core-contracts/context.md b/docs/plans/agent-core-contracts/context.mdindex cc619dc60..fe17cc05b 100644--- a/docs/plans/agent-core-contracts/context.md+++ b/docs/plans/agent-core-contracts/context.md@@ -146,8 +146,7 @@ environment blocks included, right before the checkpoint message and the kept roThe checkpoint summarizes everything else in the head, and a later checkpoint inside the same Turn keeps them again.In a later run they are ordinary history, yet no cut falls between them: one there would make an old input's seq thenew `first_kept_seq` and bring back what that checkpoint summarized, so cuts start at the first unit after them.-`kept_inputs` is optional: a row written before it kept the latest input before its `first_kept_seq` when its cut-fell inside a turn (the first kept unit is not an input), and projection reads such a row by the same rule. An earlier Turn a cut splits is summarized like any head. If the kept inputs alone cannot fit, nothing can move them+An earlier Turn a cut splits is summarized like any head. If the kept inputs alone cannot fit, nothing can move themout, and §8 (d) applies.## 6. Checkpoint turndiff --git a/docs/plans/agent-core-contracts/transcript-rows.schema.json b/docs/plans/agent-core-contracts/transcript-rows.schema.jsonindex 767ebc6d4..43926c21b 100644--- a/docs/plans/agent-core-contracts/transcript-rows.schema.json+++ b/docs/plans/agent-core-contracts/transcript-rows.schema.json@@ -130,6 +130,7 @@"checkpoint","state","first_kept_seq",+ "kept_inputs","summarized_to_seq","files_read","files_read_omitted",@@ -186,7 +187,7 @@"type": "integer","minimum": 1},- "description": "`context_seq` of each input of the in-flight Turn (its first and every accepted steer) before `first_kept_seq`, ascending: projection keeps them verbatim, in order, right before this row's message (context.md section 5). Empty when the cut did not fall inside that Turn; optional: a row without it, written before the field, keeps the latest input before `first_kept_seq` when the first kept unit is not an input, as it was written."+ "description": "`context_seq` of each input of the in-flight Turn (its first and every accepted steer) before `first_kept_seq`, ascending: projection keeps them verbatim, in order, right before this row's message (context.md section 5). Empty when the cut did not fall inside that Turn."},"summarized_to_seq": {"type": "integer",diff --git a/docs/plans/avibe-agent-always-on.md b/docs/plans/avibe-agent-always-on.mdindex 292627aef..dc5c10420 100644--- a/docs/plans/avibe-agent-always-on.md+++ b/docs/plans/avibe-agent-always-on.md@@ -2,7 +2,7 @@## Owner decision (2026-10-06)-Vibey (then the Avibe Agent) is Avibe's own agent and takes part in the platform's core operation. It is listed first in every+Vibey is Avibe's own agent and takes part in the platform's core operation. It is listed first in everybackend list, it is always enabled, and it cannot be turned off.## Change contract@@ -21,24 +21,23 @@ backend list, it is always enabled, and it cannot be turned off.(`resolve_effective_default_agent`, `_effective_default_agent`), the per-principal fallback(`resolve_usable_default_agent`), the archived default's replacement after its same-backend preference, and theIM routing modal's fallback selection.-- **Always on, by construction.** The built-in backend has no `agents.<id>` section: `AvibeAgentConfig` (pre-release- `agents.avibe`), its compat projection and every branch reading it are removed. A config written by an earlier build loads unchanged otherwise and drops the key on- its next save. The controller registers the adapter at startup and never unregisters it; runtime renewal is a no-op- for it.-- **Built-in Agent.** `get_builtin_default_agent_for_backend` is the one owner of built-in identity: the row the store- created for the backend (`source == "builtin"`, which no caller can write), under any name. A marked row wins, then- the oldest; the legacy instance default (`default`) counts only if marked. The built-in markers (`builtin`,- `builtin_default`, `lock_delete`, `backend_enabled`) are a projection only the store writes: `create` and `update`- drop them from caller metadata and keep the row's own. `ensure_builtin_default_agents` always includes the built-in- backend, restores the markers of whatever row the lookup names and re-enables it, so the row exists and is enabled- when controller startup's sync returns (Model Hub seeds the Vibey supply onto it next). Without such a row it is- created at its backend id (`vibey`), or at the next free name (`vibey-2`) when a user's Agent holds `vibey`.+- **Always on, by construction.** The built-in backend has no `agents.<id>` section; like any unknown `agents.*` key,+ one in a config file or a `POST /api/config` body is ignored and never saved. The controller registers the adapter at+ startup and never unregisters it; runtime renewal is a no-op for it.+- **Built-in Agent.** `get_builtin_default_agent_for_backend` is the one owner of built-in identity: the oldest row the+ store created and marked for the backend (`source == "builtin"` and the built-in markers, neither of which a caller+ can write), under any name; the released legacy instance default (`default`) counts only if marked. The built-in+ markers (`builtin`, `builtin_default`, `lock_delete`, `backend_enabled`) are a projection only the store writes:+ `create` and `update` drop them from caller metadata and keep the row's own. `ensure_builtin_default_agents` always+ includes the built-in backend and creates its row when it is missing, so the row exists and is enabled when controller+ startup's sync returns (Model Hub seeds the Vibey supply onto it next). It is created at its backend id (`vibey`), or+ at the next free name (`vibey-2`) when a user's own Agent, which a released build may hold, already has `vibey`.`VibeAgentStore.update` refuses to disable it (`agent_always_enabled`); its model, effort, prompt and description stay editable.- **Backend choices route to the built-in.** A routing picker that chooses a backend saves that backend's built-in- Agent's name (`VibeAgentStore.routing_name_for_backend`), never the backend id; a saved backend id that names no- Agent resolves to the backend's built-in Agent.-- **Refusals.** `POST /api/config` with `agents.vibey` returns 400 (`errors.builtinBackendConfig`, in the configured- language); `PATCH /api/agents/<built-in name>` (`vibey` on a fresh install) with `enabled: false` returns 400+ Agent's name (`VibeAgentStore.routing_name_for_backend`), never the backend id. A routing value that equals a backend+ id stands for that backend only for the native backends, whose released routing can hold one; `vibey` in routing is+ always an Agent name.+- **Refusal.** `PATCH /api/agents/<built-in name>` (`vibey` on a fresh install) with `enabled: false` returns 400`agent_always_enabled`; the CLI reports the same code.- **UI.** The built-in backend shows a "Built-in" badge where other backends have their enable switch, in the list andon its page. The built-in Agent's enable switch is locked on. Users meet the backend as Vibey (the catalog'sdiff --git a/docs/plans/avibe-agent-core.md b/docs/plans/avibe-agent-core.mdindex 970fac9d4..34dc57e6c 100644--- a/docs/plans/avibe-agent-core.md+++ b/docs/plans/avibe-agent-core.md@@ -9,8 +9,8 @@ Status: **Approved direction, contracts in draft** · 2026-10-02## 0. Decision summaryAvibe builds its own first-party Agent in Python, inside this repository, as a fourth backend next to Claude Code,-Codex, and OpenCode. Its backend id is `vibey`, which is also its built-in Agent's name, and users meet it as "Vibey"-(renamed from `avibe` before release). "Avibe Agent" remains the engine's name in these plans. It reaches models through+Codex, and OpenCode. Its backend id is `vibey`, which is also its built-in Agent's name, and users meet it as "Vibey".+"Avibe Agent" remains the engine's name in these plans. It reaches models throughModel Hub in each vendor's native protocol, and Avibe can steer, fork, resume, and manage its context directly.Sourcing, by layer:diff --git a/docs/plans/avibe-agent-registration-fixtures.md b/docs/plans/avibe-agent-registration-fixtures.mddeleted file mode 100644index 30be67086..000000000--- a/docs/plans/avibe-agent-registration-fixtures.md+++ /dev/null@@ -1,171 +0,0 @@-# Avibe Agent registration: test fixture inventory--Inventory date: 2026-10-02.--The first `rg` pass searched `tests/**/*.py` and fixture JSON/YAML for the-exact backend ids. An AST pass then retained literal lists, tuples, sets, and-dict keys containing at least two distinct ids. The baseline scan found 328 Python container-sites in 87 Python files, plus two relevant JSON fixtures. Nested containers-with the same purpose are grouped below. Function-call arguments, per-record-mapping values, provider/model text, and scenario records are excluded unless-the enclosing container is itself a backend membership fixture.--Locators below refer to that baseline. This inventory records final decisions,-not pending recommendations. Native sample fixtures do not declare the Agent-universe. In particular, native inherited/default routes and Direct mode must-not be widened to Avibe's explicit-route-only C-4 contract.--The decision boundary is:--- `AGENT_BACKENDS`: Agent creation, routing, listings, Model Hub consumers,- shared prompt/output behavior, and ordinary IM selectors. These sites gain- `avibe`.-- `NATIVE_CLI_BACKENDS`: CLI presence, install, OAuth, native session/process- discovery, direct mode, restart, native files, and native-only protocol- behavior. These remain native.-- A fixed native subset or released compatibility shape stays literal when the- test is intentionally proving that subset or historical data shape.--Parent updates already applied and therefore not pending in this inventory:--- `tests/test_agent_service.py` uses `AGENT_BACKENDS`.-- `tests/test_v2_config_platform_registry.py` compares against- `list(AGENT_BACKENDS)`.-- `tests/test_v2_compat_platforms.py` covers the compat `None` lifecycle.-- `tests/test_backend_restart.py` uses the catalog-derived optional-backend- snapshot.-- `core/backend_restart.py` no longer carries the obsolete native pair.-- `tests/test_model_hub_failure_presentation.py` uses `AGENT_BACKENDS` for the- shared failure/evidence projection; its native HTTP recorder pair remains- native-only.-- `tests/test_prompt_render_export.py` uses `AGENT_BACKENDS` for generic- product/parameterization sites; its approved-guidance digest remains a- historical native-only fixture.--## A. Agent-surface candidates: final disposition--| File and literal site | Updated to catalog or intentionally retained native scope |-| --- | --- |-| `tests/e2e/test_model_hub_migration_persisted.py:34`, `_seed_hub` | Retained native credential-migration setup; no in-process native credential store is invented. |-| `tests/scenario_harness/model_hub.py:306`, `config_with_sources` | Retained native seed map. `ModelHubConfig` already supplies the empty Avibe row, and Avibe explicit-route consumers populate it. This is not an exhaustive-map assertion. |-| `tests/scenario_harness/model_hub_native_oauth.py:82`, `MemoryStore.__init__` | Retained native OAuth setup; maps at 131 and 209 are credential subsets. |-| `tests/scenarios/model_hub/test_model_hub_configured_route_scenarios.py:72,108,140,182,233` | Retained native automatic/passthrough/default routing and Hub/Direct products. Avibe intentionally does not inherit native routes. |-| `tests/scenarios/model_hub/test_model_hub_live_resolution_scenarios.py:231,234`, `_config`; `397,405-414`, gateway switch; `1360`, unlisted model | Retained native requested-model/protocol fixtures, Direct-to-Hub switch, and native-launch refusal. Avibe has no native requested-model fallback. |-| `tests/scenarios/model_hub/test_model_hub_migration_scenarios.py:56,720-721,818` | Retained native vendor catalog placement, credential migration and adoption-mode assertions. |-| `tests/test_api_save_config_merge.py:62-83,169,1276` | Merge/deprecated-field and serializer completeness assertions now use `AGENT_BACKENDS` (plus `avault`). The old input payload deliberately omits Avibe and retains deprecated default-model fields to test compatibility. |-| `tests/test_controller_config_reload.py:21-26`; `tests/test_discord_guild_settings.py:25-30` | Retained released-compatible native config inputs, as detailed in C; omitted optional Avibe must still load. |-| `tests/test_backend_failure_retry.py:234` | Updated canonical-continue/draft matrix to `AGENT_BACKENDS`; native restart-receipt fixture at 99 is retained. |-| `tests/test_harness_failure_retry.py:133` | Retained native start-receipt lifecycle via `_bind_test_native_start`. Generic retry and callback settlement are expanded separately. |-| `tests/test_model_hub_api.py:142,4086,4135,4151,9833` | Catalog ID edit/admission/reload matrices use `AGENT_BACKENDS`. Retained MemoryStore native seed map and native automatic Source-order example; Avibe's normalized empty row and explicit routes are tested separately. |-| `tests/test_model_hub_api.py:1049`, `test_runtime_stop_protects_configured_avibe_models`; `4477-4486` and `4867-4876` | These already expose Avibe explicitly. Keep them as the boundary checks while deriving surrounding expected backend maps from the Agent catalog. |-| `tests/test_model_hub_avibe_consumer.py:705`, `test_terminal_response_origin_follows_its_carrier` | Already includes `avibe`; it is the correct shape for an all-Agent origin matrix. |-| `tests/test_model_hub_config.py:1410,3132,3154` | Serializer and empty-route normalization/recovery matrices now use `AGENT_BACKENDS`; native Direct-mode recovery expectations remain fixed. |-| `tests/test_model_hub_failure_presentation.py:44` | Parent updated the shared failure/evidence projection to `AGENT_BACKENDS`; its native HTTP recorder pair remains native-only. |-| `tests/test_model_hub_injection.py:267` | Explicit route-alias metadata matrix now uses `AGENT_BACKENDS`; native overlay assertions remain conditional. |-| `tests/test_model_hub_l3.py:691-695,1177` | Retained native requested-model and configured native-route templates, not exhaustive Agent membership assertions. |-| `tests/test_model_hub_resolution.py:317,456,2363` | Cross-backend Hub Source eligibility now uses `AGENT_BACKENDS`; retained native catalog/default seed and vendor placement examples (including 2377/2387). |-| `tests/test_model_hub_routing_modes.py:376,409,439,472,512,560,595,619,643,673,731,739,763,799` | Retained native inherited automatic/passthrough/default-route behavior, Hub/Direct products and native legacy-ID compatibility matrix. Avibe's explicit-route policy must not inherit those expectations. Line 457 is a historical native fixed-menu pair. Shared catalog admission now includes Avibe in `test_model_hub_api.py`. |-| `tests/test_prompt_render_export.py:100,154,180,210,223,259,287,310,522` | Parent audit already assigned all product/parameterization sites to `AGENT_BACKENDS`. Keep line 522, `test_approved_guidance_changes_preserve_all_other_injection_bytes`, as the historical native-only digest fixture. |-| `tests/test_runtime_ownership.py:303` | Shared AgentService probe loop uses `AGENT_BACKENDS`; actual OpenCode process-resource assertions in the same test remain native-specific. |-| `tests/test_scheduled_tasks.py:7434` | Callback terminal-once matrix now uses `AGENT_BACKENDS`; native binding example at 13055 remains fixed. |-| `tests/test_settings_handler.py:510-514,532,601,650,607-610` | Registered/enabled fixture and whole-set assertions derive from `AGENT_BACKENDS`; Avibe stays visible when native peers are disabled. Claude/Codex reasoning metadata remains a capability-specific expectation. |-| `tests/test_telegram_bot.py:1336,1434,1460,1498` | Routing fixture derives from `AGENT_BACKENDS`; fourth-backend picker cases exercise both Avibe and the unknown-extra-backend case. |-| `tests/test_ui_api.py:4183` | Built-in preference test now supplies `AGENT_BACKENDS`; fixed two-backend enablement examples at 4084/4092 remain. |-| `tests/test_managed_skills.py:709` | Backend-neutral prompt/skill matrix now uses `AGENT_BACKENDS` and actually passes the selected backend to the renderer (previously it rendered the same default three times). |--## B. Intentionally retained native capability fixtures--These fixtures retain their native literal memberships. They exercise CLI,-native files, credentials, session/process or protocol behavior, and are not-Agent-universe declarations. No Avibe native resource is fabricated.--| File and literal site | Native boundary |-| --- | --- |-| `tests/scenario_harness/auth_setup.py:13`, `save_direct_auth_config` | Direct-mode auth setup; Avibe only supports Hub mode. |-| `tests/test_agent_auth_service.py:41`, `_IsolatedClaudeConfigDirMixin.setUp` | Native auth isolation and Direct-mode setup. Lines `2421-2455` belong to the explicit C-8 classifier inventory and are excluded from this audit. |-| `tests/test_backend_connection.py:64`, `connection`; `152,160,187`; `255,263`; `885` | Native direct readiness, install application, disabled native configuration, and pending takeover. The separate Avibe connection test is already present at lines 436-460. |-| `tests/test_backend_restart.py:174-180,202` | Fixed native restart/IPC examples. The new catalog-derived optional-backend projection test covers Avibe's disabled state separately. |-| `tests/test_claude_cli_path.py:235-239,302` | Desktop/native executable resolution and missing private CLI selectors. |-| `tests/test_controller_model_hub_gate.py:147,338` | CLI presence probe and direct-mode fallback. Avibe has no CLI and cannot be forced into Direct mode. |-| `tests/test_desktop_backends.py:117,997` | Native install publication and private backend removal. |-| `tests/test_global_agents_md.py:90,136` | Global prompt files are owned by native CLI backends in production. |-| `tests/test_internal_client.py:372,378,380-383`; `tests/test_internal_server.py:846,852-856` | Backend restart/reconcile IPC contract; keep the selector native. |-| `tests/test_member_management_parity.py:168` | Native backend connection management route; Avibe has no native connection projection. |-| `tests/test_model_hub_api.py:820, runtime-stop branch`; `1041,1049,1064,1143,1524`; `2341,2681`; `5344,9629` | Fixed native Direct-mode setup, native protocol projection and recovery; explicit Avibe Hub-only cases remain in A. |-| `tests/test_model_hub_avibe_consumer.py:347,350`, native history; `897`, native transport clients | Explicit native callers do not carry Avibe origin metadata. |-| `tests/test_model_hub_retry_lifecycle.py:33-37`, `BACKENDS`; `156`, native failure recovery | Protocol endpoint map and native failure behavior are native-only. |-| `tests/test_native_login_single_flight.py:49`; `tests/test_settings_disk_fallback.py:38` | Native auth fixtures force Direct mode. |-| `tests/test_native_process_inventory.py:46,119,139,263,310,204,241` | Native executable/process inventory and smaller native credential subsets, not in-process runtime ownership. |-| `tests/test_native_session_providers.py:590` | Native session visibility and provider behavior. |-| `tests/test_native_takeover_lifecycle.py:28,138-139,492,526,584,699` | Native takeover journal, process inventory, auth service, and native writer ownership. |-| `tests/test_native_writer_custody.py:42,65,263` | Native credential custody and writer refusal. |-| `tests/test_ui_api.py:2263,2291,2314,2392,2440,2532` | Desktop install, private runtime ownership, update checks, and CLI path resolution. |-| `tests/test_ui_server_fastapi.py:2278`; `tests/test_ui_server_install.py:159,210` | Native runtime projection and installation jobs. |-| `tests/test_update_checker_platforms.py:1099-1103,1162` | Native package update and admission behavior. |-| `tests/test_web_oauth_flow.py:47,505` | Native Web OAuth setup and callback failure recovery. |--## C. Keep as intentional native-only, subset, or historical fixtures--These sites should not be expanded to an unimplemented in-process adapter.-They either encode a released shape, a credential store subset, a fixed native-vendor example, or a native adapter-specific comparison. They may retain-literal ids; where the test means “every native backend”, replacing the literal-with `NATIVE_CLI_BACKENDS` is optional only if it does not weaken the historical-or subset assertion.--| File and literal site | Why the native-only shape is intentional |-| --- | --- |-| `tests/e2e/test_api.py:14-19`, `_VALID_CONFIG`; `tests/test_controller_config_reload.py:21-26`; `tests/test_discord_guild_settings.py:25-30`; `tests/test_ui_server_mutation_protection.py:144-149,185-190,217-222,259-264,431-436` | Minimal/released-compatible config POST fixtures. They prove old payloads remain loadable; absent optional Avibe config is part of the compatibility contract. |-| `tests/fixtures/agent_registration/released_agents.json` | Released config snapshots with only native agent sections. Keep unchanged to prove missing optional Avibe loads disabled. |-| `tests/fixtures/model_hub/released_pre_avibe_consumer.json` and `tests/test_model_hub_avibe_consumer.py:538-539` | Pre-Avibe Model Hub snapshot. The test explicitly proves native rows are preserved and an empty Avibe row is added. |-| `tests/test_agent_organization_onboarding.py:82` | Explicit two-backend system-agent onboarding count fixture; it is a controlled example, not the Agent universe. |-| `tests/test_backend_model_catalog.py:1660,1678-1681`; `tests/test_latest_version_cache.py:177,182-185,245,264` | Native package/model cache neighbor fixtures. Avibe has no native CLI/latest probe. |-| `tests/test_model_hub_api.py:2295`, fixed Claude/Codex built-in catalogs; `2783`, provider candidate pair | Native fixed-menu/provider examples, not all Agent rows. |-| `tests/test_model_hub_config.py:1486`, legacy payload; `2747`, legacy Direct mode; `3166`, recovered native Direct modes | Released legacy/recovery shapes. They intentionally assert native rows stay Direct while Avibe stays Hub. |-| `tests/test_model_hub_config_read_compatibility.py:280` | Compatibility fixture for a native pending runtime service. |-| `tests/test_model_hub_l3.py:1258`, `_canonicalize_fixed_test_routes; 2259` | Fixed native menu route examples used by native resolution tests. |-| `tests/test_model_hub_migration_auth_mirror.py:54,84`; `tests/test_model_hub_migration_review_boundaries.py:135-152`; `tests/test_model_hub_migration_source_identity.py:29,83,207` | Native credential-file, journal-guard, and source-identity subsets. |-| `tests/test_model_hub_migration_custody_history.py:107,140,172,197,226,243,331,435,443` | OAuth custody/history examples deliberately cover Claude/Codex and selected OpenCode API-key combinations. |-| `tests/test_model_hub_native_takeover.py:28,175,271,430`; `tests/test_model_hub_takeover_integration.py:154`; `tests/test_model_hub_takeover_inventory.py:111` | Native takeover, credential cleanup, keychain, and journal fixtures. |-| `tests/test_model_hub_persisted_inventory.py:90,190-191,367-368`; `tests/test_model_hub_persisted_migration.py:139-151` | Shared credential consent examples for selected native stores. |-| `tests/test_model_hub_provenance.py:360` | Historical native catalog identity persisted in provenance. |-| `tests/test_model_hub_resolution.py:2377,2387` | Subscription vendor placement expected only for the fixed native vendor catalogs; Avibe has no such native vendor catalog. |-| `tests/test_model_hub_retry_policy.py:78,255`; `tests/test_opencode_model_hub_retry.py:65` | Native retry/protocol examples and cross-native launch comparison. |-| `tests/test_model_hub_runtime_default_upgrade.py:33,145-148,167,244,265,278` | Legacy on-disk upgrade fixtures intentionally omit Avibe, then assert the migration adds an empty Hub row without changing native Direct rows. |-| `tests/test_prepare_regression.py:230-234,282-286,301-305` | Regression layout/config fixtures for installed native executables. |-| `tests/test_save_opencode_provider_auth.py:484-489,718-723` | OpenCode provider-auth fixtures with disabled native peers; not a backend-universe selector. |-| `tests/test_session_fork.py:2113`; `tests/test_scheduled_tasks.py:13055` | Explicit native session/binding examples; product Session fork and Harness behavior are broader, but these fixtures exercise native ids and state. |-| `tests/test_skills_service.py:174,200-240,658,709-720,763,888,925` | CLI skill command arguments target the three native skill adapters. Do not add Avibe until an in-process skill adapter exists. |-| `tests/test_memory_removal.py:20,45` | Historical config includes native agent keys and the separate `avault` section while proving a retired top-level section is ignored. |-| `tests/test_model_hub_avibe_consumer.py:679-687` | Synthetic historical native provenance records intentionally omit Avibe origin fields. |-| `tests/e2e/test_model_hub_runtime.py:749,758` | Fixed native Direct-to-Hub switch setup and its three configured runtime blockers; empty Avibe does not block runtime stop. |-| `tests/test_agent_steering.py:288` | Constructs the real three native adapters and checks native attachment steering; no in-process adapter double is substituted. |-| `tests/test_cli_task_command.py:3652`; `tests/test_command_handler_user_names.py:760`; `tests/test_controller_im_ready.py:17`; `tests/test_controller_vibe_agent_routing.py:63,84,175`; `tests/test_runtime_activation.py:595`; `tests/test_slack_app_mention_empty.py:271` | Explicit two-native-Agent examples for default selection, cleanup, startup failures, legacy routing, activation and backend-switch isolation. They do not claim exhaustive backend membership. |-| `tests/test_incus_regression.py:1071` | Verifies installed native executable files, not Agent availability. |-| `tests/test_managed_skills.py:355,381,437` | Expected fixture skill names under native CLI home directories, not backend-universe declarations. |-| `tests/test_resume_session.py:106,176,276,299,320` | Fixed native session import/resume bindings and native hook implementations. |-| `tests/test_sqlite_sessions_store.py:679,1501,1874,4158,4285`; `tests/test_sqlite_state_migration.py:5968` | Native binding/legacy adoption and historical multi-backend native session-map conflicts. |--The following literal sites were intentionally not classified as backend-universe fixtures:--- `tests/test_backend_registration_contract.py:37-84` is the explicit C-8- classification inventory itself.-- `tests/test_model_hub_avibe_contract_matrix.py:88` scans schema membership- and already names all four backends; it is a contract expectation.-- `tests/test_agent_backend_catalog.py:22` and- `tests/test_v2_config_platform_registry.py` are already catalog-derived or- parent-fixed.-- Dicts that map one test record to a backend-specific object, such as the- controller/resume/session-store fixtures, are per-record data rather than- universe declarations.-- `tests/scenarios/**/catalog.yaml` backend fields identify individual- scenarios; they are not membership lists. Other YAML/JSON hits are prose,- observations, or single scenario records.--## Outcome--Each enumerated fixture is catalog-expanded or intentionally retained as a-native capability/example/historical shape. The production C-8 contract remains-the single automatic guard against unclassified backend declarations. Tests-do not invent native Avibe login, CLI, model defaults, Direct mode or sessions.diff --git a/docs/plans/avibe-agent-registration.md b/docs/plans/avibe-agent-registration.mddeleted file mode 100644index 54aab6b99..000000000--- a/docs/plans/avibe-agent-registration.md+++ /dev/null@@ -1,195 +0,0 @@-# Avibe Agent registration (C-8)--> Superseded in part by [`avibe-agent-always-on.md`](avibe-agent-always-on.md): the Avibe Agent is the built-in-> backend, always enabled, and `agents.avibe` no longer exists. The opt-in and disabled-state statements below are-> this lane's history.--## Change contract--Avibe Agent is an opt-in, in-process backend. The backend catalog declares the-Agent universe and the native-CLI subset. Agent creation, routing, listings,-configuration, Model Hub and ordinary IM selectors consume the Agent universe.-Native authentication, install/version probes, native session discovery/import,-native configuration files and manual process restart consume the CLI subset.--The existing backend cards, settings page, Agent picker and model-route controls-are reused. Catalog capabilities hide unsupported native operations. A checked-in-TypeScript projection of the Python catalog supplies frontend capabilities and-types; its exact contents are contract-tested.--Persisted configs without `agents.avibe` load with it disabled. The new section-contains only `enabled`. A successful enablement mutation uses the existing-controller reconciliation IPC path. Adapter registration and controller refresh-implementation belong to `feat/avibe-agent-adapter`.--## Validation boundaries--- Catalog/classification contract: all full-universe declarations equal the Agent- or CLI catalog set; explicit capability subsets/supersets retain their relation.- A newly introduced literal list must fail the inventory test.-- Released config fixtures and round trips: old backend settings remain unchanged,- absent Avibe stays off, invalid optional Avibe config recovers off on disk load.-- Agent store and run target: create, list, select and resolve an Avibe Agent using- temporary SQLite state. Existing tests cover only CLI-backed Agents.-- UI rendering: Avibe is selectable and configurable with no native action or CLI- probe; Model Hub exposes its existing backend model controls.-- Native boundaries: installing, authenticating, restarting or resuming a native- Avibe session is rejected before touching any native state.-- Changed-file Ruff, focused pytest/Vitest and UI production build; exact-head- Codex review, CI and unresolved-thread gates before delivery.--## Known by design--- No default model is invented for an empty Avibe model catalog. Model Hub owns- its available models and the selected Agent stores the model.-- Native resume modals in Slack/Discord/Feishu are not ordinary Agent pickers;- Avibe has no native session store and is excluded there.-- Product Session fork and Ask-in-new keep their existing UI. The adapter lane- supplies C-5 context anchors; native-session exclusion does not disable them.-- Native setup onboarding, import and global native prompt files remain CLI-only.-- No new visual element, dependency, production restart or merge is authorized.--## Validation recorded--- Catalog, config load, readiness and regression-script batch: 143 passed.-- Expanded config-save/API/auth/native-session/IM batch: 490 passed, 99 subtests.-- Routing, dispatch, C-8 inventory, Model Hub and IM batch: 176 passed, 2 subtests.-- UI focused suites, ESLint, test type checking and production build passed.-- Changed Python Ruff and whitespace checks passed.--These are hermetic boundary checks, not a live adapter/provider acceptance run.-The adapter dependency and a later integrated Incus acceptance pass remain-explicit handoff work; no local service was restarted.--## Review ledger--### Round 1 — `f5ea8124b`--One findings-bearing reviewed head; no repeated root-cause class and no-architecture rewrite. The circuit breaker has not tripped.--- Public-symbol migration: the only removed public Python name is- `core.vibe_agents.SUPPORTED_AGENT_BACKENDS`. Whole-repository search, including- tests, scripts and UI, found one stale consumer module:- `tests/test_agent_service.py` (import and parametrization). It now imports the- catalog directly. The contract document's historical mention remains prose,- not a caller. No compatibility alias is retained.-- No TypeScript public export was removed or renamed. `AssistantId`,- `ASSISTANT_ORDER`, the two `BACKEND_ORDER` exports, `Backend`, `BackendId`,- `OAuthBackend`, `AgentBackend`, `NativeCliBackend`, `AGENT_BACKENDS`,- `AGENT_ID_TO_BACKEND` and `backendsFromAgents` keep their public names and- derive/re-export the relevant catalog types. Private `BackendKey` and- `BackendOption` were removed; whole-repository search found no references.- Python `MODEL_HUB_BACKENDS`, script `SUPPORTED_BACKENDS`,- `recommended_agent_model` and `default_cli_for_backend` retain their names.-- Reproduction: `pytest --collect-only tests/test_agent_service.py` failed with- the reported import error before the fix. The complete file passes 104 tests- after the import correction, including Avibe model-selection cases.-- Backend brand ownership: all four backend display names belong to catalog- metadata and are locale-invariant product names. Translated surrounding- prose/descriptions remain in i18n. UI maps must project the catalog rather- than define a second literal name table; the redundant `avibeTitle` keys- are removed.-- CI native-boundary drift: widening `DirectHome` to all Agent backends caused- key coverage to expand a nonexistent Avibe Direct-mode description. The- native-only landing is narrowed again; no Avibe Direct key or test exception- is introduced.-- CI test registration: `test_v2_config_platform_registry` now compares the API- projection with the catalog. With the orchestrator's explicit authorization,- `tests/test_backend_registration_contract.py` is registered exactly once in- the **I7 contract-completion implementation (backend)** binding row of- `docs/plans/model-hub-implementation.md`; no checker/schema change was made.- The complete Model Hub/config/registration batch passes 202 tests locally,- including the O1 live ownership guard.-- Cross-lane integration, same round: disabled Avibe compat configuration must- be `None`, just like Codex/OpenCode, so rolling refresh unregisters it.- `AppCompatConfig.avibe` is optional and `to_app_config` creates it only when- enabled. The compat-boundary regression failed first on the disabled state;- prior config tests checked persisted fields, not the runtime absence sentinel.- A distinct coordinator projection regression failed first because its old- two-backend subset labeled disabled Avibe unavailable. That predicate now- uses the Agent catalog, retaining Claude's registered-with-flag exception.- Disabled optional backends are applied; enabled-but-unregistered backends- remain unavailable. The obsolete native-only classification was removed.-- Compat reader audit: current-tree `.avibe` attribute reads outside tests are- V2 config serialization/recovery, not the optional compat field. Dynamic- compat consumers in `AgentAuthService` resolve/load `None` safely, unregister- on absence, and skip absent auth-mirror targets; `SettingsHandler` reports- absent config disabled. The native process inventory's CLI-path fallback is- native-only and accepts absence. The coordinator snapshot is corrected above.- The adapter branch at the inspected remote SHA `b64957872` guards startup- registration with `getattr(config, "avibe", None)` and receives non-None config- for refresh registration. Its owner retains responsibility for the requested- `.enabled` guards and real-wiring enable/disable test; no adapter code changed- here. Compat/coordinator/connection/registration batch: 151 passed.-- Test-fixture enumeration is recorded in- [the fixture inventory](avibe-agent-registration-fixtures.md): the baseline- search covered 328 literal container sites in 87 Python files and two JSON- fixtures. A final AST pass also checks that every container-bearing test- file is represented. Shared serializers, prompt/skill renderers, retry,- callback, ownership probes, model catalog/metadata and IM picker matrices- now include Avibe through the catalog. Native inherited/passthrough routes,- Direct mode, native launch receipts, credentials and released inputs retain- their specific semantics; they are not generalized into invented Avibe- native behavior.--#### Backend display-name consumers--The shared path is `catalog.display_name` -> generated frontend projection ->-`AGENT_BACKENDS.label` -> `getBackendUiMeta` or derived `BACKEND_LABEL`.--| Surface | Enumerated rendering sites |-| --- | --- |-| Settings | `SettingsBackendsPage` row/configure label; `SettingsBackendPage` title/card; `BackendLifecycleChip`; `BackendRuntimeCard` through the generic page and all three native provider-config callers |-| Agent management | `NewAgentDialog` choices; `AgentsPage` group headings, filter trigger/items, import menu, import-none toast, detail prose; `GlobalPromptsDialog` native tabs/save/sync/effect; `AgentGraphOrphanStrip`; `ReadyBanner` |-| Model Hub | `AgentCard` headings/direct explanation; `SettingsModelsPage` Direct headings; `BackendSupplyModeCard`; `BackendModelCatalogDialog`; `BackendModelPickerDialog` title/builtin group; `BackendModelEditorDialog`; `SourceRow`; `SourceDetailPanel`; `SourceOrderDrawer`; `RouteChainDialog`; `RouteOriginBadge`; `GuardImpact`; `GuardGapList`; `MigrationDialog` |-| Onboarding and routing | `CollaborationStory` card/ARIA label; provider `DestinationRow`; `AssistantRow`; `BackendConnectionDialog`; `AgentDetection`; `UserList`; `ChannelList` |-| Python/IM | Slack/Discord/Feishu ordinary backend selectors; Telegram summary/inline/overflow picker; Slack/Feishu question titles; CLI doctor native-backend rows; Model Hub terminal-copy backend interpolation and blocked native-migration item names |--Removed duplicate locale keys (English and Chinese):-`settings.backends.avibeTitle`, `settings.models.backends.*`,-`onboarding.story.<native>.name`, and `agents.importFromClaude`,-`agents.importFromCodex`, `agents.importFromOpenCode`. Whole-UI search confirms-no remaining consumers. `agents.importFrom` localizes prose with backend-name-interpolation, never a display-name-derived key.--The orchestrator separately authorized catalog-only label projections/imports-in `core/handlers/model_hub/provenance.py` and-`core/handlers/model_hub/migration.py::_blocked_item`. Failure policy, vendor and-protocol mappings, Source subscription identities and non-brand copy keys are-unchanged. The three affected Model Hub fixture expectations were updated.-Python `modelHub.backends.*`, Telegram `backend.*`, and unused-`modal.question.*` brand keys were removed from both locale catalogs. Telegram's-existing overflow-picker regression first failed with `Backend: avibe`, then-passed with the catalog name.--The final repository-wide Python/TypeScript/JSON search finds no obsolete-brand-key consumers or competing rendered backend-name literals. Exact-name-hits outside the catalog/generated projection are independent test expectations,-non-rendered documentation comments, and the explicitly retained Source-subscription identities below.--Retained exceptions are Source subscription/vendor identities (`Claude`,-`ChatGPT`, etc.), complete localized native provider-page titles-(`SettingsClaudeProviderPage`, `SettingsCodexProviderPage`,-`SettingsOpencodeProviderPage`), authored-onboarding example prose/geometry, and diagnostic/monospace backend IDs. These-are not competing standalone backend display names.--UI regressions failed first for the old picker name, import-key construction,-and English/Chinese Model Hub brand ownership. Final validation: 173 focused-tests plus 2,142 Model Hub/onboarding/related tests; ESLint, test type checking-and production build pass. Existing key-coverage collector dedup fixtures remain;-the application case now guards native Direct descriptions and the absence of-an Avibe Direct key.--Additional round-1 final checks: 515 AgentService/prompt/config/Model Hub tests;-151 compat/coordinator/connection/registration tests; 20 catalog-ID cases;-11 shared delivery/ownership/default/eligibility cases; 8 planning-metadata-cases; and 269 doctor/Telegram/provenance/failure/migration/live-route tests.-These batches overlap earlier checks and are not a unique-test total.-The final i18n/migration batch passed 172 tests. Feishu/Slack routing fixture-files passed separately (8 and 7 tests): combining their existing module-level-`aiohttp` stubs with real HTTP scenario imports causes collection pollution,-so those isolated adapter fixtures were not used as a shared scenario harness.-No unrelated test bootstrap was changed.diff --git a/docs/plans/model-hub-contracts/README.md b/docs/plans/model-hub-contracts/README.mdindex 5d98a33ea..065245280 100644--- a/docs/plans/model-hub-contracts/README.md+++ b/docs/plans/model-hub-contracts/README.md@@ -1,8 +1,9 @@# Model Hub contracts-Status: **contract_version 12**, 2026-10-02: Google protocol vocabulary and Gemini-gateway frontend, with API/config-only Source admission. See-[`google-protocol.md`](google-protocol.md) and [`vibey-consumer.md`](vibey-consumer.md).+Status: **contract_version 11**, 2026-10-02: the Vibey Hub-only consumer, primary-hop+resolution and response origin linked to the served attempt, plus the Google protocol+vocabulary and Gemini gateway frontend, with API/config-only Source admission. See+[`vibey-consumer.md`](vibey-consumer.md) and [`google-protocol.md`](google-protocol.md).The approved routing contract is`../model-hub-routing-modes.md`, including the owner-approved Empty Route Inheritancecorrection `352486374`; API-key-only scope remains unchanged.@@ -181,7 +182,7 @@ comparison. A gate may not report success by comparing stale input with itself.## Version closure-`contract_version` 12 must coexist in all registered version locations on the same tested head:+`contract_version` 11 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 2c68c625d..a02edf915 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 v12 (2026-10-02).+"""Model Hub EngineAdapter interface. FINAL CONTRACT v11 (2026-10-02).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 9aa131a61..afc9b48e7 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": 12 },+ "contract_version": { "const": 11 },"backend": { "enum": ["claude", "codex", "opencode", "vibey"] },"model_id": { "type": "string" },"manual_override": {@@ -237,7 +237,7 @@],"examples": [{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","model_id": "unlisted-model","manual_override": null,@@ -247,7 +247,7 @@"supply_state": "ok"},{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -257,7 +257,7 @@"supply_state": "ok"},{- "contract_version": 12,+ "contract_version": 11,"backend": "claude","model_id": "claude-opus-4-6","manual_override": null,@@ -267,7 +267,7 @@"supply_state": "waiting"},{- "contract_version": 12,+ "contract_version": 11,"backend": "opencode","model_id": "glm-5.2","manual_override": { "hops": [{ "source_id": "src_relay9c1x", "model_id": "glm-5.2" }] },@@ -277,7 +277,7 @@"supply_state": "waiting"},{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -287,7 +287,7 @@"supply_state": "interrupted"},{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -297,7 +297,7 @@"supply_state": "interrupted"},{- "contract_version": 12,+ "contract_version": 11,"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 b4264fa82..678574266 100644--- a/docs/plans/model-hub-contracts/api-response.schema.json+++ b/docs/plans/model-hub-contracts/api-response.schema.json@@ -56,7 +56,7 @@"required": ["ok", "contract_version", "probe"],"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"probe": {"$ref": "model-hub/source-probe-result.schema.json"}}},@@ -155,7 +155,7 @@"SuccessCore": {"properties": {"ok": {"const": true},- "contract_version": {"const": 12}+ "contract_version": {"const": 11}}},"SourceListResponse": {@@ -164,7 +164,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"sources": {"type": "array", "items": {"$ref": "#/definitions/SourceApi"}}}},@@ -174,7 +174,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"observation": {"$ref": "model-hub/observation-result.schema.json"}}},@@ -184,7 +184,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"source": {"$ref": "#/definitions/SourceApi"},"added_to": {"type": "array", "items": {"$ref": "#/definitions/AddedTo"}},"adopted_by": {"type": "array", "items": {"$ref": "#/definitions/AdoptedBy"}, "uniqueItems": true}@@ -196,7 +196,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"source": {"$ref": "#/definitions/SourceApi"}}},@@ -206,7 +206,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"source": {"$ref": "#/definitions/SourceApi"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}@@ -218,7 +218,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}}@@ -229,7 +229,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"agents": {"type": "array", "items": {"$ref": "#/definitions/AgentSupplyApi"}}}},@@ -239,7 +239,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"agent": {"$ref": "#/definitions/AgentSupplyApi"}}},@@ -256,7 +256,7 @@],"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"agent": {"$ref": "#/definitions/AgentSupplyApi"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}, "uniqueItems": true},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}, "uniqueItems": true}@@ -281,7 +281,7 @@"additionalProperties": false,"properties": {"ok": {"const": false},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"error": {"const": "candidate_suppliers_changed"},"detail": {"type": "string", "minLength": 1},"changed": {@@ -301,7 +301,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"agent": {"type": "object","required": ["backend", "mode", "catalog_models"],@@ -402,7 +402,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"candidates": {"type": "object","required": ["builtin", "providers", "in_list"],@@ -421,7 +421,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"matches": {"type": "array","maxItems": 8,@@ -455,7 +455,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"chain": {"$ref": "model-hub/agent-chain.schema.json"}}},@@ -465,7 +465,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"chains": {"type": "array", "items": {"$ref": "model-hub/agent-chain.schema.json"}}}},@@ -475,7 +475,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"chain": {"$ref": "model-hub/agent-chain.schema.json"},"removed_hops": {"type": "array", "items": {"$ref": "#/definitions/RouteHopRef"}},"interrupted": {"type": "array", "items": {"$ref": "#/definitions/SupplyGap"}}@@ -487,7 +487,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"probe": {"$ref": "model-hub/probe-result.schema.json"}}},@@ -497,7 +497,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"events": {"type": "array", "items": {"$ref": "model-hub/resolution-event.schema.json"}}}},@@ -507,7 +507,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"usage": {"$ref": "model-hub/usage-summary.schema.json"}}},@@ -517,7 +517,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"quota": {"$ref": "model-hub/quota-summary.schema.json"}}},@@ -527,7 +527,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -549,7 +549,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -572,7 +572,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"flow": {"allOf": [{"$ref": "model-hub/oauth-flow.schema.json"},@@ -597,7 +597,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12}+ "contract_version": {"const": 11}}},"RuntimeApi": {@@ -619,7 +619,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"scan": {"$ref": "model-hub/migration-scan.schema.json"}}},@@ -629,7 +629,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"applied": {"type": "integer", "minimum": 0},"sources": {"type": "array", "items": {"$ref": "#/definitions/SourceApi"}},"added_to": {"type": "array", "items": {"$ref": "#/definitions/AddedTo"}}@@ -641,7 +641,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"provenance": {"$ref": "model-hub/turn-provenance.schema.json"}}},@@ -652,7 +652,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"provenance": {"anyOf": [{"$ref": "model-hub/turn-provenance.schema.json"},@@ -667,7 +667,7 @@"additionalProperties": false,"properties": {"ok": {"const": true},- "contract_version": {"const": 12},+ "contract_version": {"const": 11},"runtime": {"$ref": "#/definitions/RuntimeApi"}}}diff --git a/docs/plans/model-hub-contracts/api.md b/docs/plans/model-hub-contracts/api.mdindex bf4b26393..f878ba385 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` 12** — 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` 11** — 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: 12, ...}`.+Success envelope: `{ok: true, contract_version: 11, ...}`.Failure envelope:-`{ok: false, contract_version: 12, error: <machine_code>, detail?: <i18n_key>}`.+`{ok: false, contract_version: 11, 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` 12, the+The shared envelope and every versioned nested contract carry `contract_version` 11, theterminal value. Supported persisted config shapes and historical TurnProvenanceremain readable; ephemeral envelopes use only the terminal version.@@ -78,7 +78,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[]}` → `{applied, sources, added_to}` | Applies one grouped, server-owned custody transaction. It validates selected items before withdrawal, upgrades an existing native Source in place when present, commits Source/Routes/backend mode atomically, and removes only replaced native material. 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` 12 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` 11 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. |@@ -619,7 +619,7 @@ The terminal result of both ordinary API-key creation and OAuth creation is:```json{"ok": true,- "contract_version": 12,+ "contract_version": 11,"source": {"id": "src_anthkey01","kind": "api_key",@@ -729,7 +729,7 @@ Every guarded Source/inventory mutation uses the §4.5 envelope matrix and the c```json{"ok": false,- "contract_version": 12,+ "contract_version": 11,"error": "source_last_supplier","would_remove_hops": [],"would_interrupt": [@@ -865,7 +865,7 @@ API-key success:```json{"ok": true,- "contract_version": 12,+ "contract_version": 11,"source": {"id": "src_relay9c1x","kind": "api_key",@@ -956,7 +956,7 @@ Status and submit return the same terminal shape:```json{"ok": true,- "contract_version": 12,+ "contract_version": 11,"flow": {"flow_id": "oaf_claude01","client_nonce": "ofn_01j5w8z7p4n6q2rt",@@ -1029,9 +1029,9 @@ a valid `interrupted` chain.```json{"ok": true,- "contract_version": 12,+ "contract_version": 11,"chain": {- "contract_version": 12,+ "contract_version": 11,"backend": "codex","model_id": "gpt-5.6","manual_override": null,@@ -1058,7 +1058,7 @@ In Direct mode both chain and probe refuse with:```json{"ok": false,- "contract_version": 12,+ "contract_version": 11,"error": "direct_mode","detail": "models.hub.direct_mode"}@@ -1072,9 +1072,9 @@ A successful probe nests its result:```json{"ok": true,- "contract_version": 12,+ "contract_version": 11,"probe": {- "contract_version": 12,+ "contract_version": 11,"backend": "claude","channel": "hub","reachable": false,@@ -1097,7 +1097,7 @@ not-ready carries the closed i18n key `models.probe.native_cli_unavailable`.```json{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","channel": "native_cli","reachable": true,@@ -1110,7 +1110,7 @@ not-ready carries the closed i18n key `models.probe.native_cli_unavailable`.```json{- "contract_version": 12,+ "contract_version": 11,"backend": "codex","channel": "native_cli","reachable": false,@@ -1126,7 +1126,7 @@ No candidate is an API error with a typed model-scoped state:```json{"ok": false,- "contract_version": 12,+ "contract_version": 11,"error": "probe_no_candidate","detail": "models.probe.no_candidate.waiting","supply": {@@ -1307,7 +1307,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: 12, provenance: TurnProvenance | null}`;+Success uses exactly `{ok: true, contract_version: 11, provenance: TurnProvenance | null}`;there is no `success` field or envelope exception.Local `engine_down` records may also contain `local_error_detail`, an OS-generated@@ -1365,7 +1365,7 @@ ambiguous absence are explicit and distinguishable from an unknown turn:```json{"ok": false,- "contract_version": 12,+ "contract_version": 11,"error": "provenance_unavailable","detail": "models.provenance.direct_mode"}@@ -1374,7 +1374,7 @@ ambiguous absence are explicit and distinguishable from an unknown turn:```json{"ok": false,- "contract_version": 12,+ "contract_version": 11,"error": "provenance_unavailable","detail": "models.provenance.attribution_ambiguous"}diff --git a/docs/plans/model-hub-contracts/google-protocol.md b/docs/plans/model-hub-contracts/google-protocol.mdindex dc513d193..b33ef935f 100644--- a/docs/plans/model-hub-contracts/google-protocol.md+++ b/docs/plans/model-hub-contracts/google-protocol.md@@ -1,6 +1,6 @@# Google protocol consumer extension-Normative for the v12 Model Hub contract. This extends the existing gateway,+Normative for the v11 Model Hub contract. This extends the existing gateway,EngineAdapter and pinned CPA transport; it does not add a provider implementationto agent-core, change backend registration, or upgrade the engine.@@ -133,7 +133,7 @@ Both buffered and streaming responses share these facts with metering.Local JSON failures use Google's numeric `error.code`, canonical `error.status`,localized `error.message`, and `details[].reason` for the Model Hub machine code.Late local streaming endings use the Google error envelope. All carriers retain-the v11 response-origin policy: `x-avibe-served-hop` comes only from the immutable+the response-origin policy of [`vibey-consumer.md`](vibey-consumer.md): `x-avibe-served-hop` comes only from the immutableadmitted invocation that actually supplied the response. Pre-admission/localfailures have no origin header.@@ -147,7 +147,7 @@ Cross-protocol fallback follows this same policy before CPA conversion.The shared Source enum guard includes create, observation and Source-probecontracts, runtime storage, config, adapter and UI type consumers. The new writer-generation is 12; persisted provenance generations 5 through 11 still load, and+generation is 11; persisted provenance generations 5 through 10 still load, andreleased configuration fixtures retain their meaning. Only version literalschange in existing UI browser fixtures.diff --git a/docs/plans/model-hub-contracts/guard-refusal.schema.json b/docs/plans/model-hub-contracts/guard-refusal.schema.jsonindex 668fdd760..d691c8d6f 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": 12 },+ "contract_version": { "const": 11 },"error": {"enum": ["source_last_supplier",@@ -116,7 +116,7 @@"examples": [{"ok": false,- "contract_version": 12,+ "contract_version": 11,"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/mirror-registry.json b/docs/plans/model-hub-contracts/mirror-registry.jsonindex 6e897811e..7007285ed 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": 12,+ "contract_version": 11,"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 21efd8fb9..8ed7775a3 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": 12 },+ "contract_version": { "const": 11 },"outcome": {"enum": ["observed",@@ -150,7 +150,7 @@],"examples": [{- "contract_version": 12,+ "contract_version": 11,"outcome": "observed","reachable": true,"authenticated": "authenticated",@@ -165,7 +165,7 @@]},{- "contract_version": 12,+ "contract_version": 11,"outcome": "authentication_failed","reachable": true,"authenticated": "rejected",@@ -175,7 +175,7 @@"model_metadata": []},{- "contract_version": 12,+ "contract_version": 11,"outcome": "ambiguous","reachable": true,"authenticated": "unknown",@@ -185,7 +185,7 @@"model_metadata": []},{- "contract_version": 12,+ "contract_version": 11,"outcome": "unreachable","reachable": false,"authenticated": "unknown",@@ -195,7 +195,7 @@"model_metadata": []},{- "contract_version": 12,+ "contract_version": 11,"outcome": "adapter_error","reachable": null,"authenticated": "unknown",@@ -205,7 +205,7 @@"model_metadata": []},{- "contract_version": 12,+ "contract_version": 11,"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 371ea43c6..2baecdf0f 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": 12 },+ "contract_version": { "const": 11 },"backend": { "enum": ["claude", "codex", "opencode", "vibey"] },"channel": { "enum": ["hub", "native_cli"] },"reachable": { "type": "boolean" },@@ -66,10 +66,10 @@}],"examples": [- { "contract_version": 12, "backend": "codex", "channel": "hub", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": 412, "error": null },- { "contract_version": 12, "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": 12, "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": 12, "backend": "codex", "channel": "native_cli", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": null },- { "contract_version": 12, "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": 11, "backend": "codex", "channel": "hub", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": 412, "error": null },+ { "contract_version": 11, "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": 11, "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": 11, "backend": "codex", "channel": "native_cli", "reachable": true, "source_id": "src_chatgptplus", "model_id": "gpt-5.6", "latency_ms": null, "error": null },+ { "contract_version": 11, "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 d90624711..70ddc128c 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": 12 },+ "contract_version": { "const": 11 },"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": 12,+ "contract_version": 11,"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 c8f0e6b4c..610e03195 100644--- a/docs/plans/model-hub-contracts/turn-provenance.schema.json+++ b/docs/plans/model-hub-contracts/turn-provenance.schema.json@@ -36,7 +36,7 @@"additionalProperties": false,"properties": {"contract_version": {- "enum": [5, 6, 7, 8, 9, 10, 11, 12],+ "enum": [5, 6, 7, 8, 9, 10, 11],"$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."},@@ -419,7 +419,7 @@],"examples": [{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_01k9x2m4","ts": "2026-07-29T06:32:11Z","agent": "claude",@@ -444,7 +444,7 @@"blockers": []},{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_01k9x33p","ts": "2026-07-29T06:41:02Z","agent": "opencode",@@ -465,7 +465,7 @@"blockers": []},{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_01k9x3zq","ts": "2026-07-29T06:48:20Z","agent": "codex",@@ -485,7 +485,7 @@]},{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_01k9x4b7","ts": "2026-07-29T07:02:44Z","agent": "claude",@@ -505,7 +505,7 @@"blockers": []},{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_modelmissing01","ts": "2026-09-05T17:31:10Z","agent": "claude",@@ -527,7 +527,7 @@"blockers": []},{- "contract_version": 12,+ "contract_version": 11,"turn_id": "turn_01k9x5ca","ts": "2026-07-29T07:08:00Z","agent": "codex",diff --git a/docs/plans/model-hub-contracts/vibey-consumer.md b/docs/plans/model-hub-contracts/vibey-consumer.mdindex 4959dce08..f77215ea2 100644--- a/docs/plans/model-hub-contracts/vibey-consumer.md+++ b/docs/plans/model-hub-contracts/vibey-consumer.md@@ -210,8 +210,8 @@ The header needs no upstream credentials and is never forwarded upstream.- Contract authority/version closure, focused Python tests, and the existing UItype/build checks run before push.-The v11 consumer introduced the three existing protocols. The v12 extension in-[`google-protocol.md`](google-protocol.md) adds the Google runtime/engine frontend-together with the vocabulary, while preserving the origin delivery rules. There are+This consumer covers the three existing protocols. [`google-protocol.md`](google-protocol.md),+in the same v11 contract, adds the Google runtime/engine frontend together with the+vocabulary, while preserving the origin delivery rules. There areno new UI elements in this lane. C-8 owns enabling the Vibey backend card and itsHub-only presentation; `cli_present` truthfully remains false here.diff --git a/tests/agent_core/agent/test_projection.py b/tests/agent_core/agent/test_projection.pyindex 912fd2601..0e234650b 100644--- a/tests/agent_core/agent/test_projection.py+++ b/tests/agent_core/agent/test_projection.py@@ -142,10 +142,6 @@ def test_a_fork_before_a_checkpoint_or_edit_projects_the_original_context(fork_passert projected.messages[5].content[0].text == result_b-def _state_row(context):- return ContextEntry("session", 2, "agent_state", "state", payload={"version": 1, "state": {}, "context": context})--@pytest.mark.parametrize("row",[@@ -159,7 +155,11 @@ def _state_row(context):_checkpoint_row(2, 1, files_read="a.py"),_checkpoint_row(2, 1, files_modified=[1]),_checkpoint_row(2, 1, mode="partial"),- # A kept input must be an input row before the kept rows.+ # Every checkpoint row records the inputs it keeps, and a kept input must be an input row before the kept rows.+ ContextEntry(+ "session", 2, "compaction", "checkpoint",+ payload={key: value for key, value in _checkpoint_payload(1).items() if key != "kept_inputs"},+ ),_checkpoint_row(2, 1, kept_inputs=[1]),_checkpoint_row(2, 2, kept_inputs=[9]),_checkpoint_row(2, 2, kept_inputs=["1"]),@@ -168,8 +168,7 @@ def _state_row(context):_checkpoint_row(2, 1, summarizer={"origin": {}, "prompt_version": "v", "rounds": 0}),_checkpoint_row(2, 1, usage={"input_tokens": -1}),_checkpoint_row(2, 1, unexpected=True),- # Hook state only: C-9 keeps no guard in the rows.- _state_row({"failures": 0, "ineffective": 0, "paused": False}),+ ContextEntry("session", 2, "agent_state", "state", payload={"version": 1, "state": {}, "unexpected": True}),],)def test_malformed_context_rows_fail_explicitly_instead_of_projecting_a_wrong_context(row):@@ -187,29 +186,6 @@ def test_a_complete_checkpoint_row_loads():assert [block.text for block in projected.messages[0].content] == ["SUMMARY", "STATE"]-def test_a_checkpoint_row_written_before_kept_inputs_keeps_the_pin_it_was_written_with():- # Rows written before the field pinned the latest input before first_kept_seq when the cut fell inside a turn;- # without the field, the same rule applies, so such a conversation keeps its request. An explicit empty list- # pins nothing.- def legacy(first_kept_seq, **fields):- payload = {key: value for key, value in _checkpoint_payload(first_kept_seq).items() if key != "kept_inputs"}- return ContextEntry("session", 9, "compaction", "c", payload={**payload, **fields})-- rows = [- ContextEntry("session", 1, "input", "in-1", user("an older request")),- ContextEntry("session", 2, "response", "out-1", assistant("done")),- ContextEntry("session", 3, "input", "in-2", user("read f10 to f18")),- ContextEntry("session", 4, "response", "out-2", assistant("f10")),- ContextEntry("session", 5, "response", "out-3", assistant("f11")),- ]- texts = [message.content[0].text for message in project([*rows, legacy(5)]).messages]- assert texts == ["read f10 to f18", "SUMMARY", "f11"]- assert context_view([*rows, legacy(5)]).pinned == 1- # A cut at an input split nothing: nothing is pinned.- assert [m.content[0].text for m in project([*rows, legacy(3)]).messages][:2] == ["SUMMARY", "read f10 to f18"]- assert [m.content[0].text for m in project([*rows, legacy(5, kept_inputs=[])]).messages] == ["SUMMARY", "f11"]--def test_the_kept_inputs_of_a_turn_stay_whole_in_order_before_the_checkpoint():# The in-flight Turn's input and a steer it accepted, both before the cut: each stays as it was, in order.call = ToolCallBlock("r1", "read", {"path": "a.py"})diff --git a/tests/e2e/test_model_hub_runtime.py b/tests/e2e/test_model_hub_runtime.pyindex f1fed0516..171306de1 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": 12,+ "contract_version": 11,"error": "feature_disabled",}diff --git a/tests/e2e/test_model_hub_sources.py b/tests/e2e/test_model_hub_sources.pyindex 05b947220..e39cba107 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 = 12+CONTRACT_VERSION = 11MENU_MODEL = "claude-sonnet-4-6"SYNTHETIC_API_KEY = "sk-model-hub-e2e-not-real"diff --git a/tests/test_agent_backend_catalog.py b/tests/test_agent_backend_catalog.pyindex 62672dfbd..996137642 100644--- a/tests/test_agent_backend_catalog.py+++ b/tests/test_agent_backend_catalog.py@@ -61,30 +61,6 @@ def test_agent_backend_catalog_payload_exposes_public_metadata() -> None:assert payload[1]["capabilities"]["supports_runtime_refresh"] is True-def test_avibe_names_the_workbench_platform_and_no_agent_backend() -> None:- """``avibe`` is the product and the Workbench platform id; the built-in backend is ``vibey``.-- One token meaning both a platform and a backend let one Session row carry platform=avibe and- backend=avibe, and made the built-in the only backend whose Agent was not named after its id.- """- from config.platform_registry import WORKBENCH_PLATFORM_ID, supported_platform_set-- def strings(value):- if isinstance(value, dict):- for item in value.values():- yield from strings(item)- elif isinstance(value, (list, tuple)):- for item in value:- yield from strings(item)- elif isinstance(value, str):- yield value-- assert WORKBENCH_PLATFORM_ID == "avibe" and "avibe" in supported_platform_set()- assert not is_agent_backend("avibe")- assert not any("avibe" in value for value in strings(agent_backend_catalog_payload()))- assert [item["id"] for item in agent_backend_catalog_payload() if item["builtin"]] == ["vibey"]--def test_api_exposes_agent_backend_catalog() -> None:payload = api.get_agent_backend_catalog()@@ -100,9 +76,9 @@ def test_copy_about_the_built_in_names_it_from_the_catalog(lang) -> None:name = display_name_for_backend("vibey")for kind in ("aborted", "UnsupportedModelRoute", "ProviderProtocolViolation", None):text = error_text(kind, lang)- assert name in text and "{backend}" not in text and "Avibe Agent" not in text- for key in ("errors.modelHubDisabled", "errors.modelGatewayOff", "errors.builtinBackendConfig"):- text = t(key, lang, backend=name, section="agents.vibey")+ assert name in text and "{backend}" not in text+ for key in ("errors.modelHubDisabled", "errors.modelGatewayOff"):+ text = t(key, lang, backend=name)assert name in text and "{backend}" not in textalways_on = t("error.agentLifecycle.agent_always_enabled.message", lang, agent="vibey")- assert "Avibe Agent" not in always_on and "`vibey`" in always_on+ assert "`vibey`" in always_ondiff --git a/tests/test_agent_transcript.py b/tests/test_agent_transcript.pyindex 5eb7ace25..fbd9a95df 100644--- a/tests/test_agent_transcript.py+++ b/tests/test_agent_transcript.py@@ -172,8 +172,7 @@ def _tool_result(call_id: str, body: str) -> ToolResultMessage:COMPACTION = { # the current C-9 ``Compaction`` shape (transcript-rows.schema.json)"version": 1,"mode": "normal",- "reason": "manual",- "focus": None,+ "reason": "threshold","summary": "<context-checkpoint>\n## Objective\n修复路径测试\n</context-checkpoint>","checkpoint": "## Objective\n修复路径测试","state": [],diff --git a/tests/test_model_hub_api.py b/tests/test_model_hub_api.pyindex ad8203b20..41ae3a38e 100644--- a/tests/test_model_hub_api.py+++ b/tests/test_model_hub_api.py@@ -1028,7 +1028,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"] == 12+ assert runtime["contract_version"] == 11assert runtime["status"]["health"] == "ok"_assert_valid("runtime-dependency.schema.json", runtime)@@ -1335,7 +1335,7 @@ def test_runtime_start_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 12, "status": {"health": "ok"}}+ return {"contract_version": 11, "status": {"health": "ok"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1352,7 +1352,7 @@ def test_runtime_stop_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 12, "status": {"health": "not_started"}}+ return {"contract_version": 11, "status": {"health": "not_started"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1369,7 +1369,7 @@ def test_runtime_install_crosses_the_controller_rpc_boundary(monkeypatch):async def rpc(operation, payload=None):calls.append((operation, payload))- return {"contract_version": 12, "status": {"health": "installing"}}+ return {"contract_version": 11, "status": {"health": "installing"}}monkeypatch.setattr(model_hub_client, "_rpc", rpc)@@ -1387,7 +1387,7 @@ def test_runtime_dependency_ensure_crosses_the_controller_rpc_boundary(monkeypatdef rpc(operation, payload=None):calls.append((operation, payload))return {- "contract_version": 12,+ "contract_version": 11,"changed": True,"status": {"health": "not_started", "verified": True},}@@ -4804,7 +4804,7 @@ def test_agent_models_route_returns_only_picker_catalog_fields(monkeypatch):assert response.status_code == 200assert response.get_json() == {"ok": True,- "contract_version": 12,+ "contract_version": 11,"agent": {"backend": "codex","mode": "hub",@@ -9644,7 +9644,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"] == 12+ assert runtime["contract_version"] == 11_assert_valid("runtime-dependency.schema.json", runtime)diff --git a/tests/test_model_hub_config.py b/tests/test_model_hub_config.pyindex ae4c5222a..99aa4defe 100644--- a/tests/test_model_hub_config.py+++ b/tests/test_model_hub_config.py@@ -96,7 +96,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"] == 12+ assert schema["properties"]["contract_version"]["const"] == 11assert tuple(schema["properties"]["outcome"]["enum"]) == tuple(member.value for member in ObservationOutcome)@@ -120,7 +120,7 @@ def test_observation_terminal_authority_and_schema_accept_the_same_products():def payload(observation: SourceObservation) -> dict:return {- "contract_version": 12,+ "contract_version": 11,"outcome": observation.outcome.value,"reachable": observation.reachable,"authenticated": (@@ -700,7 +700,7 @@ def test_guard_refusal_error_requires_its_corresponding_nonempty_plan_array():route_refusal = {"ok": False,- "contract_version": 12,+ "contract_version": 11,"error": "source_in_route_chain","detail": "modelHub.errors.source_in_route_chain","would_remove_hops": [hop],@@ -716,7 +716,7 @@ def test_guard_refusal_error_requires_its_corresponding_nonempty_plan_array():}candidate_refusal = {"ok": False,- "contract_version": 12,+ "contract_version": 11,"error": "candidate_suppliers_changed","detail": "modelHub.errors.candidate_suppliers_changed","changed": {@@ -800,7 +800,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"] == 12+ assert registry["contract_version"] == 11ids = [entry["id"] for entry in registry["entries"]]assert idsassert len(ids) == len(set(ids))@@ -937,8 +937,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],- "expected": [5, 6, 7, 8, 9, 10, 11, 12],+ "values": [6, 7, 8, 9, 10, 11],+ "expected": [5, 6, 7, 8, 9, 10, 11],} in result["findings"]@@ -1249,7 +1249,7 @@ def test_v5_shape_amendments_reject_the_false_states_they_replace():with pytest.raises(ValidationError):chain_validator.validate(interrupted)exact_hop = {- "contract_version": 12,+ "contract_version": 11,"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 f636568fb..9bb2b2d01 100644--- a/tests/test_model_hub_l3.py+++ b/tests/test_model_hub_l3.py@@ -6830,7 +6830,7 @@ def test_source_observation_reduces_the_order_at_the_first_authenticated_proof(_assert_valid("observation-result.schema.json",{- "contract_version": 12,+ "contract_version": 11,"outcome": "adapter_error","reachable": True,"authenticated": "unknown",@@ -9361,7 +9361,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": 12,+ "contract_version": 11,"backend": "codex","channel": "native_cli","reachable": True,diff --git a/tests/test_model_hub_provenance.py b/tests/test_model_hub_provenance.pyindex ef5806cec..b45309472 100644--- a/tests/test_model_hub_provenance.py+++ b/tests/test_model_hub_provenance.py@@ -200,7 +200,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": 12,+ "contract_version": 11,"turn_id": turn_id,"ts": "2026-09-06T00:00:00Z","agent": backend,@@ -395,6 +395,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": 12, "provenance": record}+ assert response.get_json() == {"ok": True, "contract_version": 11, "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 e475e6fb7..733e6694e 100644--- a/tests/test_model_hub_resolution.py+++ b/tests/test_model_hub_resolution.py@@ -1707,7 +1707,7 @@ def test_service_accepts_authoritative_reachable_adapter_error(tmp_path):)assert result["observation"] == {- "contract_version": 12,+ "contract_version": 11,"outcome": "adapter_error","reachable": True,"authenticated": "unknown",@@ -1738,7 +1738,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": 12,+ "contract_version": 11,"outcome": "adapter_error","reachable": None,"authenticated": "unknown",diff --git a/tests/test_model_hub_runtime.py b/tests/test_model_hub_runtime.pyindex 2ab4809f2..949069afc 100644--- a/tests/test_model_hub_runtime.py+++ b/tests/test_model_hub_runtime.py@@ -1319,7 +1319,7 @@ def test_manifest_resolution_drives_admission_persistence_and_schema(installer=manager,state_store=EngineStateStore(tmp_path / "state"),)- projected = {"contract_version": 12, **supervisor.status()}+ projected = {"contract_version": 11, **supervisor.status()}schema = json.loads(Path("docs/plans/model-hub-contracts/runtime-dependency.schema.json").read_text(encoding="utf-8"diff --git a/tests/test_model_hub_vibey_consumer.py b/tests/test_model_hub_vibey_consumer.pyindex 9938a23f8..52c4c25dd 100644--- a/tests/test_model_hub_vibey_consumer.py+++ b/tests/test_model_hub_vibey_consumer.py@@ -874,7 +874,7 @@ async def test_failover_origin_is_available_before_body_and_matches_served_attem# Exercise the persistence reader, not only in-memory schema payloads.history = []for backend in ("claude", "codex", "opencode"):- for version in (5, 6, 7, 8, 9, 10, 11):+ for version in (5, 6, 7, 8, 9, 10):native = copy.deepcopy(record)native.update(agent=backend, contract_version=version, turn_id=f"{backend}-{version}")native["served"].pop("origin")diff --git a/tests/test_model_hub_vibey_contract_matrix.py b/tests/test_model_hub_vibey_contract_matrix.pyindex 7d6717f34..a5318a571 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": 12, "backend": "claude", "channel": "native_cli", "reachable": True,+ "contract_version": 11, "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": 12, "backend": "vibey", "model_id": "fixture-model",+ "contract_version": 11, "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": 12, "turn_id": "turn-fixture", "ts": "2026-10-02T07:00:00Z",+ "contract_version": 11, "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/tests/test_settings_handler.py b/tests/test_settings_handler.pyindex 9faaca998..904089057 100644--- a/tests/test_settings_handler.py+++ b/tests/test_settings_handler.py@@ -9,7 +9,7 @@ from unittest.mock import patchfrom config.v2_settings import RoutingSettingsfrom core.handlers.settings_handler import SettingsHandlerfrom core.modals import RoutingModalSelection-from modules.agents.catalog import AGENT_BACKENDS+from modules.agents.catalog import AGENT_BACKENDS, NATIVE_CLI_BACKENDSfrom modules.im import MessageContext@@ -497,7 +497,7 @@ def _make_routing_handler() -> tuple[SettingsHandler, _FakeOpenCodeServer]:config=SimpleNamespace(platform="slack",language="en",- **{backend: SimpleNamespace(enabled=True) for backend in AGENT_BACKENDS},+ **{backend: SimpleNamespace(enabled=True) for backend in NATIVE_CLI_BACKENDS},),im_client=SimpleNamespace(send_message=AsyncMock()),settings_manager=_RoutingSettingsManager(),diff --git a/tests/test_ui_server_fastapi.py b/tests/test_ui_server_fastapi.pyindex 9bc94335b..006e6c8c8 100644--- a/tests/test_ui_server_fastapi.py+++ b/tests/test_ui_server_fastapi.py@@ -2118,16 +2118,7 @@ def test_config_api_carries_why_the_model_hub_leaves_a_backend_no_model(monkeypaassert app.test_client().get("/api/config").get_json()["agent_supply_blocks"] == blocks- ("method", "path", "body", "code"),- [- ("post", "/api/config", {"agents": {"vibey": {"enabled": False}}}, None),- ("patch", "/api/agents/vibey", {"enabled": False}, "agent_always_enabled"),- ],-)-def test_requests_to_turn_off_the_built_in_vibey_agent_fail_with_a_client_error(- monkeypatch, tmp_path, method, path, body, code-):+def test_a_request_to_turn_off_the_built_in_vibey_agent_fails_with_a_client_error(monkeypatch, tmp_path):"""It has no switch: a request to turn it off is refused instead of silently ignored."""monkeypatch.setenv("AVIBE_HOME", str(tmp_path))from core.vibe_agents import VibeAgentStore@@ -2141,16 +2132,12 @@ def test_requests_to_turn_off_the_built_in_vibey_agent_fail_with_a_client_error(store.close()client = app.test_client()- response = getattr(client, method)(path, json=body, headers=csrf_headers(client))+ response = client.patch("/api/agents/vibey", json={"enabled": False}, headers=csrf_headers(client))assert response.status_code == 400payload = response.get_json()assert payload["ok"] is False- if code is None:- assert "always enabled" in payload["error"]- else:- assert payload["code"] == code and payload["message"]- assert "vibey" not in api.config_to_payload(api.load_config())["agents"]+ assert payload["code"] == "agent_always_enabled" and payload["message"]store = VibeAgentStore()try:assert store.require("vibey").enabled is Truediff --git a/tests/test_vibey_backend_registration.py b/tests/test_vibey_backend_registration.pyindex c4f483b79..ec331c276 100644--- a/tests/test_vibey_backend_registration.py+++ b/tests/test_vibey_backend_registration.py@@ -16,7 +16,7 @@ from config.v2_compat import to_app_configfrom config.v2_settings import RoutingSettingsfrom core.controller import Controllerfrom core.services.agent_run_target import resolve_agent_run_target-from core.vibe_agents import BUILTIN_DEFAULT_AGENT_METADATA, VibeAgentStore, is_always_enabled_agent+from core.vibe_agents import VibeAgentStore, is_always_enabled_agentfrom modules.agents.catalog import NATIVE_CLI_BACKENDSfrom modules.im import MessageContextfrom tests.test_api_save_config_merge import _full_config_payload@@ -40,86 +40,36 @@ def test_released_config_shapes_preserve_native_settings(tmp_path, fixture):assert {field: actual[field] for field in expected} == expected[email protected]("persisted", [{"enabled": False}, {"enabled": True}, None, "invalid", {"enabled": "false"}])-def test_a_persisted_vibey_switch_loads_as_on_and_leaves_on_the_next_save(tmp_path, sqlite_db_factory, persisted):- """Builds with an Avibe Agent switch wrote ``agents.vibey``; the built-in backend has no switch to honor.-- Such a build also left its built-in Agent disabled while the switch was off.- """- payload = _full_config_payload()- payload["agents"]["vibey"] = persisted- path = tmp_path / "config.json"- path.write_text(json.dumps(payload))- loaded = V2Config.load(path, persist_migrations=False)- assert not loaded.load_warnings- assert loaded.agents.codex.enabled is True- assert loaded.agents.opencode.active_turn_timeout_seconds == 7200-- store = VibeAgentStore(sqlite_db_factory(tmp_path / "agents.sqlite"))- try:- store.create(- name="vibey",- backend="vibey",- source="builtin",- metadata={**BUILTIN_DEFAULT_AGENT_METADATA, "backend": "vibey", "backend_enabled": False},- enabled=False,- )- store.ensure_builtin_default_agents(api._enabled_agent_backends_from_config(loaded))- assert store.get("vibey").enabled- assert store.get_default_agent_name() == "opencode"- finally:- store.close()-- loaded.save(path)- saved = json.loads(path.read_text())- assert "vibey" not in saved["agents"]- assert saved["agents"]["codex"]["enabled"] is True---# Rows an earlier build may have left: (name, backend, source, metadata, enabled).-_BUILT_IN = {**BUILTIN_DEFAULT_AGENT_METADATA, "backend": "vibey", "backend_enabled": True}-_EARLIER_ROWS = {+# Agent rows a released build can leave: none on the built-in backend, which no release had,+# or a user's own Agent that already holds its name.+_RELEASED_ROWS = {"absent": None,- "disabled": ("vibey", "vibey", "builtin", _BUILT_IN, False),- # Before the markers were the catalog's, a metadata update could strip them, and the row could then be renamed.- "markers-stripped": ("vibey", "vibey", "builtin", {}, False),- "markers-stripped-and-renamed": ("assistant", "vibey", "builtin", {}, False),- # A user's own Agent already holds the catalog's name for the built-in.- "user-agent-same-backend": ("vibey", "vibey", "user", {}, False),- "user-agent-other-backend": ("vibey", "claude", "user", {}, True),+ "user-agent-holds-the-name": ("vibey", "claude"),}[email protected]("earlier_row", list(_EARLIER_ROWS))[email protected]("released_row", list(_RELEASED_ROWS))@pytest.mark.parametrize("enabled_backends", [[], ["claude"], list(NATIVE_CLI_BACKENDS)])-def test_the_startup_sync_leaves_the_built_in_vibey_agent_enabled(tmp_path, sqlite_db_factory, earlier_row, enabled_backends):- """Controller startup runs this sync first; Model Hub then seeds the Avibe supply onto that Agent row.+def test_the_startup_sync_leaves_the_built_in_vibey_agent_enabled(tmp_path, sqlite_db_factory, released_row, enabled_backends):+ """Controller startup runs this sync first; Model Hub then seeds the Vibey supply onto that Agent row.- Whatever backends the caller read from config, and whatever an earlier build left, exactly one- built-in Avibe Agent exists and is enabled once the sync returns, and the identity lookup names- it. A new one is named by the catalog. A row the store created stays the built-in under any name,- including the ``vibey`` an earlier build gave it; a user's own Agent keeps its name and state.+ Whatever backends the caller read from config, exactly one built-in Vibey Agent exists and is+ enabled once the sync returns, and the identity lookup names it. It takes the backend id, or the+ next free name when a user's own Agent holds it; that Agent keeps its name and state."""store = VibeAgentStore(sqlite_db_factory(tmp_path / "agents.sqlite"))try:- row = _EARLIER_ROWS[earlier_row]- earlier = None- if row is not None:- name, backend, source, metadata, enabled = row- earlier = store.create(name=name, backend=backend, source=source, metadata=metadata, enabled=enabled)+ row = _RELEASED_ROWS[released_row]+ users = store.create(name=row[0], backend=row[1]) if row is not None else Nonestore.ensure_builtin_default_agents(enabled_backends)built_in = [agent for agent in store.list_agents() if agent.backend == "vibey" and is_always_enabled_agent(agent)]assert len(built_in) == 1 and built_in[0].enabledassert store.get_builtin_default_agent_for_backend("vibey") == built_in[0]- if earlier is None:- assert built_in[0].name == "vibey"- if earlier is not None and earlier.source == "builtin":- assert (built_in[0].id, built_in[0].name) == (earlier.id, earlier.name)- if earlier is not None and earlier.source == "user":- kept = store.get_by_id(earlier.id)- assert (kept.name, kept.backend, kept.enabled, kept.source) == ("vibey", row[1], row[4], "user")- assert built_in[0].name == "vibey-2"+ assert built_in[0].name == ("vibey" if users is None else "vibey-2")+ if users is not None:+ kept = store.get_by_id(users.id)+ assert (kept.name, kept.backend, kept.enabled, kept.source) == ("vibey", "claude", True, "user")finally:store.close()@@ -411,32 +361,30 @@ def test_choosing_the_built_in_backend_in_an_im_picker_routes_to_its_agent(tmp_pstore.close()-def test_routing_saved_as_the_backend_id_still_resolves(tmp_path, sqlite_db_factory):- """Routing that holds a backend id means that backend's built-in Agent, unless an Agent really has the name.+def test_routing_to_a_users_own_agent_named_vibey_stays_on_that_agent(tmp_path, sqlite_db_factory):+ """A released user's own Agent named ``vibey`` keeps its routing, even though the name is the built-in backend's id.- The built-in takes the next free name while a user's Agent holds ``vibey``; once that Agent- gives the name up, routing saved as ``vibey`` reaches the built-in again.+ The built-in takes ``vibey-2``; routing that names ``vibey`` reaches that user's Agent, and its scope+ model applies to that Agent's backend."""+ from config.v2_settings import routing_model_for_backend+store = VibeAgentStore(sqlite_db_factory(tmp_path / "agents.sqlite"))try:store.create(name="vibey", backend="claude")store.ensure_builtin_default_agents([])- built_in = store.get_builtin_default_agent_for_backend("vibey")- assert built_in.name == "vibey-2"+ assert store.get_builtin_default_agent_for_backend("vibey").name == "vibey-2"+ routing = RoutingSettings(agent_name="vibey", model="claude-haiku-4-5")controller = Controller.__new__(Controller)controller.primary_platform = "slack"controller.vibe_agent_store = storecontroller._get_settings_key = lambda context: context.channel_idcontroller.get_settings_manager_for_context = lambda _context: SimpleNamespace(- get_channel_routing=lambda _key: RoutingSettings(agent_name="vibey"),+ get_channel_routing=lambda _key: routing,)context = MessageContext(user_id="U1", channel_id="C1", platform="slack")resolved = controller.resolve_vibe_agent_for_context(context)assert (resolved.name, resolved.backend) == ("vibey", "claude")- store.rename("vibey", "helper")- resolved = controller.resolve_vibe_agent_for_context(context)- assert (resolved.name, resolved.backend) == ("vibey-2", "vibey")- with pytest.raises(Exception, match="not found"):- store.require_reference("opencode") # A backend with no built-in row names nothing.+ assert routing_model_for_backend(routing, "claude") == "claude-haiku-4-5"finally:store.close()diff --git a/ui/e2e/model-catalog/gatewayFixture.tsx b/ui/e2e/model-catalog/gatewayFixture.tsxindex 4b8312830..2a4b7dc47 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: 12, backend, model_id, route_origin: origins[index],+ contract_version: 11, 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: 12,+ contract_version: 11,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 f66b83a97..d207e015d 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: 12, backend, model_id: modelId,+ contract_version: 11, 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 06beb76ba..a986e549f 100644--- a/ui/e2e/model-routing-origin.spec.ts+++ b/ui/e2e/model-routing-origin.spec.ts@@ -39,7 +39,7 @@ test('MH-ROUTING-007 follow-defaults switch, undo, cancel, and save preserve expexpect(response.request().postDataJSON()).toEqual({ manual_override: null });const body = await response.json() as { ok: boolean; contract_version: number; chain: AgentChain };expect(body.ok).toBe(true);- expect(body.contract_version).toBe(12);+ expect(body.contract_version).toBe(11);expect(body.chain.manual_override).toBeNull();expect(body.chain.route_origin).toBe(inherited.route_origin);expect(identities(body.chain)).toEqual(identities(inherited));@@ -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: 12, error: 'source_in_route_chain', ...plan });+ expect(await refused.json()).toMatchObject({ ok: false, contract_version: 11, 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 a03ead302..5c9f4bff5 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: 12, enabled: true, host_platform: 'linux',+ contract_version: 11, 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 1e4ad330d..bbd708ac7 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:12,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:11,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:12,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:11,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 b48def30b..230ef1215 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: 12,+ contract_version: 11,enabled: true,host_platform: 'darwin',manifest: {diff --git a/ui/e2e/onboarding-fidelity/support.ts b/ui/e2e/onboarding-fidelity/support.tsindex 7903cfca9..df3fceac7 100644--- a/ui/e2e/onboarding-fidelity/support.ts+++ b/ui/e2e/onboarding-fidelity/support.ts@@ -84,7 +84,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: 12, 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: 11, 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 e827fc679..b8bcc9bf3 100644--- a/ui/e2e/support/api.ts+++ b/ui/e2e/support/api.ts@@ -355,7 +355,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 !== 12 || !('provenance' in payload)) {+ if (payload.ok !== true || payload.contract_version !== 11 || !('provenance' in payload)) {throw new Error('Latest recorded turn did not use the v10 provenance envelope');}return payload.provenance;diff --git a/ui/e2e/workbench-general/geometry.spec.ts b/ui/e2e/workbench-general/geometry.spec.tsindex e937ac5aa..f8ccb2244 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: 12,+ contract_version: 11,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/providers/ProvidersScreen.test.tsx b/ui/src/components/onboarding/providers/ProvidersScreen.test.tsxindex e0454ea13..0fde4060b 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: 12,+ contract_version: 11,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 ec793bb21..b24869d6d 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: 12,+ contract_version: 11,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/SettingsBackendsPage.test.tsx b/ui/src/components/settings/SettingsBackendsPage.test.tsxindex d8e9fef7a..31668015f 100644--- a/ui/src/components/settings/SettingsBackendsPage.test.tsx+++ b/ui/src/components/settings/SettingsBackendsPage.test.tsx@@ -38,7 +38,6 @@ beforeEach(async () => {await i18n.changeLanguage('en');mocks.api.getConfig.mockResolvedValue({ agents: {} });mocks.api.detectCli.mockImplementation(async (binary: string) => ({ found: true, path: binary }));- mocks.api.mutateConfig.mockResolvedValue({ agents: { vibey: { enabled: true } } });});afterEach(() => {diff --git a/ui/src/components/settings/models/AgentCard.test.tsx b/ui/src/components/settings/models/AgentCard.test.tsxindex 1c2220a33..c40c6c8e0 100644--- a/ui/src/components/settings/models/AgentCard.test.tsx+++ b/ui/src/components/settings/models/AgentCard.test.tsx@@ -16,7 +16,7 @@ import { freshRuntimeProjection } from './runtimeLifecycle';import type { AgentSupply, RuntimeDependency, Source } from './types';const runtime: RuntimeDependency = {- contract_version: 12,+ contract_version: 11,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 },};@@ -400,7 +400,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: 12, 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: 11, 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();@@ -420,7 +420,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: 12,+ contract_version: 11,backend: 'claude',model_id: 'claude-opus-4-6',current: { source_id: 'src_b', model_id: 'routed-opus' },@@ -453,7 +453,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: 12, 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: 11, 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();});@@ -461,7 +461,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: 12, 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: 11, 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();@@ -473,7 +473,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: 12, 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: 11, 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 ee4c7118f..6f11302cf 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: 12,+ contract_version: 11,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 3e75e5a8e..d3dd1136f 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: 12, backend, model_id: 'gpt-test', route_origin: routeOrigin,+ contract_version: 11, 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 cd5c4315d..d9f4d7b82 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: 12,+ contract_version: 11,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 30cd8179e..4dee8c726 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: 12, turn_id: 'turn-recorded', ts: '2026-09-05T15:00:00Z', agent: 'codex', requested_model_id: 'requested-model',+ contract_version: 11, 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 63103c1f7..90176016a 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: 12,+ contract_version: 11,...(hostPlatform === undefined ? {} : { host_platform: hostPlatform }),manifest: resolution === 'unresolved'? { name: 'cliproxyapi', resolution, assets: [] }diff --git a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsxindex 980472eba..2b302cbeb 100644--- a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx+++ b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx@@ -48,7 +48,7 @@ const manifest = {} satisfies RuntimeManifest;const runtime: RuntimeDependency = {- contract_version: 12,+ contract_version: 11,manifest,status: { installed_version: '1', verified: true, health: 'ok' },};@@ -119,7 +119,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: 12,+ contract_version: 11,backend: 'codex',model_id: 'gpt-5.6-sol',current: { source_id: 'src_relay', model_id: 'gpt-5.6-sol' },@@ -222,7 +222,7 @@ const routedHubAgent: AgentSupply = {const routedChain: AgentChain = {manual_override: { hops: [{ source_id: retainedSource.id, model_id: routedModelId }] },route_origin: 'manual' as const,- contract_version: 12,+ contract_version: 11,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 365ec8414..a2e1df5b3 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: 12,+ contract_version: 11,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: 12,+ contract_version: 11,backend: 'claude',model_id: 'model-a',current: { source_id: current, model_id: 'model-a' },diff --git a/ui/src/components/settings/models/apiFailure.test.ts b/ui/src/components/settings/models/apiFailure.test.tsindex fa7e14c91..61902b1b2 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: 12,+ contract_version: 11,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 3ebedfed9..9ffe4994d 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: 12,+ contract_version: 11,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 d794c0ec8..bf6da53b7 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: 12,+ contract_version: 11,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 d4c914abb..23ff4039c 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: 12,+ contract_version: 11,host_platform: 'darwin-arm64',manifest: resolution === 'unresolved'? { name: 'cliproxyapi', resolution, assets: [] }diff --git a/ui/src/components/settings/models/types.ts b/ui/src/components/settings/models/types.tsindex a214b967f..b8c4e6a3e 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 = 12 as const;-export const PERSISTED_TURN_CONTRACT_VERSIONS = [5, 6, 7, 8, 9, 10, 11, 12] as const;+export const CONTRACT_VERSION = 11 as const;+export const PERSISTED_TURN_CONTRACT_VERSIONS = [5, 6, 7, 8, 9, 10, 11] as const;export const AGENT_CHAIN_CONTRACT_VERSION = CONTRACT_VERSION;export const PROBE_RESULT_CONTRACT_VERSION = CONTRACT_VERSION;diff --git a/ui/src/components/shared/RoutingConfigPanel.legacy.test.tsx b/ui/src/components/shared/RoutingConfigPanel.legacy.test.tsxdeleted file mode 100644index 57d41058e..000000000--- a/ui/src/components/shared/RoutingConfigPanel.legacy.test.tsx+++ /dev/null@@ -1,47 +0,0 @@-// @vitest-environment jsdom-import { cleanup, render } from '@testing-library/react';-import { afterEach, describe, expect, it, vi } from 'vitest';-import type { VibeAgentBrief } from '../../context/ApiContext';--const pickerValues: unknown[] = [];-vi.mock('../workbench/AgentRoutePicker', () => ({- AgentRoutePicker: ({ value }: { value: unknown }) => {- pickerValues.push(value);- return null;- },-}));-vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('../../context/InstanceAuthorizationContext', () => ({- useInstanceAuthorization: () => ({ capabilities: { can_manage_access_members: false } }),-}));--import { RoutingConfigPanel } from './RoutingConfigPanel';--const agent = (name: string, backend: string, source: string): VibeAgentBrief => ({- id: `id-${name}`, name, display_name: name, description: null, backend, model: `${name}-model`,- reasoning_effort: null, enabled: true, archived: false, archived_at: null, source, updated_at: '',-});--describe('RoutingConfigPanel', () => {- afterEach(() => { cleanup(); pickerValues.length = 0; });-- // Routing that holds a backend id means that backend's built-in Agent, which takes the- // next free name (vibey-2) while a user's Agent holds the id.- it('shows a backend-id route as that backend’s built-in Agent', () => {- render(<RoutingConfigPanel- value={{ custom_cwd: '', routing: { agent_name: 'vibey' }, show_message_types: [] }}- onChange={() => {}} onBrowseDirectory={() => {}} globalConfig={{}}- vibeAgents={[agent('vibey-2', 'vibey', 'builtin'), agent('claude', 'claude', 'builtin')]}- />);- expect(pickerValues.at(-1)).toMatchObject({ agent_backend: 'vibey', agent_name: 'vibey-2', model: 'vibey-2-model' });- });-- it('prefers an Agent that really has the name', () => {- render(<RoutingConfigPanel- value={{ custom_cwd: '', routing: { agent_name: 'vibey' }, show_message_types: [] }}- onChange={() => {}} onBrowseDirectory={() => {}} globalConfig={{}}- vibeAgents={[agent('vibey-2', 'vibey', 'builtin'), agent('vibey', 'claude', 'custom')]}- />);- expect(pickerValues.at(-1)).toMatchObject({ agent_backend: 'claude', agent_name: 'vibey' });- });-});diff --git a/ui/src/components/shared/RoutingConfigPanel.tsx b/ui/src/components/shared/RoutingConfigPanel.tsxindex 0dcf27706..393fab041 100644--- a/ui/src/components/shared/RoutingConfigPanel.tsx+++ b/ui/src/components/shared/RoutingConfigPanel.tsx@@ -92,12 +92,7 @@ export const RoutingConfigPanel: React.FC<RoutingConfigPanelProps> = ({const canManageAccessMembers = capabilities.can_manage_access_members;const { t } = useTranslation();- const routedName = value.routing.agent_name;- // Routing can hold a backend id (the built-in takes the next free name while a user's- // Agent holds the id); with no Agent of that name it means the backend's built-in Agent.- const selectedVibeAgent = vibeAgents.find((agent) => agent.name === routedName)- ?? vibeAgents.find((agent) => !agent.archived && agent.source === 'builtin' && agent.backend === routedName)- ?? null;+ const selectedVibeAgent = vibeAgents.find((agent) => agent.name === value.routing.agent_name) || null;const defaultVibeAgent = vibeAgents.find((agent) => agent.name === defaultAgentName) || null;// Picking an agent re-seeds model/effort, so always clear the deprecated@@ -203,7 +198,7 @@ export const RoutingConfigPanel: React.FC<RoutingConfigPanelProps> = ({// agent_backend also falls back to the default agent so the columns// resolve while inheriting the global default.agent_backend: selectedVibeAgent?.backend ?? defaultVibeAgent?.backend ?? null,- agent_name: selectedVibeAgent?.name ?? value.routing.agent_name ?? null,+ agent_name: value.routing.agent_name ?? null,model: value.routing.model ?? selectedVibeAgent?.model ?? null,reasoning_effort: value.routing.reasoning_effort ?? selectedVibeAgent?.reasoning_effort ?? null,}}diff --git a/ui/src/components/workbench/AgentsPage.test.tsx b/ui/src/components/workbench/AgentsPage.test.tsxindex 4b40cdcd7..6d90962f7 100644--- a/ui/src/components/workbench/AgentsPage.test.tsx+++ b/ui/src/components/workbench/AgentsPage.test.tsx@@ -234,7 +234,7 @@ describe('AgentsPage load requests follow the rank that can serve them', () => {describe('AgentsPage contextual selection', () => {it('marks an enabled Agent the gateway reports without a model, as the Models page does', async () => {- // Enabling the Avibe backend creates its built-in Agent before any model is selected.+ // The built-in Vibey Agent exists before Model Hub gives it a model.vi.spyOn(modelsApi, 'listAgents').mockResolvedValue([{backend: 'vibey', cli_present: false, mode: 'hub', menu_kind: 'fixed',diff --git a/vibe/api.py b/vibe/api.pyindex b3014347b..1daf02bd2 100644--- a/vibe/api.py+++ b/vibe/api.py@@ -105,7 +105,6 @@ from vibe import backend_model_catalogfrom vibe.i18n import t as backend_tfrom modules.agents.catalog import (AGENT_BACKENDS,- BUILTIN_AGENT_BACKENDS,NATIVE_CLI_BACKENDS,agent_backend_catalog_payload,agent_backend_descriptors,@@ -783,23 +782,6 @@ def _strip_agent_auth_fields(payload: dict) -> dict:return {**payload, "agents": cleaned_agents}-def _reject_builtin_backend_config(payload: dict) -> None:- """A built-in backend has no config section, so a request to set one, such as disabling it, fails."""- agents = payload.get("agents")- if not isinstance(agents, dict):- return- for backend in BUILTIN_AGENT_BACKENDS:- if backend in agents:- raise ValueError(- backend_t(- "errors.builtinBackendConfig",- _configured_backend_language(),- backend=display_name_for_backend(backend),- section=f"agents.{backend}",- )- )--def _strip_preserved_config_secrets(payload: dict) -> dict:"""Drop redacted secret placeholders from generic config saves.@@ -1018,7 +1000,6 @@ def save_config(# as a read-only projection here rather than accepting a potentially stale# client snapshot.payload = {key: value for key, value in payload.items() if key != "model_hub"}- _reject_builtin_backend_config(payload)payload = _strip_agent_auth_fields(payload)payload = _strip_preserved_config_secrets(payload)payload = _mark_explicit_audio_asr_enabled(payload)diff --git a/vibe/i18n/en.json b/vibe/i18n/en.jsonindex 040f47397..9071f59a9 100644--- a/vibe/i18n/en.json+++ b/vibe/i18n/en.json@@ -6,7 +6,6 @@},"errors": {"agentModelRequired": "Select a model for the {backend} Agent or Session in Avibe before running it.",- "builtinBackendConfig": "{backend} is built in and always enabled, so `{section}` cannot be set.","modelHubDisabled": "Model Hub is disabled on this instance, so {backend} has no model to run on.","modelGatewayOff": "The model gateway is off, so {backend} has no model to run on. Turn it on in Models, then choose a model.","opencodeModelProviderRequired": "Select an OpenCode model with a provider in Avibe, or configure its Model Hub route."diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.jsonindex 59dcf0f8e..02416ab4f 100644--- a/vibe/i18n/zh.json+++ b/vibe/i18n/zh.json@@ -6,7 +6,6 @@},"errors": {"agentModelRequired": "请先在 Avibe 中为 {backend} Agent 或会话选择模型。",- "builtinBackendConfig": "{backend} 是内置后端,始终启用,不能设置 `{section}`。","modelHubDisabled": "本实例已停用模型网关,{backend} 没有可用的模型。","modelGatewayOff": "模型网关已关闭,{backend} 没有可用的模型。请在「模型」页开启网关并选择模型。","opencodeModelProviderRequired": "请在 Avibe 中选择带供应商的 OpenCode 模型,或配置它的 Model Hub 路由。"