refactor!: 技术标识也全部换掉(logger / UA / 脚本 / 前端 / 文档)
老板要求:技术标识也要换,脚本啥的都换。
运行时
· 所有 logging.getLogger("api-gateway…") → "xiaoyin-gateway…"(main/metrics/circuit/settings/sessions/users/gomodels/video_owners/adapters)
· app/main.py 的上游 User-Agent 默认值 → xiaoyin-gateway/{VERSION}
· data/gateway.yaml 里 opencode 的 UA 覆盖 → xiaoyin-gateway/2.4.0
· run.py 启动横幅 → [xiaoyin-gateway]
脚本
· scripts/sync_models.py、sync_onemin.py 的探测 UA
· scripts/ci_check.sh 的横幅
前端
· 配置备份文件的 kind: api-gateway-backup → xiaoyin-gateway-backup
(导入逻辑本来就不校验 kind,旧备份照样能恢复)
· dist 产物同步打补丁,不用重新 build
文档
· README / CHANGELOG 里的服务名、`supervisorctl restart api-gateway:api-gateway_00` 等
· 另一个技能 dsh-plugin-publish 的敏感词规则里也提到了旧名,一并更新
唯一没动的
· .gitignore 里那行指向 /root/.trash/2026-09-13-api-gateway-cleanup 的注释 ——
那是磁盘上真实存在的历史目录名,改了反而指错地方
This commit is contained in:
1 parent
3d84a2abc3
commit
c7b957c4d4
19 files changed
+48
-48
No files matched your search
+2
-2
@@ -162,7 +162,7 @@ def _setup_logging() -> None:
|
||||
|
||||
# 基础日志先起来,进 lifespan 后按 observability 重配
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(name)s] %(levelname)s: %(message)s")
|
||||
log = logging.getLogger("api-gateway")
|
||||
log = logging.getLogger("xiaoyin-gateway")
|
||||
|
||||
# 调用日志的内容上限(2026-10-23,2.9.12 再放宽):默认 **4 MiB**(≈100 万 token 的文本)。
|
||||
# 老板要求「详情内容都不要截断」—— 4 MiB 对任何正常对话都等于不截断;
|
||||
@@ -4704,7 +4704,7 @@ async def opencode_go_usage(_auth=Depends(require_auth)):
|
||||
raise HTTPException(503, "OpenCode Go 未配置 API Key")
|
||||
|
||||
base = str(pconfig.base_url or "https://opencode.ai/zen/go/v1").rstrip("/")
|
||||
ua = (pconfig.extra_headers or {}).get("User-Agent") or f"api-gateway/{VERSION}"
|
||||
ua = (pconfig.extra_headers or {}).get("User-Agent") or f"xiaoyin-gateway/{VERSION}"
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=10) as client:
|
||||
r = await client.get(
|
||||
|
||||
Reference in new issue
Block a user