Files
xiaoyin-gateway/.gitignore
T
Jidekin a1989ac6f4 fix(sync): OpenCode 模型改用官方 models 接口,修复文档改版导致的连续两天 exit=2
官方把文档的 `## Endpoints` 表改成「看 console 页 / 用 models 接口」,
HTML 里不再有带 opencode.ai/ 地址的模型行,fetch_opencode() 的 <tr>/<td>
解析拿不到任何行 → 自动化日报「模型清单同步」整块失败:

  [2026-11-17 23:02:18] exit=2  RuntimeError: OpenCode 文档没解析出 Endpoints 表
  [2026-11-18 23:02:29] exit=2  同上

改为优先读官方 models 接口(实测无需鉴权):
  GET https://opencode.ai/inference/go/v1/models   (zen/go/v1/models 同源同内容)

每条自带 id/name/type/api{chat-completions,responses,messages,generate-content}/
recommended_api/limit{context,output}/cost.text.*.price/go.limited_regions,
据此推导协议线、免费标记与地区限制;HTML 表解析降级为兜底(接口不可用才走)。

首次落盘:
  - 删除 opencode/mimo-v2.5、mimo-v2.5-pro(上游已被 V2.6 取代)
  - 上下文 hy4-flash-free → 1048576/65536;qwen4-max → 1000000/262144
  - 跳过 gemini-4-argon(仅 generate-content)、beam-free 与 muse-spark-1.2/1.3(地区限制)

验证:落盘后 28 个模型、/healthz 200、hot_reload 自动生效未重启、重跑「无漂移」;
sync_onemin.py 同步通过(49 接口 / 43 配置 / 跳过重名 6)。

顺带把运行时的 data/ban_history.jsonl 加进 .gitignore(含被封 IP,属隐私)。
2026-11-19 08:09:28 +08:00

73 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ── 缓存 / 构建产物 ──
__pycache__/
*.pyc
*.pyo
.pytest_cache/
.venv/
venv/
*.log
# ── 本地敏感文件 ──
.env
.env.*
!.env.example
# 账号体系数据:密码哈希 + API Key 哈希,属凭证材料,不入库
data/users.json
# 前端历史(提示词/回答正文属隐私)
data/history.json
# 意见反馈(正文 + 图片,属隐私)
data/feedback.json
data/feedback_media/
# 单测运行时会往项目根写这几个临时数据文件(test_gateway.py 用),别入库
.test_users.json
.test_history.json
.test_feedback.json
.test_feedback_media/
.test_sessions.json
.test_video_owners.json
.test_env
# 运行期状态(第三十轮):会话落盘 / 视频归属落盘 —— 都是运行数据,且含账号名与凭证哈希,
# 属"可重新生成、不该进版本库"的一类(重启后从空开始,语义上无害)
data/sessions.json
# 封禁历史(2026-11-19 补):运行时数据,且**含被封 IP 与操作人**,属隐私,不入库
data/ban_history.jsonl
data/video_owners.json
# 智能体运行记录(第三十八轮):运行时数据(谁在什么时候用了哪个智能体),
# 与 sessions.json 同理 —— 可重新生成、不该进版本库。
# 注意 data/agents.yaml 是**配置**(不含秘密),按计划 ⑯ **要入库**。
data/agent_runs.json
data/agents.yaml.bak
# 配置自动备份(每存一次网关配置就多一对):不该跟着源码走,也不该在仓库里堆历史版本
data/*.bak
# 说明:data/gateway.yaml 不含明文 Key —— 三家供应商密钥统一在 .env(已被上面忽略),
# 由 yaml 各供应商的 token_env 引用。只要 .env 不提交,密钥就不会进版本库。
# ── 设计稿(不入库,历史上从未入库)──────────────────────────────────
# design/v1、v2、v3 是"出设计图"用的脚本 + 渲染出的 PNG(约 11MB)。
# 它们与产品构建、网关运行完全无关,且 2026-09-13 曾被清理归档到
# /root/.trash/<归档>/design/(cp -a 可恢复)。
# 需要时本地恢复即可,不进版本库。
design/
# ── 依赖与构建产物(不入库,均可重新生成:npm ci && npm run build)──
node_modules/
frontend/node_modules/
frontend/dist/
dist/
*.egg-info/
.DS_Store
# 调用日志数据库(2026-10-23 落地方案):运行时生成,不入库
data/calllog.db
data/calllog.db-wal
data/calllog.db-shm
# 编辑器/手工备份(2026-11-01 补)
*.bak-*
*.bak
*.orig