fix(dictionary): 修复 AI 编排系统的错误处理和超时控制

- 修复 orchestrator 中 throw 字符串的问题,改为 throw LookUpError
- 为 zhipu.ts 添加 30 秒超时控制,防止 LLM 调用卡死
- stage1 添加 isEmpty 和 isNaturalLanguage 字段验证
- stage2 改为降级处理而非直接失败,提升用户体验
- types.ts 添加 canMap 字段
- AGENTS.md 添加禁止擅自运行 pnpm dev 的说明
This commit is contained in:
2026-03-09 17:19:12 +08:00
parent 6ba5ae993a
commit 3652e350e6
6 changed files with 33 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ export async function executeDictionaryLookup(
if (!standardFormResult.standardForm) {
log.error("[Stage 3] Standard form is empty");
throw "无法生成标准形式";
throw new LookUpError("无法生成标准形式");
}
log.debug("[Stage 3] Standard form complete", { standardFormResult });