Skip to content

Commit 542d62b

Browse files
committed
fix: replay compaction and skills api drift
1 parent b8069c2 commit 542d62b

9 files changed

+9
-37
lines changed

src/agents/compaction.retry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe("compaction retry integration", () => {
5656
} as unknown as NonNullable<ExtensionContext["model"]>;
5757

5858
const invokeGenerateSummary = (signal = new AbortController().signal) =>
59-
mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", undefined, signal);
59+
mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", signal);
6060

6161
const runSummaryRetry = (options: Parameters<typeof retryAsync>[1]) =>
6262
retryAsync(() => invokeGenerateSummary(), options);

src/agents/compaction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ async function summarizeChunks(params: {
240240
params.model,
241241
params.reserveTokens,
242242
params.apiKey,
243-
params.headers,
244243
params.signal,
245244
effectiveInstructions,
246245
summary,

src/agents/skills-install.download.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from "node:fs/promises";
22
import os from "node:os";
33
import path from "node:path";
4-
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
54
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
65
import { installDownloadSpec } from "./skills-install-download.js";
76
import { setTempStateDir } from "./skills-install.download-test-utils.js";
@@ -61,10 +60,7 @@ function buildEntry(name: string): SkillEntry {
6160
description: `${name} test skill`,
6261
filePath: path.join(skillDir, "SKILL.md"),
6362
baseDir: skillDir,
64-
sourceInfo: createSyntheticSourceInfo(path.join(skillDir, "SKILL.md"), {
65-
source: "openclaw-workspace",
66-
baseDir: skillDir,
67-
}),
63+
source: "openclaw-workspace",
6864
disableModelInvocation: false,
6965
},
7066
frontmatter: {},

src/agents/skills-status.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
21
import { describe, expect, it } from "vitest";
32
import { buildWorkspaceSkillStatus } from "./skills-status.js";
43
import type { SkillEntry } from "./skills/types.js";
@@ -18,10 +17,7 @@ describe("buildWorkspaceSkillStatus", () => {
1817
description: "test",
1918
filePath: "/tmp/os-scoped",
2019
baseDir: "/tmp",
21-
sourceInfo: createSyntheticSourceInfo("/tmp/os-scoped", {
22-
source: "test",
23-
baseDir: "/tmp",
24-
}),
20+
source: "test",
2521
disableModelInvocation: false,
2622
},
2723
frontmatter: {},

src/agents/skills.buildworkspaceskillstatus.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
21
import { describe, expect, it } from "vitest";
32
import { withEnv } from "../test-utils/env.js";
43
import { buildWorkspaceSkillStatus } from "./skills-status.js";
@@ -25,10 +24,7 @@ function makeEntry(params: {
2524
description: `desc:${params.name}`,
2625
filePath: `/tmp/${params.name}/SKILL.md`,
2726
baseDir: `/tmp/${params.name}`,
28-
sourceInfo: createSyntheticSourceInfo(`/tmp/${params.name}/SKILL.md`, {
29-
source: params.source ?? "openclaw-workspace",
30-
baseDir: `/tmp/${params.name}`,
31-
}),
27+
source: params.source ?? "openclaw-workspace",
3228
disableModelInvocation: false,
3329
},
3430
frontmatter: {},

src/agents/skills.resolveskillspromptforrun.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
21
import { describe, expect, it } from "vitest";
32
import { resolveSkillsPromptForRun } from "./skills.js";
43
import type { SkillEntry } from "./skills/types.js";
@@ -18,10 +17,7 @@ describe("resolveSkillsPromptForRun", () => {
1817
description: "Demo",
1918
filePath: "/app/skills/demo-skill/SKILL.md",
2019
baseDir: "/app/skills/demo-skill",
21-
sourceInfo: createSyntheticSourceInfo("/app/skills/demo-skill/SKILL.md", {
22-
source: "openclaw-bundled",
23-
baseDir: "/app/skills/demo-skill",
24-
}),
20+
source: "openclaw-bundled",
2521
disableModelInvocation: false,
2622
},
2723
frontmatter: {},

src/agents/skills/compact-format.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import os from "node:os";
2-
import {
3-
createSyntheticSourceInfo,
4-
formatSkillsForPrompt,
5-
type Skill,
6-
} from "@mariozechner/pi-coding-agent";
2+
import { formatSkillsForPrompt, type Skill } from "@mariozechner/pi-coding-agent";
73
import { describe, expect, it } from "vitest";
84
import type { OpenClawConfig } from "../../config/config.js";
95
import type { SkillEntry } from "./types.js";
@@ -19,10 +15,7 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S
1915
description: desc,
2016
filePath,
2117
baseDir: `/skills/${name}`,
22-
sourceInfo: createSyntheticSourceInfo(filePath, {
23-
source: "workspace",
24-
baseDir: `/skills/${name}`,
25-
}),
18+
source: "workspace",
2619
disableModelInvocation: false,
2720
};
2821
}

src/agents/skills/source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Skill } from "@mariozechner/pi-coding-agent";
22

33
export function resolveSkillSource(skill: Skill): string {
4-
return skill.sourceInfo.source;
4+
return skill.source;
55
}

src/cli/skills-cli.formatting.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from "node:fs";
22
import os from "node:os";
33
import path from "node:path";
4-
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
54
import { afterAll, beforeAll, describe, expect, it } from "vitest";
65
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
76
import type { SkillEntry } from "../agents/skills.js";
@@ -39,10 +38,7 @@ describe("skills-cli (e2e)", () => {
3938
description: "Capture UI screenshots",
4039
filePath: path.join(baseDir, "SKILL.md"),
4140
baseDir,
42-
sourceInfo: createSyntheticSourceInfo(path.join(baseDir, "SKILL.md"), {
43-
source: "openclaw-bundled",
44-
baseDir,
45-
}),
41+
source: "openclaw-bundled",
4642
disableModelInvocation: false,
4743
},
4844
frontmatter: {},

0 commit comments

Comments
 (0)