fix(dispatcher): Branch else 兜底 + 选路留痕(T4.E)

- branchNode 识别 default/else 边:主选择(true/false 或边序)未命中任何下游时,
  走显式 default 边而非悄悄落 END
- trace 明确区分「走 default / 未匹配收口结束(END) / 正常选路」,
  杜绝静默 fall-through 被误当 bug
- compose 层原有 len(chosen)==0 → END 收口保留(无 default 时的安全兜底)
- 3 断言单测:default 命中 / 条件真走 true / 无 default 未命中仍返回空

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-02 10:08:05 +08:00
parent f9c849b14b
commit 4bec95fde1
3 changed files with 48 additions and 4 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ RBAC 未做,暂以单管理员账号代理;概览口径必须是**系统级*
- [x] Map 节点错误传播 + 汇总 ✅ —— writeSection 返回 (body,err) 仅真·LLM 失败计错(预算/无模型是主动降级不算);writeSections 汇总失败数、失败项 Body 带可见标记;mapNode 全失败→置 b.fatalErr(判 failed 非静默 done-空)、部分失败→trace+流式告警。report handleReport 同步提示部分失败。3 单测(全失败/部分精确计数/mapNode 置 fatalErr)。
- [ ] 熔断器接回 failoverharness/circuitbreaker.go 与 llm/failover.go 未接合,可能长卡备用)| M
- [x] coordinator 专家超时 ✅ —— specialistTool 加 timeout(默认 specialistTimeout=3min)InvokableRun 包 WithTimeout;超时作为"观察"跳过该专家(err=nil,lead 据其余综合,不中断协调)。2 单测(超时~50ms 跳过 / 正常不受影响)。
- [ ] Branch else 兜底compose_compiler.go:155 分支无"都不满足"收口)| M
- [x] Branch else 兜底 ✅ —— branchNode 识别 default/else 边,主选择(true/false)未命中时走它;trace 明确区分「走 default / 未匹配收口结束(END) / 正常选路」,杜绝静默落 END 被误当 bug。3 断言单测(default 命中/条件真走 true/无 default 仍空)。compose 层原有 len==0→END 收口保留。
- [ ] DSL 拓扑/节点-工具映射校验(gateway dsl/parser.go:23 TODO,现仅 JSON 格式校验)| M
### [ ] T4.F 健壮性 / 安全 / 性能收口(多为 S,可穿插着做)