sync snapshot from LAN repo (source codex/merge-tjlnew-classic-retrieval-20261019 @ ded012d9)
This commit is contained in:
1 parent
ea9dcff9c0
commit
c753e6c9b5
818 files changed
+14037
-108991
No files matched your search
@@ -17,17 +17,15 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import copy
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from time import perf_counter, sleep
|
||||
from typing import Any, Literal
|
||||
from time import perf_counter
|
||||
from typing import Any
|
||||
|
||||
import yaml
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
@@ -47,56 +45,6 @@ _MODEL_BLOCK_RE = re.compile(r"(?m)^models:[^\r\n]*(?:\r?\n|$)")
|
||||
_TOP_LEVEL_KEY_RE = re.compile(r"(?m)^[A-Za-z_][A-Za-z0-9_-]*:[^\r\n]*(?:\r?\n|$)")
|
||||
_BACKUP_DIR_NAME = ".model-config-backups"
|
||||
_MUTATION_LOCK = asyncio.Lock()
|
||||
_ATOMIC_REPLACE_RETRIES = 5
|
||||
_ATOMIC_REPLACE_RETRY_ERRNOS = {
|
||||
errno.EBUSY,
|
||||
errno.EAGAIN,
|
||||
getattr(errno, "ETXTBSY", 26),
|
||||
}
|
||||
|
||||
|
||||
def _is_file_mountpoint(path: Path) -> bool:
|
||||
"""Return whether ``path`` itself is mounted (common with Docker file binds)."""
|
||||
if not sys.platform.startswith("linux"):
|
||||
return False
|
||||
try:
|
||||
target = str(path.resolve())
|
||||
with Path("/proc/self/mountinfo").open(encoding="utf-8") as mountinfo:
|
||||
for line in mountinfo:
|
||||
fields = line.split(" - ", maxsplit=1)[0].split()
|
||||
if len(fields) < 5:
|
||||
continue
|
||||
mount_path = re.sub(
|
||||
r"\\([0-7]{3})",
|
||||
lambda match: chr(int(match.group(1), 8)),
|
||||
fields[4],
|
||||
)
|
||||
if mount_path == target:
|
||||
return True
|
||||
except OSError:
|
||||
logger.debug("Unable to inspect Linux mount table for model config path", exc_info=True)
|
||||
return False
|
||||
|
||||
|
||||
def _write_mounted_config_in_place(path: Path, raw_before: str, raw_after: str) -> None:
|
||||
"""Update a single-file bind mount, where Linux refuses atomic rename (EBUSY)."""
|
||||
try:
|
||||
with path.open("w", encoding="utf-8", newline="") as handle:
|
||||
handle.write(raw_after)
|
||||
handle.flush()
|
||||
os.fsync(handle.fileno())
|
||||
except Exception:
|
||||
# The backup was persisted before reaching this point. Restore the
|
||||
# previous contents best-effort so a failed write does not leave YAML
|
||||
# truncated or partially replaced.
|
||||
try:
|
||||
with path.open("w", encoding="utf-8", newline="") as handle:
|
||||
handle.write(raw_before)
|
||||
handle.flush()
|
||||
os.fsync(handle.fileno())
|
||||
except OSError:
|
||||
logger.exception("Failed to restore model config after an in-place bind-mount write failure")
|
||||
raise
|
||||
|
||||
_EDITOR_FIELDS = frozenset(
|
||||
{
|
||||
@@ -122,7 +70,6 @@ _EDITOR_FIELDS = frozenset(
|
||||
"use_responses_api",
|
||||
"output_version",
|
||||
"write_file_transport",
|
||||
"strict_stream_integrity",
|
||||
}
|
||||
)
|
||||
_PRESERVED_FIELDS = frozenset(ModelConfig.model_fields) | _EDITOR_FIELDS
|
||||
@@ -145,7 +92,6 @@ class ModelAdminItem(BaseModel):
|
||||
stream_usage: bool | None = None
|
||||
supports_thinking: bool = False
|
||||
supports_reasoning_effort: bool = False
|
||||
default_reasoning_effort: Literal["low", "medium", "xhigh"] = "xhigh"
|
||||
supports_vision: bool = False
|
||||
when_thinking_enabled: dict[str, Any] | None = None
|
||||
when_thinking_disabled: dict[str, Any] | None = None
|
||||
@@ -153,9 +99,6 @@ class ModelAdminItem(BaseModel):
|
||||
use_responses_api: bool | None = None
|
||||
output_version: str | None = None
|
||||
write_file_transport: WriteFileTransport = WriteFileTransport.NATIVE
|
||||
# ``None`` means the runtime default: auto-enabled only for the historically
|
||||
# affected qwen3.8-flash-next model id (see deerflow.models.chat_stream_state).
|
||||
strict_stream_integrity: bool | None = None
|
||||
extra_settings: dict[str, Any] = Field(default_factory=dict)
|
||||
api_key_configured: bool = False
|
||||
api_key_source: str | None = None
|
||||
@@ -203,9 +146,6 @@ class ModelUpsertRequest(BaseModel):
|
||||
# bridge setting during edits. New models still resolve to ModelConfig's
|
||||
# native default when the field is omitted.
|
||||
write_file_transport: WriteFileTransport | None = None
|
||||
# Optional on the wire so edits preserve an existing toggle; the dedicated
|
||||
# strict-stream-integrity endpoint is the canonical switch surface.
|
||||
strict_stream_integrity: bool | None = None
|
||||
extra_settings: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
@field_validator("name", "use", "model")
|
||||
@@ -228,20 +168,6 @@ class ModelTestRequest(BaseModel):
|
||||
|
||||
class ReasoningEffortCapabilityRequest(BaseModel):
|
||||
supports_reasoning_effort: bool
|
||||
default_reasoning_effort: Literal["low", "medium", "xhigh"] | None = None
|
||||
|
||||
|
||||
class WriteFileTransportToggleRequest(BaseModel):
|
||||
"""Per-model 文件流式兼容 switch: off keeps native, on selects buffered_gateway."""
|
||||
|
||||
write_file_transport: Literal["native", "buffered_gateway"]
|
||||
|
||||
|
||||
class StrictStreamIntegrityToggleRequest(BaseModel):
|
||||
"""Per-model 流完整性检测 switch: detect gateway streams that end without
|
||||
a terminal frame and retry instead of committing a half answer."""
|
||||
|
||||
strict_stream_integrity: bool
|
||||
|
||||
|
||||
class ModelOrderRequest(BaseModel):
|
||||
@@ -267,7 +193,6 @@ def _to_admin_item(
|
||||
raw: dict[str, Any],
|
||||
*,
|
||||
supports_reasoning_effort: bool = False,
|
||||
default_reasoning_effort: str = "xhigh",
|
||||
) -> ModelAdminItem:
|
||||
api_key = raw.get("api_key")
|
||||
extra = {key: copy.deepcopy(value) for key, value in raw.items() if key not in _PRESERVED_FIELDS}
|
||||
@@ -286,7 +211,6 @@ def _to_admin_item(
|
||||
stream_usage=raw.get("stream_usage"),
|
||||
supports_thinking=bool(raw.get("supports_thinking", False)),
|
||||
supports_reasoning_effort=bool(supports_reasoning_effort),
|
||||
default_reasoning_effort=default_reasoning_effort if default_reasoning_effort in {"low", "medium", "xhigh"} else "xhigh",
|
||||
supports_vision=bool(raw.get("supports_vision", False)),
|
||||
when_thinking_enabled=copy.deepcopy(raw.get("when_thinking_enabled")),
|
||||
when_thinking_disabled=copy.deepcopy(raw.get("when_thinking_disabled")),
|
||||
@@ -294,7 +218,6 @@ def _to_admin_item(
|
||||
use_responses_api=raw.get("use_responses_api"),
|
||||
output_version=raw.get("output_version"),
|
||||
write_file_transport=raw.get("write_file_transport", WriteFileTransport.NATIVE),
|
||||
strict_stream_integrity=raw.get("strict_stream_integrity") if isinstance(raw.get("strict_stream_integrity"), bool) else None,
|
||||
extra_settings=extra,
|
||||
api_key_configured=bool(api_key),
|
||||
api_key_source=_mask_env_source(api_key),
|
||||
@@ -313,12 +236,12 @@ def _get_capability_store(request: Request, *, required: bool = True) -> ModelCa
|
||||
return store
|
||||
|
||||
|
||||
async def _capabilities_by_name(request: Request) -> dict[str, dict[str, Any]]:
|
||||
async def _capabilities_by_name(request: Request) -> dict[str, bool]:
|
||||
store = _get_capability_store(request, required=False)
|
||||
if store is None:
|
||||
return {}
|
||||
rows = await store.list_capabilities()
|
||||
return {str(row.get("model_name") or ""): row for row in rows if row.get("model_name")}
|
||||
return {str(row.get("model_name") or ""): bool(row.get("supports_reasoning_effort", False)) for row in rows if row.get("model_name")}
|
||||
|
||||
|
||||
def _admin_user_id(user: Any) -> str | None:
|
||||
@@ -334,48 +257,10 @@ def _validate_reasoning_capability(model: dict[str, Any], enabled: bool) -> None
|
||||
)
|
||||
|
||||
|
||||
# ``write_file_transport=buffered_gateway`` and ``strict_stream_integrity`` are
|
||||
# implemented only by the patched OpenAI-compatible chat-completions classes
|
||||
# (see deerflow.models.factory); every other driver is rejected there at
|
||||
# construction time, so mirror the same constraint here with a clearer message.
|
||||
_PATCHED_OPENAI_COMPATIBLE_USES = frozenset(
|
||||
{
|
||||
"langchain_openai:ChatOpenAI",
|
||||
"deerflow.models.patched_openai:PatchedChatOpenAI",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _validate_patched_openai_use(model: dict[str, Any], feature: str) -> None:
|
||||
if str(model.get("use") or "") not in _PATCHED_OPENAI_COMPATIBLE_USES:
|
||||
raise HTTPException(
|
||||
status_code=422,
|
||||
detail=(
|
||||
f"{feature} requires an OpenAI-compatible "
|
||||
"langchain_openai:ChatOpenAI model"
|
||||
),
|
||||
)
|
||||
if bool(model.get("use_responses_api")):
|
||||
raise HTTPException(
|
||||
status_code=422,
|
||||
detail=(
|
||||
f"{feature} requires the chat-completions API, "
|
||||
"not use_responses_api"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def _validate_write_file_transport(model: dict[str, Any], transport: str) -> None:
|
||||
if transport != WriteFileTransport.BUFFERED_GATEWAY.value:
|
||||
return
|
||||
_validate_patched_openai_use(model, "write_file compatibility")
|
||||
|
||||
|
||||
async def _restore_capability(
|
||||
store: ModelCapabilityStore,
|
||||
model_name: str,
|
||||
previous: dict[str, Any] | None,
|
||||
request: Request,
|
||||
) -> None:
|
||||
"""Best-effort semantic rollback for a failed cross-store model update."""
|
||||
|
||||
@@ -386,15 +271,10 @@ async def _restore_capability(
|
||||
await store.set_reasoning_effort_support(
|
||||
model_name,
|
||||
supports_reasoning_effort=bool(previous.get("supports_reasoning_effort", False)),
|
||||
default_reasoning_effort=str(previous.get("default_reasoning_effort") or "xhigh"),
|
||||
updated_by=previous.get("updated_by"),
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("Failed to roll back model capability for %s", model_name)
|
||||
finally:
|
||||
from app.gateway.catalog_cache import invalidate_catalog
|
||||
|
||||
await invalidate_catalog(request, "models")
|
||||
|
||||
|
||||
def _read_config_data(path: Path) -> tuple[str, dict[str, Any], list[dict[str, Any]]]:
|
||||
@@ -448,42 +328,6 @@ def _replace_models_block(raw_text: str, models: list[dict[str, Any]]) -> str:
|
||||
return f"{raw_text[: block_match.start()]}{rendered}{raw_text[end:]}"
|
||||
|
||||
|
||||
def _replace_config_file_with_retry(
|
||||
temp_name: str,
|
||||
path: Path,
|
||||
raw_before: str,
|
||||
raw_after: str,
|
||||
) -> None:
|
||||
"""Retry short-lived busy errors from shared/container-mounted filesystems.
|
||||
|
||||
Keep the write atomic: never fall back to truncating the live config. The
|
||||
temporary file is unique per mutation, so a bounded retry is safe when
|
||||
overlay/NFS scanners briefly hold a rename operation.
|
||||
"""
|
||||
if _is_file_mountpoint(path):
|
||||
logger.info("Model config is a single-file mount; updating mounted file in place")
|
||||
_write_mounted_config_in_place(path, raw_before, raw_after)
|
||||
os.unlink(temp_name)
|
||||
return
|
||||
|
||||
for attempt in range(_ATOMIC_REPLACE_RETRIES + 1):
|
||||
try:
|
||||
os.replace(temp_name, path)
|
||||
return
|
||||
except OSError as exc:
|
||||
if exc.errno not in _ATOMIC_REPLACE_RETRY_ERRNOS or attempt >= _ATOMIC_REPLACE_RETRIES:
|
||||
raise
|
||||
delay = min(0.4, 0.025 * (2**attempt))
|
||||
logger.warning(
|
||||
"Model config atomic replace is temporarily busy (errno=%s); retry %d/%d after %.3fs",
|
||||
exc.errno,
|
||||
attempt + 1,
|
||||
_ATOMIC_REPLACE_RETRIES,
|
||||
delay,
|
||||
)
|
||||
sleep(delay)
|
||||
|
||||
|
||||
def _backup_and_write_config(path: Path, raw_before: str, raw_after: str) -> Path:
|
||||
backup_dir = path.parent / _BACKUP_DIR_NAME
|
||||
backup_dir.mkdir(parents=True, exist_ok=True)
|
||||
@@ -501,7 +345,7 @@ def _backup_and_write_config(path: Path, raw_before: str, raw_after: str) -> Pat
|
||||
handle.write(raw_after)
|
||||
handle.flush()
|
||||
os.fsync(handle.fileno())
|
||||
_replace_config_file_with_retry(temp_name, path, raw_before, raw_after)
|
||||
os.replace(temp_name, path)
|
||||
except Exception:
|
||||
try:
|
||||
os.unlink(temp_name)
|
||||
@@ -585,8 +429,6 @@ def _strip_database_owned_fields(models: list[dict[str, Any]]) -> list[dict[str,
|
||||
|
||||
|
||||
async def _save_models(request: Request, raw_before: str, models: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
from app.gateway.catalog_cache import invalidate_catalog
|
||||
|
||||
path = _resolve_config_path()
|
||||
models = _strip_database_owned_fields(models)
|
||||
raw_after = _replace_models_block(raw_before, models)
|
||||
@@ -605,7 +447,6 @@ async def _save_models(request: Request, raw_before: str, models: list[dict[str,
|
||||
status_code=422,
|
||||
detail="The model configuration could not be activated; the previous config was restored.",
|
||||
) from exc
|
||||
await invalidate_catalog(request, "models")
|
||||
return models
|
||||
|
||||
|
||||
@@ -622,8 +463,7 @@ async def list_model_configurations(request: Request) -> ModelAdminListResponse:
|
||||
models=[
|
||||
_to_admin_item(
|
||||
item,
|
||||
supports_reasoning_effort=bool(capabilities.get(str(item.get("name") or ""), {}).get("supports_reasoning_effort", False)),
|
||||
default_reasoning_effort=str(capabilities.get(str(item.get("name") or ""), {}).get("default_reasoning_effort") or "xhigh"),
|
||||
supports_reasoning_effort=capabilities.get(str(item.get("name") or ""), False),
|
||||
)
|
||||
for item in models
|
||||
],
|
||||
@@ -650,19 +490,17 @@ async def create_model_configuration(body: ModelUpsertRequest, request: Request)
|
||||
await capability_store.set_reasoning_effort_support(
|
||||
body.name,
|
||||
supports_reasoning_effort=bool(body.supports_reasoning_effort),
|
||||
default_reasoning_effort="xhigh",
|
||||
updated_by=_admin_user_id(admin),
|
||||
)
|
||||
try:
|
||||
await _save_models(request, raw_before, [*models, created])
|
||||
except Exception:
|
||||
if capability_changed and capability_store is not None:
|
||||
await _restore_capability(capability_store, body.name, previous_capability, request)
|
||||
await _restore_capability(capability_store, body.name, previous_capability)
|
||||
raise
|
||||
return _to_admin_item(
|
||||
created,
|
||||
supports_reasoning_effort=bool(body.supports_reasoning_effort) if capability_changed else False,
|
||||
default_reasoning_effort="xhigh",
|
||||
)
|
||||
|
||||
|
||||
@@ -697,8 +535,7 @@ async def reorder_model_configurations(body: ModelOrderRequest, request: Request
|
||||
return [
|
||||
_to_admin_item(
|
||||
item,
|
||||
supports_reasoning_effort=bool(capabilities.get(str(item.get("name") or ""), {}).get("supports_reasoning_effort", False)),
|
||||
default_reasoning_effort=str(capabilities.get(str(item.get("name") or ""), {}).get("default_reasoning_effort") or "xhigh"),
|
||||
supports_reasoning_effort=capabilities.get(str(item.get("name") or ""), False),
|
||||
)
|
||||
for item in ordered_models
|
||||
]
|
||||
@@ -715,8 +552,6 @@ async def update_reasoning_effort_capability(
|
||||
) -> ModelAdminItem:
|
||||
"""Persist the per-model reasoning-effort selector capability in SQL."""
|
||||
|
||||
from app.gateway.catalog_cache import invalidate_catalog
|
||||
|
||||
admin = await _require_admin(request)
|
||||
async with _MUTATION_LOCK:
|
||||
path = _resolve_config_path()
|
||||
@@ -730,100 +565,11 @@ async def update_reasoning_effort_capability(
|
||||
await store.set_reasoning_effort_support(
|
||||
model_name,
|
||||
supports_reasoning_effort=body.supports_reasoning_effort,
|
||||
default_reasoning_effort=body.default_reasoning_effort,
|
||||
updated_by=_admin_user_id(admin),
|
||||
)
|
||||
await invalidate_catalog(request, "models")
|
||||
return _to_admin_item(
|
||||
model,
|
||||
supports_reasoning_effort=body.supports_reasoning_effort,
|
||||
default_reasoning_effort=body.default_reasoning_effort or "xhigh",
|
||||
)
|
||||
|
||||
|
||||
@router.put(
|
||||
"/write-file-transport/{model_name:path}",
|
||||
response_model=ModelAdminItem,
|
||||
)
|
||||
async def update_write_file_transport(
|
||||
model_name: str,
|
||||
body: WriteFileTransportToggleRequest,
|
||||
request: Request,
|
||||
) -> ModelAdminItem:
|
||||
"""Toggle one model's buffered-gateway write_file compatibility in config.yaml.
|
||||
|
||||
The global system-settings switch keeps overriding every compatible model
|
||||
while it is enabled; this per-model value becomes effective as soon as the
|
||||
global switch is turned off.
|
||||
"""
|
||||
|
||||
await _require_admin(request)
|
||||
async with _MUTATION_LOCK:
|
||||
path = _resolve_config_path()
|
||||
raw_before, _, models = await asyncio.to_thread(_read_config_data, path)
|
||||
index = next((i for i, item in enumerate(models) if str(item.get("name")) == model_name), None)
|
||||
if index is None:
|
||||
raise HTTPException(status_code=404, detail=f"Model '{model_name}' was not found")
|
||||
updated = copy.deepcopy(models[index])
|
||||
_validate_write_file_transport(updated, body.write_file_transport)
|
||||
updated["write_file_transport"] = body.write_file_transport
|
||||
try:
|
||||
ModelConfig.model_validate(updated)
|
||||
except Exception as exc:
|
||||
raise HTTPException(status_code=422, detail=f"Invalid model configuration: {exc}") from exc
|
||||
next_models = [*models]
|
||||
next_models[index] = updated
|
||||
await _save_models(request, raw_before, next_models)
|
||||
capabilities = await _capabilities_by_name(request)
|
||||
capability = capabilities.get(model_name, {})
|
||||
return _to_admin_item(
|
||||
updated,
|
||||
supports_reasoning_effort=bool(capability.get("supports_reasoning_effort", False)),
|
||||
default_reasoning_effort=str(capability.get("default_reasoning_effort") or "xhigh"),
|
||||
)
|
||||
|
||||
|
||||
@router.put(
|
||||
"/strict-stream-integrity/{model_name:path}",
|
||||
response_model=ModelAdminItem,
|
||||
)
|
||||
async def update_strict_stream_integrity(
|
||||
model_name: str,
|
||||
body: StrictStreamIntegrityToggleRequest,
|
||||
request: Request,
|
||||
) -> ModelAdminItem:
|
||||
"""Toggle one model's strict stream integrity check in config.yaml.
|
||||
|
||||
When enabled, a provider stream that ends without a terminal frame raises
|
||||
a retriable ``IncompleteChatStreamError`` instead of committing a half
|
||||
answer — the LLM error middleware then retries the call. Explicit ``false``
|
||||
also overrides the auto-enable default for the affected qwen3.8-flash-next
|
||||
model id; omitting the key entirely keeps that default.
|
||||
"""
|
||||
|
||||
await _require_admin(request)
|
||||
async with _MUTATION_LOCK:
|
||||
path = _resolve_config_path()
|
||||
raw_before, _, models = await asyncio.to_thread(_read_config_data, path)
|
||||
index = next((i for i, item in enumerate(models) if str(item.get("name")) == model_name), None)
|
||||
if index is None:
|
||||
raise HTTPException(status_code=404, detail=f"Model '{model_name}' was not found")
|
||||
updated = copy.deepcopy(models[index])
|
||||
_validate_patched_openai_use(updated, "strict stream integrity")
|
||||
updated["strict_stream_integrity"] = body.strict_stream_integrity
|
||||
try:
|
||||
ModelConfig.model_validate(updated)
|
||||
except Exception as exc:
|
||||
raise HTTPException(status_code=422, detail=f"Invalid model configuration: {exc}") from exc
|
||||
next_models = [*models]
|
||||
next_models[index] = updated
|
||||
await _save_models(request, raw_before, next_models)
|
||||
capabilities = await _capabilities_by_name(request)
|
||||
capability = capabilities.get(model_name, {})
|
||||
return _to_admin_item(
|
||||
updated,
|
||||
supports_reasoning_effort=bool(capability.get("supports_reasoning_effort", False)),
|
||||
default_reasoning_effort=str(capability.get("default_reasoning_effort") or "xhigh"),
|
||||
)
|
||||
|
||||
|
||||
@@ -850,7 +596,6 @@ async def update_model_configuration(model_name: str, body: ModelUpsertRequest,
|
||||
await capability_store.set_reasoning_effort_support(
|
||||
model_name,
|
||||
supports_reasoning_effort=desired_capability,
|
||||
default_reasoning_effort=str((previous_capability or {}).get("default_reasoning_effort") or "xhigh"),
|
||||
updated_by=_admin_user_id(admin),
|
||||
)
|
||||
next_models = [*models]
|
||||
@@ -859,7 +604,7 @@ async def update_model_configuration(model_name: str, body: ModelUpsertRequest,
|
||||
await _save_models(request, raw_before, next_models)
|
||||
except Exception:
|
||||
if capability_changed and capability_store is not None:
|
||||
await _restore_capability(capability_store, model_name, previous_capability, request)
|
||||
await _restore_capability(capability_store, model_name, previous_capability)
|
||||
raise
|
||||
if capability_changed:
|
||||
supports_reasoning_effort = desired_capability
|
||||
@@ -871,7 +616,6 @@ async def update_model_configuration(model_name: str, body: ModelUpsertRequest,
|
||||
return _to_admin_item(
|
||||
updated,
|
||||
supports_reasoning_effort=supports_reasoning_effort,
|
||||
default_reasoning_effort=str((previous_capability or {}).get("default_reasoning_effort") or "xhigh"),
|
||||
)
|
||||
|
||||
|
||||
@@ -894,7 +638,7 @@ async def delete_model_configuration(model_name: str, request: Request) -> None:
|
||||
await _save_models(request, raw_before, [*models[:index], *models[index + 1 :]])
|
||||
except Exception:
|
||||
if capability_store is not None:
|
||||
await _restore_capability(capability_store, model_name, previous_capability, request)
|
||||
await _restore_capability(capability_store, model_name, previous_capability)
|
||||
raise
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user