feat: consolidate desktop and provider updates
CI / Supply-chain scan (push) Has been cancelled
Docker Build, Test, and Publish / Detect affected areas (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
Nix flake check / Detect affected areas (push) Has been cancelled
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
CI / Detect affected areas (push) Has been cancelled
Docker Build, Test, and Publish / build (amd64, type=gha,scope=docker-amd64, type=gha,mode=max,scope=docker-amd64, linux/amd64, ubuntu-latest-32-core) (push) Has been cancelled
CI / Desktop E2E (push) Has been cancelled
CI / Docs Site (push) Has been cancelled
CI / Deny unrelated histories (push) Has been cancelled
CI / Check contributors (push) Has been cancelled
Docker Build, Test, and Publish / build (arm64, type=gha,scope=docker-arm64, type=gha,mode=max,scope=docker-arm64, linux/arm64, ubuntu-latest-32-arm-core) (push) Has been cancelled
CI / Check uv.lock (push) Has been cancelled
CI / Check no committed infographics (push) Has been cancelled
CI / Profile artifact check (push) Has been cancelled
Docker Build, Test, and Publish / publish (amd64, type=gha,scope=docker-amd64, type=gha,mode=max,scope=docker-amd64, linux/amd64, ubuntu-latest-32-core) (push) Has been cancelled
Docker Build, Test, and Publish / publish (arm64, type=gha,scope=docker-arm64, type=gha,mode=max,scope=docker-arm64, linux/arm64, ubuntu-latest-32-arm-core) (push) Has been cancelled
Docker Build, Test, and Publish / merge (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
CI / Check no case-colliding filenames (push) Has been cancelled
CI / package-lock.json diff (push) Has been cancelled
CI / Lint Docker scripts (push) Has been cancelled
CI / Review label gate (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
CI / CI timing report (push) Has been cancelled
CI / Python tests (push) Has been cancelled
CI / OS-specific tests (push) Has been cancelled
CI / Python lints (push) Has been cancelled
CI / JS & TS checks (push) Has been cancelled
CI / Installer tests (push) Has been cancelled
CI / Rust tests (push) Has been cancelled
Nix flake check / nix flake check (push) Has been cancelled

This commit is contained in:
m4
2026-09-27 17:37:19 +08:00
parent 226350cd04
commit fb13457f6f
174 changed files with 7669 additions and 1477 deletions
+11 -5
View File
@@ -232,9 +232,16 @@ def _build_schema_from_config(config: Dict[str, Any], prefix: str = "") -> Dict[
def _config_schema_with_virtual_fields() -> Dict[str, Dict[str, Any]]:
"""DEFAULT_CONFIG schema plus the virtual ``model_context_length`` field, inserted right
after ``model`` so it renders adjacent in the frontend."""
after ``model`` so it renders adjacent in the frontend.
The web editor deliberately exposes ``model`` as one legacy scalar; the dedicated Models panel
owns the provider/default mapping. Keep that presentation shape even when DEFAULT_CONFIG carries
a structured default route.
"""
schema_defaults = dict(DEFAULT_CONFIG)
schema_defaults["model"] = ""
ordered: Dict[str, Dict[str, Any]] = {}
for key, entry in _build_schema_from_config(DEFAULT_CONFIG).items():
for key, entry in _build_schema_from_config(schema_defaults).items():
ordered[key] = entry
if key == "model":
ordered["model_context_length"] = _SCHEMA_OVERRIDES["model_context_length"]
@@ -487,9 +494,8 @@ def _apply_main_model_assignment(model_cfg: "Any", result: "ModelSwitchResult",
def _normalize_config_for_web(config: Dict[str, Any]) -> Dict[str, Any]:
"""Flatten a dict-form ``model`` to its string form (the schema is built from
DEFAULT_CONFIG where ``model`` is a string) and surface ``model_context_length``
as a top-level field (0 = auto-detect)."""
"""Flatten a dict-form ``model`` to the web editor's legacy string field and surface
``model_context_length`` as a top-level field (0 = auto-detect)."""
config = dict(config)
model_val = config.get("model")
if isinstance(model_val, dict):