T-529 default to cmhub gateway

This commit is contained in:
chengma
2026-07-04 17:59:23 +08:00
parent 3dbcbab799
commit 60497be557
13 changed files with 106 additions and 112 deletions
+8
View File
@@ -1135,3 +1135,11 @@
- 文档:`docs/06-tasks.md` 将 T-528 标为 DONE;同步 `docs/current-state.md`,下一个可领取任务回到 T-525 ruff。
- 测试:`python -m unittest discover -s tests -p test_gui.py` 通过(80 tests);`python -m unittest discover -s tests -p test_ai.py` 通过(17 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(187 tests);`git diff --check` 通过,仅有本机 LF/CRLF 提示。全量测试仍有本机 PySide6 字体目录提示,不影响结果。
- 下一步:T-525「引入 ruff(lint + format)+ 可选 pre-commit」。
## 【2026-07-04】T-529 完成 · 默认 cmhub 网关并隐藏 AI 后端选择
- 状态:DONE
- 文档:同步 `docs/cmhub-integration-design.md`、`docs/03-tech-stack.md`、`docs/04-architecture.md`、`docs/api.md`、`docs/routes.md`、`docs/06-tasks.md`、`docs/current-state.md`;T-529 标为 DONE,下一步回到 T-525 ruff。
- 代码:`DEFAULT_CONFIG.ai.backend` 改为 `cmhub`,`ai_backend()` 缺省跟随默认 backend;⑤设置页隐藏「AI 后端」下拉、direct 模型选择、模型详情和标题/图片角色下拉,普通 UI 直接展示 cmhub 网关配置;保存设置固定写 `ai.backend=cmhub`,允许先保存不完整 cmhub 配置,真正生成时仍由 `app/ai.py` 提示补齐 Base URL/API Key/别名。
- 兼容:direct 代码、`config/ai_models.json`、AI 模型测试 worker 和 direct 单测保留为内部兼容/手工回滚路径;未改 AI HTTP 协议、DB schema、Excel、Shopee/CDP 流程。
- 测试:更新 appconfig/GUI/AI 单测,direct 分支测试显式设置 `backend=direct`;②AI生成页默认显示 cmhub 余额标签。
- 验证:`python -m py_compile app\appconfig.py app\gui\tabs\settings.py app\gui\tabs\generate.py tests\test_appconfig.py tests\test_gui.py tests\test_ai.py` 通过;`python -m unittest discover -s tests -p test_appconfig.py` 通过(8 tests);`python -m unittest discover -s tests -p test_gui.py` 通过(80 tests);`python -m unittest discover -s tests -p test_ai.py` 通过(17 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(187 tests);`git diff --check` 通过,仅有本机 LF/CRLF 提示。全量 GUI 测试仍有本机 PySide6 字体目录提示,不影响结果。