mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 23:51:48 +00:00
fix(ci): align sanitize session history tests with transcript types
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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" },
|
||||
),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user