test(agents): cover raw model cache trace stage

This commit is contained in:
Vincent Koc
2026-04-28 01:24:53 -07:00
parent 99ceaaa76e
commit 474859aaaa

View File

@@ -91,6 +91,19 @@ describe("createCacheTrace", () => {
expect(event.system).toBe("");
});
it("records raw model run session stages", () => {
const { lines, trace } = createMemoryTraceForTest();
trace?.recordStage("session:raw-model-run", {
messages: [],
system: "",
});
const event = JSON.parse(lines[0]?.trim() ?? "{}") as Record<string, unknown>;
expect(event.stage).toBe("session:raw-model-run");
expect(event.system).toBe("");
});
it("records stream context from systemPrompt when wrapping stream functions", () => {
const lines: string[] = [];
const trace = createCacheTrace({