Commit Graph

2 Commits

Author SHA1 Message Date
caoqianming 85c918dc2f Add safe conversational workspace rename 2026-07-27 11:23:20 +08:00
caoqianming 25d8a6572f refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732
照 admin.py 的 register_*_routes 注册范式把 create_app 巨型闭包拆开,
依赖(require_user/auth_cfg)显式传参,对外 /v1 契约零变化:

- web/routers/:misc/models/authroutes/wechat(含企微)/kb/schedules/
  skills_memory/files/asr/tasks/messages 共 11 个模块
- web/common.py:跨 router 常量与 helper(task_dict/usage_aggregates/
  sse_event/assert_owns_task 等)
- web/schemas.py:13 个 Pydantic 请求模型独立成文件
- web/model_gate.py:模型档位门控 + image/video variant 解析
- web/runs.py:run_agent_bg + run_channel_conversation(BG worker 与
  渠道入站对话核心,从 app.py 模块级函数析出)
- web/userfiles.py:路径安全原语(safe_join 越界校验/transfer 预检)收口
- app.py 只剩 App 工厂 + lifespan 后台协程群

验证:286 测试全过;路由面 81 条逐条一致;TestClient 冒烟
(healthz 200/坏 platform_key 403/未鉴权 401/lifespan 正常启动)。
test_changelog/test_pptx_render 的 import 指向同步更新。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:18:57 +08:00