feat: add persisted batch text testing

This commit is contained in:
Xin Wang
2026-08-10 13:49:24 +08:00
parent 5b8b9fd097
commit 19e8c8c108
27 changed files with 3855 additions and 1450 deletions
@@ -3,7 +3,6 @@
/**
* 批量测试用例详情面板。
* 与 prompt mode DebugDrawer overlay 相同:作为右侧 flex 半屏,无遮罩/模糊。
* 当前展示前端 mock 数据,后续可直接替换为真实执行事件与校验结果。
*/
import {
@@ -79,7 +78,7 @@ export function BatchCaseDetailDrawer({
{item.name}
</h2>
<p className="truncate text-xs text-muted-soft">
被测助手:{assistantName} · Mock 结果
被测助手:{assistantName} · Pipeline 结果
</p>
</div>
<BatchCaseStatusBadge status={item.status} />
@@ -99,12 +98,7 @@ export function BatchCaseDetailDrawer({
<section className="rounded-2xl border border-hairline bg-canvas-soft px-4 py-3.5">
<p className="text-xs font-medium text-foreground">执行契约</p>
<p className="mt-1 text-xs leading-5 text-muted-soft">
{item.turns.length} 轮固定输入 ·{" "}
{item.turns.reduce(
(sum, turn) => sum + turn.evaluations.length,
0,
) + item.overallCriteria.length}{" "}
项评估标准 · 全部通过才算通过
正在执行固定文字脚本;完成后将展示每一轮回复、工具调用和全部评估标准。
</p>
</section>
<ExecutionTimeline status={item.status} />
@@ -288,7 +282,7 @@ function ToolCallCard({ toolCall }: { toolCall: BatchToolCallRecord }) {
</div>
<div className="mt-2 grid gap-2 sm:grid-cols-2">
<CodeResult label="参数" value={toolCall.argumentsJson} />
<CodeResult label="Mock 返回" value={toolCall.resultJson} />
<CodeResult label="工具返回" value={toolCall.resultJson} />
</div>
</div>
);
@@ -401,7 +395,7 @@ function ExecutionTimeline({ status }: { status: "waiting" | "running" }) {
},
{
label: "请求助手响应",
detail: isRunning ? "生成中(Mock)" : "尚未开始",
detail: isRunning ? "Pipeline 生成中" : "尚未开始",
state: isRunning ? "active" : "pending",
},
{