From 00b807069901f5f11108497f1d4793a3368cadde Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Wed, 5 Aug 2026 01:49:55 +0800 Subject: [PATCH] fix(bom-costing): auto-recover empty model responses --- .../bom-costing/bom-costing-multimodal-gateway.test.ts | 4 ++++ .../services/bom-costing/bom-costing-multimodal-gateway.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.test.ts b/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.test.ts index b6fe1837..bd7e8c37 100644 --- a/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.test.ts +++ b/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.test.ts @@ -76,6 +76,10 @@ describe('BOM 多模态网关', () => { ErrorCode.BOM_COSTING_INVALID_PROVIDER, '多模态分析服务暂时无法连接', ))).toBe(true) + expect(isBomCostingMultimodalTransientError(new AppError( + ErrorCode.BOM_COSTING_INVALID_PROVIDER, + '多模态分析服务没有返回可读取的结果', + ))).toBe(true) expect(isBomCostingMultimodalTransientError(new AppError( ErrorCode.BOM_COSTING_INVALID_PROVIDER, '多模态分析返回的 SKU 信息不完整,请重新处理', diff --git a/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.ts b/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.ts index 9602eacc..72f269ab 100644 --- a/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.ts +++ b/furniture-3d-system/src/server/services/bom-costing/bom-costing-multimodal-gateway.ts @@ -384,6 +384,8 @@ export function isBomCostingMultimodalTransientError(error: unknown) { error.message.startsWith('多模态 BOM 分析超时') || error.message.startsWith('多模态分析服务处理超时') || error.message.startsWith('多模态分析服务暂时无法连接') || + error.message.startsWith('多模态分析服务没有返回可读取的结果') || + error.message.startsWith('多模态分析服务未返回可读取的结果流') || error.message.startsWith('多模态分析返回的 SKU 信息不完整') || error.message.startsWith('多模态分析返回的产品结构信息不完整') )