mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
refactor: Antigravity/Codex 服务重构为插件化适配器架构
- 将 Antigravity 和 Codex 从独立模块迁移至 src/services/provider/adapters/ 插件体系 - 新增 provider_types 和 oauth_token 模块,移除 maintenance_scheduler 中的 OAuth 定时刷新 - 增强 admin API:扩展 keys 和 provider_query 端点,新增 dashboard 路由 - 大幅增强 ProviderDetailDrawer 组件,新增 AntigravityQuotaDialog - 改进 handler 基类(chat/cli)和错误分类器 - 优化 fetch_scheduler 和 upstream_fetcher - 前端 UI 组件清理和优化 - 更新测试以匹配新模块结构
This commit is contained in:
@@ -105,7 +105,7 @@ class CreateProviderRequest(BaseModel):
|
||||
quota_last_reset_at: datetime | None = Field(None, description="当前周期开始时间")
|
||||
quota_expires_at: datetime | None = Field(None, description="配额过期时间")
|
||||
provider_priority: int | None = Field(
|
||||
100, ge=0, le=1000, description="提供商优先级(数字越小越优先)"
|
||||
100, ge=0, le=10000, description="提供商优先级(数字越小越优先)"
|
||||
)
|
||||
is_active: bool | None = Field(True, description="是否启用")
|
||||
concurrent_limit: int | None = Field(None, ge=0, description="并发限制")
|
||||
@@ -127,9 +127,12 @@ class CreateProviderRequest(BaseModel):
|
||||
if v is None:
|
||||
return "custom"
|
||||
v = v.strip()
|
||||
allowed = {"custom", "claude_code", "codex", "gemini_cli", "antigravity"}
|
||||
if v not in allowed:
|
||||
raise ValueError(f"无效的 provider_type,有效值为: {', '.join(sorted(allowed))}")
|
||||
from src.core.provider_types import VALID_PROVIDER_TYPES
|
||||
|
||||
if v not in VALID_PROVIDER_TYPES:
|
||||
raise ValueError(
|
||||
f"无效的 provider_type,有效值为: {', '.join(sorted(VALID_PROVIDER_TYPES))}"
|
||||
)
|
||||
return v
|
||||
|
||||
@field_validator("name", "description")
|
||||
@@ -199,7 +202,7 @@ class UpdateProviderRequest(BaseModel):
|
||||
quota_reset_day: int | None = Field(None, ge=1, le=365)
|
||||
quota_last_reset_at: datetime | None = None
|
||||
quota_expires_at: datetime | None = None
|
||||
provider_priority: int | None = Field(None, ge=0, le=1000)
|
||||
provider_priority: int | None = Field(None, ge=0, le=10000)
|
||||
is_active: bool | None = None
|
||||
concurrent_limit: int | None = Field(None, ge=0)
|
||||
# 请求配置(从 Endpoint 迁移)
|
||||
|
||||
Reference in New Issue
Block a user