Skip to content

Commit d9ff853

Browse files
committed
style(webapp): format the agent eval and step-cache tests
1 parent 32553b9 commit d9ff853

2 files changed

Lines changed: 26 additions & 15 deletions

File tree

internal-packages/dashboard-agent/src/eval-redaction.test.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ import { toolResultErrored } from "./eval-turn";
1212

1313
type Messages = Parameters<typeof extractToolActivity>[0];
1414

15-
function turn(
16-
toolName: string,
17-
input: unknown,
18-
output: unknown,
19-
toolCallId = "tc1"
20-
): Messages {
15+
function turn(toolName: string, input: unknown, output: unknown, toolCallId = "tc1"): Messages {
2116
return [
2217
{ role: "assistant", content: [{ type: "tool-call", toolCallId, toolName, input }] },
2318
{ role: "tool", content: [{ type: "tool-result", toolCallId, toolName, output }] },
@@ -106,10 +101,19 @@ describe("the eval judge payload's size", () => {
106101
it("caps a nine-step turn below the aggregate limit", () => {
107102
const messages: Messages = [];
108103
for (let step = 0; step < 9; step++) {
109-
messages.push(...turn("get_run_trace", { runId: `run_${step}` }, {
110-
type: "json",
111-
value: { spans: Array.from({ length: 200 }, () => ({ attributes: { body: "q".repeat(50) } })) },
112-
}, `tc${step}`));
104+
messages.push(
105+
...turn(
106+
"get_run_trace",
107+
{ runId: `run_${step}` },
108+
{
109+
type: "json",
110+
value: {
111+
spans: Array.from({ length: 200 }, () => ({ attributes: { body: "q".repeat(50) } })),
112+
},
113+
},
114+
`tc${step}`
115+
)
116+
);
113117
}
114118

115119
const activity = extractToolActivity(messages);
@@ -133,10 +137,14 @@ describe("an errored tool result", () => {
133137

134138
it("still reads as an error after redaction", () => {
135139
const activity = extractToolActivity(
136-
turn("run_query", { runId: "run_1" }, {
137-
type: "error-text",
138-
value: "boom on alice@example.com",
139-
})
140+
turn(
141+
"run_query",
142+
{ runId: "run_1" },
143+
{
144+
type: "error-text",
145+
value: "boom on alice@example.com",
146+
}
147+
)
140148
);
141149

142150
expect(JSON.stringify(activity)).not.toContain("alice@example.com");

internal-packages/dashboard-agent/src/step-cache.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ describe("the step cache breakpoint", () => {
6868
it("drops a stale step breakpoint when the tail is no longer worth one", () => {
6969
const marked = markStepCacheBreakpoint([turnHistory(), toolResult(MIN_STEP_CACHE_CHARS)]);
7070
// Compaction rebuilt the history as a short summary.
71-
const compacted = markStepCacheBreakpoint([turnHistory(), { ...marked.at(-1)!, content: "ok" }]);
71+
const compacted = markStepCacheBreakpoint([
72+
turnHistory(),
73+
{ ...marked.at(-1)!, content: "ok" },
74+
]);
7275

7376
expect(compacted.filter((message) => ttlOf(message) === "5m")).toHaveLength(0);
7477
});

0 commit comments

Comments
 (0)