fix: harden AI analysis and seed defaults
This commit is contained in:
@@ -140,7 +140,7 @@ const analysis: ElderAiAnalysisHistoryItem = {
|
||||
modelSummary: {
|
||||
provider: "openai-compatible",
|
||||
chatModel: "gpt-test",
|
||||
embeddingModel: "embedding-test",
|
||||
knowledgeRetrieval: "keyword",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -293,14 +293,14 @@ describe("AI API routes", () => {
|
||||
});
|
||||
|
||||
it("propagates knowledge service failures with the service status", async () => {
|
||||
vi.mocked(createKnowledgeEntry).mockResolvedValue({ success: false, reason: "知识库向量生成失败", status: 500 });
|
||||
vi.mocked(createKnowledgeEntry).mockResolvedValue({ success: false, reason: "知识库创建失败", status: 500 });
|
||||
|
||||
const { POST } = await import("./knowledge/route");
|
||||
const response = await POST(jsonRequest({ ...knowledgeInput }));
|
||||
const body = await readJson(response);
|
||||
|
||||
expect(response.status).toBe(500);
|
||||
expect(body).toEqual({ success: false, reason: "知识库向量生成失败" });
|
||||
expect(body).toEqual({ success: false, reason: "知识库创建失败" });
|
||||
expect(recordAuditLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user