fix(ci): align sanitize session history tests with transcript types

This commit is contained in:
Vincent Koc
2026-04-05 10:01:18 +01:00
parent f1f8fd5970
commit cc09171929
2 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import type { AgentMessage } from "@mariozechner/pi-agent-core";
import type { SessionManager } from "@mariozechner/pi-coding-agent";
import { expect, vi } from "vitest";
import type { TranscriptPolicy } from "./transcript-policy.js";
export type SessionEntry = { type: string; customType: string; data: unknown };
export type SanitizeSessionHistoryFn = (params: {
@@ -11,6 +12,7 @@ export type SanitizeSessionHistoryFn = (params: {
sessionManager: SessionManager;
sessionId: string;
modelId?: string;
policy?: TranscriptPolicy;
}) => Promise<AgentMessage[]>;
export type SanitizeSessionHistoryMockedHelpers = typeof import("./pi-embedded-helpers.js");
export type SanitizeSessionHistoryHarness = {

View File

@@ -956,7 +956,9 @@ describe("sanitizeSessionHistory", () => {
const baseMessages = castAgentMessages([
makeUserMessage("Read IDENTITY.md"),
makeAssistantMessage(
[{ type: "toolUse", id: priorToolId, name: "read", input: { path: "IDENTITY.md" } }],
[
{ type: "toolUse", id: priorToolId, name: "read", input: { path: "IDENTITY.md" } },
] as unknown as AssistantMessage["content"],
{ stopReason: "toolUse" },
),
{
@@ -973,7 +975,9 @@ describe("sanitizeSessionHistory", () => {
...baseMessages,
makeUserMessage("Ask a subagent for an emoji"),
makeAssistantMessage(
[{ type: "toolUse", id: laterToolId, name: "subagent", input: { prompt: "emoji" } }],
[
{ type: "toolUse", id: laterToolId, name: "subagent", input: { prompt: "emoji" } },
] as unknown as AssistantMessage["content"],
{ stopReason: "toolUse" },
),
{