mirror of https://github.com/openclaw/openclaw.git
fix: replay compaction and skills api drift
This commit is contained in:
parent
b8069c2bd1
commit
542d62ba93
|
|
@ -56,7 +56,7 @@ describe("compaction retry integration", () => {
|
|||
} as unknown as NonNullable<ExtensionContext["model"]>;
|
||||
|
||||
const invokeGenerateSummary = (signal = new AbortController().signal) =>
|
||||
mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", undefined, signal);
|
||||
mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", signal);
|
||||
|
||||
const runSummaryRetry = (options: Parameters<typeof retryAsync>[1]) =>
|
||||
retryAsync(() => invokeGenerateSummary(), options);
|
||||
|
|
|
|||
|
|
@ -240,7 +240,6 @@ async function summarizeChunks(params: {
|
|||
params.model,
|
||||
params.reserveTokens,
|
||||
params.apiKey,
|
||||
params.headers,
|
||||
params.signal,
|
||||
effectiveInstructions,
|
||||
summary,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
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";
|
||||
|
|
@ -61,10 +60,7 @@ function buildEntry(name: string): SkillEntry {
|
|||
description: `${name} test skill`,
|
||||
filePath: path.join(skillDir, "SKILL.md"),
|
||||
baseDir: skillDir,
|
||||
sourceInfo: createSyntheticSourceInfo(path.join(skillDir, "SKILL.md"), {
|
||||
source: "openclaw-workspace",
|
||||
baseDir: skillDir,
|
||||
}),
|
||||
source: "openclaw-workspace",
|
||||
disableModelInvocation: false,
|
||||
},
|
||||
frontmatter: {},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
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";
|
||||
|
|
@ -18,10 +17,7 @@ describe("buildWorkspaceSkillStatus", () => {
|
|||
description: "test",
|
||||
filePath: "/tmp/os-scoped",
|
||||
baseDir: "/tmp",
|
||||
sourceInfo: createSyntheticSourceInfo("/tmp/os-scoped", {
|
||||
source: "test",
|
||||
baseDir: "/tmp",
|
||||
}),
|
||||
source: "test",
|
||||
disableModelInvocation: false,
|
||||
},
|
||||
frontmatter: {},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
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";
|
||||
|
|
@ -25,10 +24,7 @@ function makeEntry(params: {
|
|||
description: `desc:${params.name}`,
|
||||
filePath: `/tmp/${params.name}/SKILL.md`,
|
||||
baseDir: `/tmp/${params.name}`,
|
||||
sourceInfo: createSyntheticSourceInfo(`/tmp/${params.name}/SKILL.md`, {
|
||||
source: params.source ?? "openclaw-workspace",
|
||||
baseDir: `/tmp/${params.name}`,
|
||||
}),
|
||||
source: params.source ?? "openclaw-workspace",
|
||||
disableModelInvocation: false,
|
||||
},
|
||||
frontmatter: {},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
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";
|
||||
|
|
@ -18,10 +17,7 @@ describe("resolveSkillsPromptForRun", () => {
|
|||
description: "Demo",
|
||||
filePath: "/app/skills/demo-skill/SKILL.md",
|
||||
baseDir: "/app/skills/demo-skill",
|
||||
sourceInfo: createSyntheticSourceInfo("/app/skills/demo-skill/SKILL.md", {
|
||||
source: "openclaw-bundled",
|
||||
baseDir: "/app/skills/demo-skill",
|
||||
}),
|
||||
source: "openclaw-bundled",
|
||||
disableModelInvocation: false,
|
||||
},
|
||||
frontmatter: {},
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
import os from "node:os";
|
||||
import {
|
||||
createSyntheticSourceInfo,
|
||||
formatSkillsForPrompt,
|
||||
type Skill,
|
||||
} from "@mariozechner/pi-coding-agent";
|
||||
import { 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";
|
||||
|
|
@ -19,10 +15,7 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S
|
|||
description: desc,
|
||||
filePath,
|
||||
baseDir: `/skills/${name}`,
|
||||
sourceInfo: createSyntheticSourceInfo(filePath, {
|
||||
source: "workspace",
|
||||
baseDir: `/skills/${name}`,
|
||||
}),
|
||||
source: "workspace",
|
||||
disableModelInvocation: false,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { Skill } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
export function resolveSkillSource(skill: Skill): string {
|
||||
return skill.sourceInfo.source;
|
||||
return skill.source;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
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";
|
||||
|
|
@ -39,10 +38,7 @@ describe("skills-cli (e2e)", () => {
|
|||
description: "Capture UI screenshots",
|
||||
filePath: path.join(baseDir, "SKILL.md"),
|
||||
baseDir,
|
||||
sourceInfo: createSyntheticSourceInfo(path.join(baseDir, "SKILL.md"), {
|
||||
source: "openclaw-bundled",
|
||||
baseDir,
|
||||
}),
|
||||
source: "openclaw-bundled",
|
||||
disableModelInvocation: false,
|
||||
},
|
||||
frontmatter: {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue