Skip to content

Commit 21e6509

Browse files
playground:improve thread and add hoststyles (#1877)
1 parent 8a76049 commit 21e6509

9 files changed

Lines changed: 819 additions & 200 deletions

mcpjam-inspector/client/src/components/evals/__tests__/compare-playground-helpers.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, it } from "vitest";
22
import {
3+
buildComparePreviewTrace,
34
buildHistoricalCompareRunRecords,
45
buildCompareRunRecord,
56
mergeAdvancedConfigWithOverride,
@@ -123,6 +124,37 @@ describe("compare-playground-helpers", () => {
123124
expect(record.metrics.durationMs).toBe(4000);
124125
});
125126

127+
it("builds a one-message preview trace from the first non-empty prompt turn", () => {
128+
expect(
129+
buildComparePreviewTrace([
130+
{
131+
id: "turn-1",
132+
prompt: " ",
133+
expectedToolCalls: [],
134+
},
135+
{
136+
id: "turn-2",
137+
prompt: "Tell me a joke",
138+
expectedToolCalls: [],
139+
},
140+
]),
141+
).toEqual({
142+
messages: [{ role: "user", content: "Tell me a joke" }],
143+
});
144+
});
145+
146+
it("returns no preview trace when every prompt turn is empty", () => {
147+
expect(
148+
buildComparePreviewTrace([
149+
{
150+
id: "turn-1",
151+
prompt: " ",
152+
expectedToolCalls: [],
153+
},
154+
]),
155+
).toBeNull();
156+
});
157+
126158
it("computes mismatch counts for a compare run record", () => {
127159
const record = buildCompareRunRecord({
128160
modelValue: "openai/gpt-5",

0 commit comments

Comments
 (0)