mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 15:30:22 +00:00
fix(ci): replay compaction and skills api drift
This commit is contained in:
@@ -267,7 +267,7 @@ async function summarizeChunks(params: {
|
|||||||
params.model,
|
params.model,
|
||||||
params.reserveTokens,
|
params.reserveTokens,
|
||||||
params.apiKey,
|
params.apiKey,
|
||||||
undefined,
|
params.headers,
|
||||||
params.signal,
|
params.signal,
|
||||||
effectiveInstructions,
|
effectiveInstructions,
|
||||||
summary,
|
summary,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
|
||||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { installDownloadSpec } from "./skills-install-download.js";
|
import { installDownloadSpec } from "./skills-install-download.js";
|
||||||
import { setTempStateDir } from "./skills-install.download-test-utils.js";
|
import { setTempStateDir } from "./skills-install.download-test-utils.js";
|
||||||
@@ -73,16 +74,14 @@ function createFixtureSkill(params: {
|
|||||||
baseDir: string;
|
baseDir: string;
|
||||||
source: string;
|
source: string;
|
||||||
}): SkillEntry["skill"] {
|
}): SkillEntry["skill"] {
|
||||||
const skill = {
|
return {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
filePath: params.filePath,
|
filePath: params.filePath,
|
||||||
baseDir: params.baseDir,
|
baseDir: params.baseDir,
|
||||||
source: params.source,
|
sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }),
|
||||||
sourceInfo: { source: params.source },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as SkillEntry["skill"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildDownloadSpec(params: {
|
function buildDownloadSpec(params: {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { buildWorkspaceSkillStatus } from "./skills-status.js";
|
import { buildWorkspaceSkillStatus } from "./skills-status.js";
|
||||||
import type { SkillEntry } from "./skills/types.js";
|
import type { SkillEntry } from "./skills/types.js";
|
||||||
@@ -48,14 +49,12 @@ function createFixtureSkill(params: {
|
|||||||
baseDir: string;
|
baseDir: string;
|
||||||
source: string;
|
source: string;
|
||||||
}): SkillEntry["skill"] {
|
}): SkillEntry["skill"] {
|
||||||
const skill = {
|
return {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
filePath: params.filePath,
|
filePath: params.filePath,
|
||||||
baseDir: params.baseDir,
|
baseDir: params.baseDir,
|
||||||
source: params.source,
|
sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }),
|
||||||
sourceInfo: { source: params.source },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as SkillEntry["skill"];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { withEnv } from "../test-utils/env.js";
|
import { withEnv } from "../test-utils/env.js";
|
||||||
import { buildWorkspaceSkillStatus } from "./skills-status.js";
|
import { buildWorkspaceSkillStatus } from "./skills-status.js";
|
||||||
@@ -43,16 +44,14 @@ function createFixtureSkill(params: {
|
|||||||
baseDir: string;
|
baseDir: string;
|
||||||
source: string;
|
source: string;
|
||||||
}): SkillEntry["skill"] {
|
}): SkillEntry["skill"] {
|
||||||
const skill = {
|
return {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
filePath: params.filePath,
|
filePath: params.filePath,
|
||||||
baseDir: params.baseDir,
|
baseDir: params.baseDir,
|
||||||
source: params.source,
|
sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }),
|
||||||
sourceInfo: { source: params.source },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as SkillEntry["skill"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("buildWorkspaceSkillStatus", () => {
|
describe("buildWorkspaceSkillStatus", () => {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { resolveSkillsPromptForRun } from "./skills.js";
|
import { resolveSkillsPromptForRun } from "./skills.js";
|
||||||
import type { SkillEntry } from "./skills/types.js";
|
import type { SkillEntry } from "./skills/types.js";
|
||||||
@@ -37,14 +38,12 @@ function createFixtureSkill(params: {
|
|||||||
baseDir: string;
|
baseDir: string;
|
||||||
source: string;
|
source: string;
|
||||||
}): SkillEntry["skill"] {
|
}): SkillEntry["skill"] {
|
||||||
const skill = {
|
return {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
filePath: params.filePath,
|
filePath: params.filePath,
|
||||||
baseDir: params.baseDir,
|
baseDir: params.baseDir,
|
||||||
source: params.source,
|
sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }),
|
||||||
sourceInfo: { source: params.source },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as SkillEntry["skill"];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import os from "node:os";
|
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 { describe, expect, it } from "vitest";
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
import type { SkillEntry } from "./types.js";
|
import type { SkillEntry } from "./types.js";
|
||||||
@@ -10,16 +14,14 @@ import {
|
|||||||
} from "./workspace.js";
|
} from "./workspace.js";
|
||||||
|
|
||||||
function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/SKILL.md`): Skill {
|
function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/SKILL.md`): Skill {
|
||||||
const skill = {
|
return {
|
||||||
name,
|
name,
|
||||||
description: desc,
|
description: desc,
|
||||||
filePath,
|
filePath,
|
||||||
baseDir: `/skills/${name}`,
|
baseDir: `/skills/${name}`,
|
||||||
source: "workspace",
|
sourceInfo: createSyntheticSourceInfo(filePath, { source: "workspace" }),
|
||||||
sourceInfo: { source: "workspace" },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as Skill;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeEntry(skill: Skill): SkillEntry {
|
function makeEntry(skill: Skill): SkillEntry {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
|
||||||
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
||||||
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
|
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
|
||||||
import type { SkillEntry } from "../agents/skills.js";
|
import type { SkillEntry } from "../agents/skills.js";
|
||||||
@@ -91,14 +92,12 @@ function createFixtureSkill(params: {
|
|||||||
baseDir: string;
|
baseDir: string;
|
||||||
source: string;
|
source: string;
|
||||||
}): SkillEntry["skill"] {
|
}): SkillEntry["skill"] {
|
||||||
const skill = {
|
return {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
filePath: params.filePath,
|
filePath: params.filePath,
|
||||||
baseDir: params.baseDir,
|
baseDir: params.baseDir,
|
||||||
source: params.source,
|
sourceInfo: createSyntheticSourceInfo(params.filePath, { source: params.source }),
|
||||||
sourceInfo: { source: params.source },
|
|
||||||
disableModelInvocation: false,
|
disableModelInvocation: false,
|
||||||
};
|
};
|
||||||
return skill as unknown as SkillEntry["skill"];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user