feat(agent): 审美分析 - 接入费用确认与阶段任务恢复
This commit is contained in:
1 parent
757d1dd2c7
commit
d0024fbbc6
13 files changed
+432
-27
No files matched your search
@@ -3,7 +3,7 @@ import { executeArtCritique } from "../src/services/art-critique-execution";
|
||||
import { defaultConfig } from "../src/stores/use-config-store";
|
||||
import { createCanvasNode } from "../src/lib/canvas/canvas-project-domain";
|
||||
import { CanvasNodeType } from "../src/types/canvas";
|
||||
import type { ArtCritiquePipelineOptions } from "../src/lib/art-critique/pipeline";
|
||||
import { runArtCritiquePipeline, type ArtCritiquePipelineOptions } from "../src/lib/art-critique/pipeline";
|
||||
|
||||
const source = createCanvasNode(CanvasNodeType.Image, { x: 0, y: 0 }, { storageKey: "resource:original" });
|
||||
const options = () => ({ nodeId: "analysis", runId: "run", source, config: defaultConfig, signal: new AbortController().signal, onTaskCreated: (_stage: string, _id: string) => {} });
|
||||
@@ -44,3 +44,12 @@ test("准备素材期间取消不会提交后台模型任务", async () => {
|
||||
})).rejects.toThrow();
|
||||
expect(submitted).toBe(false);
|
||||
});
|
||||
|
||||
test("审批执行器中止不能被管线降级为已完成报告", async () => {
|
||||
await expect(runArtCritiquePipeline({ ...defaultConfig, textModel: "model" }, { dataUrl: "resource:image", title: "image", sourceFingerprint: "image" }, {
|
||||
requestStage: async ({ toolName }) => {
|
||||
if (toolName === "analyze_art_scene") throw new DOMException("报价服务不可用", "AbortError");
|
||||
return { content: "", toolCalls: [{ id: toolName, type: "function", function: { name: toolName, arguments: JSON.stringify({ candidates: [] }) } }] };
|
||||
},
|
||||
})).rejects.toThrow("报价服务不可用");
|
||||
});
|
||||
Reference in new issue
Block a user