docs: 记录AI模型category启动报错排查

- 新增 troubleshooting 文档,说明 category 缺失导致启动失败的原因

- 补充安全修复步骤,避免泄露或提交 config/ai_models.json 中的 API Key

- 更新文档导航、技术栈、当前状态和进度记录
This commit is contained in:
chengma
2026-06-29 10:37:27 +08:00
parent 0e0ed193b6
commit 3a79e34eab
5 changed files with 105 additions and 0 deletions
+7
View File
@@ -653,3 +653,10 @@
- 测试:`tests/test_db.py` 覆盖运行日志持久化;`tests/test_gui.py` 覆盖 dry-run 不变更任务、真实更新串行、按账号并行、端口冲突阻断、⑤设置读写与③共享配置。
- 文档:`docs/06-tasks.md` 将 T-504 标为 DONE;同步 `docs/00-ai-start-here.md`、`docs/02-requirements.md`、`docs/03-tech-stack.md`、`docs/04-architecture.md`、`docs/05-coding-rules.md`、`docs/api.md`、`docs/routes.md`、`docs/current-state.md` 和 UI 草图。
- 验证:`python -m compileall app main.py tests` 通过;`python -m unittest discover -s tests` 通过(112 tests);未执行真实 Shopee 提交。
## 【2026-06-29】AI 模型 category 启动报错排查记录
- 问题:启动最新代码时报 “AI 模型 category 必须是 text 或 image”。
- 原因:本地 gitignored 的 `config/ai_models.json` 来自旧数据或手工维护,模型缺少 `category`,而当前 schema 要求每个模型必须是 `text` 或 `image`。
- 处理:已在本机只补齐模型 `category` 和空的 `enabled=true`,保留原有 url/model/API Key;验证 `appconfig.list_ai_models()` 可正常加载,且 `config/ai_models.json` 仍被 gitignore。
- 文档:新增 `docs/troubleshooting.md`,并在 `docs/README.md`、`docs/03-tech-stack.md`、`docs/current-state.md` 增加索引和说明。排查命令只输出 `name/category/api_type/enabled/has_api_key`,不输出 API Key。