From fa4da0ce5d8a1e31df378b9fdb04059fee84d1d7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 28 Mar 2026 00:43:47 +0000 Subject: [PATCH] fix(ci): replay compaction and skills api drift --- src/agents/compaction.ts | 2 +- src/agents/skills-install.download.test.ts | 7 +++---- src/agents/skills-status.test.ts | 7 +++---- src/agents/skills.buildworkspaceskillstatus.test.ts | 7 +++---- src/agents/skills.resolveskillspromptforrun.test.ts | 7 +++---- src/agents/skills/compact-format.test.ts | 12 +++++++----- src/cli/skills-cli.formatting.test.ts | 7 +++---- 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/agents/compaction.ts b/src/agents/compaction.ts index 12d269f67ec..8fab4fd2132 100644 --- a/src/agents/compaction.ts +++ b/src/agents/compaction.ts @@ -267,7 +267,7 @@ async function summarizeChunks(params: { params.model, params.reserveTokens, params.apiKey, - undefined, + params.headers, params.signal, effectiveInstructions, summary, diff --git a/src/agents/skills-install.download.test.ts b/src/agents/skills-install.download.test.ts index 481978a9e2d..7bccd0a6863 100644 --- a/src/agents/skills-install.download.test.ts +++ b/src/agents/skills-install.download.test.ts @@ -1,6 +1,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; +import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent"; import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { installDownloadSpec } from "./skills-install-download.js"; import { setTempStateDir } from "./skills-install.download-test-utils.js"; @@ -73,16 +74,14 @@ function createFixtureSkill(params: { baseDir: string; source: string; }): SkillEntry["skill"] { - const skill = { + return { name: params.name, description: params.description, filePath: params.filePath, baseDir: params.baseDir, - source: params.source, - sourceInfo: { source: params.source }, + sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }), disableModelInvocation: false, }; - return skill as unknown as SkillEntry["skill"]; } function buildDownloadSpec(params: { diff --git a/src/agents/skills-status.test.ts b/src/agents/skills-status.test.ts index d42ba3fbf10..0e279327316 100644 --- a/src/agents/skills-status.test.ts +++ b/src/agents/skills-status.test.ts @@ -1,3 +1,4 @@ +import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent"; import { describe, expect, it } from "vitest"; import { buildWorkspaceSkillStatus } from "./skills-status.js"; import type { SkillEntry } from "./skills/types.js"; @@ -48,14 +49,12 @@ function createFixtureSkill(params: { baseDir: string; source: string; }): SkillEntry["skill"] { - const skill = { + return { name: params.name, description: params.description, filePath: params.filePath, baseDir: params.baseDir, - source: params.source, - sourceInfo: { source: params.source }, + sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }), disableModelInvocation: false, }; - return skill as unknown as SkillEntry["skill"]; } diff --git a/src/agents/skills.buildworkspaceskillstatus.test.ts b/src/agents/skills.buildworkspaceskillstatus.test.ts index ee32ff07cf7..c4defcf64dd 100644 --- a/src/agents/skills.buildworkspaceskillstatus.test.ts +++ b/src/agents/skills.buildworkspaceskillstatus.test.ts @@ -1,3 +1,4 @@ +import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent"; import { describe, expect, it } from "vitest"; import { withEnv } from "../test-utils/env.js"; import { buildWorkspaceSkillStatus } from "./skills-status.js"; @@ -43,16 +44,14 @@ function createFixtureSkill(params: { baseDir: string; source: string; }): SkillEntry["skill"] { - const skill = { + return { name: params.name, description: params.description, filePath: params.filePath, baseDir: params.baseDir, - source: params.source, - sourceInfo: { source: params.source }, + sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }), disableModelInvocation: false, }; - return skill as unknown as SkillEntry["skill"]; } describe("buildWorkspaceSkillStatus", () => { diff --git a/src/agents/skills.resolveskillspromptforrun.test.ts b/src/agents/skills.resolveskillspromptforrun.test.ts index 446757bedec..15c47b742a5 100644 --- a/src/agents/skills.resolveskillspromptforrun.test.ts +++ b/src/agents/skills.resolveskillspromptforrun.test.ts @@ -1,3 +1,4 @@ +import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent"; import { describe, expect, it } from "vitest"; import { resolveSkillsPromptForRun } from "./skills.js"; import type { SkillEntry } from "./skills/types.js"; @@ -37,14 +38,12 @@ function createFixtureSkill(params: { baseDir: string; source: string; }): SkillEntry["skill"] { - const skill = { + return { name: params.name, description: params.description, filePath: params.filePath, baseDir: params.baseDir, - source: params.source, - sourceInfo: { source: params.source }, + sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }), disableModelInvocation: false, }; - return skill as unknown as SkillEntry["skill"]; } diff --git a/src/agents/skills/compact-format.test.ts b/src/agents/skills/compact-format.test.ts index 8f44c0f6224..f532ce1d199 100644 --- a/src/agents/skills/compact-format.test.ts +++ b/src/agents/skills/compact-format.test.ts @@ -1,5 +1,9 @@ import os from "node:os"; -import { formatSkillsForPrompt, type Skill } from "@mariozechner/pi-coding-agent"; +import { + createSyntheticSourceInfo, + formatSkillsForPrompt, + type Skill, +} from "@mariozechner/pi-coding-agent"; import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import type { SkillEntry } from "./types.js"; @@ -10,16 +14,14 @@ import { } from "./workspace.js"; function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/SKILL.md`): Skill { - const skill = { + return { name, description: desc, filePath, baseDir: `/skills/${name}`, - source: "workspace", - sourceInfo: { source: "workspace" }, + sourceInfo: createSyntheticSourceInfo(filePath, { source: "workspace" }), disableModelInvocation: false, }; - return skill as unknown as Skill; } function makeEntry(skill: Skill): SkillEntry { diff --git a/src/cli/skills-cli.formatting.test.ts b/src/cli/skills-cli.formatting.test.ts index e7672c7962f..c5dd9499d5c 100644 --- a/src/cli/skills-cli.formatting.test.ts +++ b/src/cli/skills-cli.formatting.test.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; +import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildWorkspaceSkillStatus } from "../agents/skills-status.js"; import type { SkillEntry } from "../agents/skills.js"; @@ -91,14 +92,12 @@ function createFixtureSkill(params: { baseDir: string; source: string; }): SkillEntry["skill"] { - const skill = { + return { name: params.name, description: params.description, filePath: params.filePath, baseDir: params.baseDir, - source: params.source, - sourceInfo: { source: params.source }, + sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }), disableModelInvocation: false, }; - return skill as unknown as SkillEntry["skill"]; }