Files
JARVIS/development-doc/plan/hermes-update/phase-h7-default-rollout-and-fallback.md

67 lines
1.9 KiB
Markdown
Raw Permalink 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.
# H7 默认切换、灰度与 Fallback
## 1. 目标
让 Hermes 从“可选 runtime”安全过渡为默认路径同时保留 fallback 与回滚能力。
## 2. 核心原则
1. 不做一次性全量切换。
2. 默认切换必须由服务端策略控制。
3. Jarvis graph 在迁移期保留为 fallback / specialist path。
4. 回滚不能破坏 conversation/message 数据。
## 3. 推荐 rollout 顺序
### Stage 1显式 opt-in
- 仅对开发/内部用户开放
- 用户可显式选择 Hermes
### Stage 2内部默认 Hermes
- 对内部账号或灰度 cohort 默认走 Hermes
- 保留 fallback 开关
### Stage 3新会话默认 Hermes
- 仅新 conversation 默认 Hermes
- 历史 conversation 可按策略维持原路径或迁移
### Stage 4全量默认 Hermes
- 普通用户默认走 Hermes-first
- runtime toggle 从主 UI 淡出
## 4. Fallback 策略
触发 fallback 的场景示例:
- Hermes session hydrate 失败
- Hermes runtime health 不达标
- 连续 error/restart 达到阈值
- 某类 specialist workflow 尚未迁移
fallback 目标:
- 切回 Jarvis graph 或受控备用路径
- 不丢 conversation continuity
- 不破坏前端 SSE 契约
## 5. 回滚要求
1. 服务端可按 feature flag / policy 回滚默认 runtime。
2. 不要求修改前端主交互逻辑即可回滚。
3. 历史 conversation 的 `agent_state` 仍能兼容读取。
4. 回滚后仍可保留 Hermes metrics 用于复盘。
## 6. 推荐文件变更
- `backend/app/services/agent_service.py`
- `backend/app/routers/conversation.py`
- `backend/app/schemas/conversation.py`
- `frontend/src/pages/chat/composables/useChatView.ts`
- `frontend/src/pages/chat/index.vue`
- 可能新增runtime policy / feature flag 配置模块
## 7. 验收标准
- [ ] 有清晰 rollout policy
- [ ] 有 fallback 策略
- [ ] 有 rollback 机制
- [ ] Hermes 默认切换不会成为不可逆操作