fix(opencode): restore stable v1 runtime

This commit is contained in:
2026-08-05 17:59:35 +08:00
parent 764a1f4e82
commit 1407dd3bbe
33 changed files with 1106 additions and 1668 deletions
+8 -11
View File
@@ -7,9 +7,6 @@ import { createSkillManagerTool } from "../../.opencode/tools/skill_manager.js";
import { type RuntimeSessionContext } from "../../src/runtime/sessionContext.js";
import { SkillStore } from "../../src/skills/store.js";
const toolContent = async (result: Promise<{ content?: string }>) =>
(await result).content ?? "";
describe("skill_manager tool", () => {
let tempDir: string;
let skillStore: SkillStore;
@@ -64,7 +61,7 @@ describe("skill_manager tool", () => {
);
const writeResult = JSON.parse(
await toolContent(tool.execute(
await tool.execute(
{
action: "write_skill",
content: skillDocument("# Pressure Review"),
@@ -72,7 +69,7 @@ describe("skill_manager tool", () => {
skill_path: "workflow/pressure-review",
},
toolContext,
)),
) as string,
);
expect(writeResult.decision).toBe("accepted");
await expect(readFile(writeResult.target, "utf8")).resolves.toContain(
@@ -80,7 +77,7 @@ describe("skill_manager tool", () => {
);
const updateResult = JSON.parse(
await toolContent(tool.execute(
await tool.execute(
{
action: "write_skill",
content: skillDocument("# Updated Pressure Review"),
@@ -88,7 +85,7 @@ describe("skill_manager tool", () => {
skill_path: "workflow/pressure-review",
},
toolContext,
)),
) as string,
);
expect(updateResult.decision).toBe("accepted");
await expect(readFile(updateResult.target, "utf8")).resolves.toContain(
@@ -96,14 +93,14 @@ describe("skill_manager tool", () => {
);
const removeResult = JSON.parse(
await toolContent(tool.execute(
await tool.execute(
{
action: "remove_skill",
reason: "workflow is obsolete",
skill_path: "workflow/pressure-review",
},
toolContext,
)),
) as string,
);
expect(removeResult.decision).toBe("accepted");
await expect(readFile(removeResult.target, "utf8")).rejects.toThrow();
@@ -117,7 +114,7 @@ describe("skill_manager tool", () => {
);
const writeResult = JSON.parse(
await toolContent(tool.execute(
await tool.execute(
{
action: "write_skill",
content: [
@@ -132,7 +129,7 @@ describe("skill_manager tool", () => {
skill_path: "__root__",
},
toolContext,
)),
) as string,
);
expect(writeResult.decision).toBe("accepted");