feat(FN-2477): add executable OpenClaw runtime adapter
- Replace deferred OpenClaw placeholder runtime with an executable adapter that creates sessions, prompts with fallback, describes models, and disposes safely - Add a dedicated pi-module seam and local runtime contract types to decouple plugin compilation from engine internals while preserving runtime behavior - Update OpenClaw plugin metadata, manifest/package descriptions, and README to reflect active execution support instead of deferred status - Harden dashboard DevServerStore save flow against ENOENT temp-directory races and add regression coverage for project-directory removal during save
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import os from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
DEV_SERVER_CONFIG_DEFAULTS,
|
||||
DEV_SERVER_DEFAULT_STATE,
|
||||
@@ -26,6 +26,7 @@ describe("DevServerStore", () => {
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
for (const dir of tempDirs.splice(0)) {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
@@ -315,6 +316,21 @@ describe("DevServerStore", () => {
|
||||
expect(persisted.state.logHistory).toEqual([]);
|
||||
});
|
||||
|
||||
it("treats ENOENT as non-fatal when project directory is removed during save", async () => {
|
||||
const projectDir = createTempProject();
|
||||
tempDirs.push(projectDir);
|
||||
|
||||
const store = new DevServerStore(projectDir);
|
||||
await store.load();
|
||||
|
||||
rmSync(projectDir, { recursive: true, force: true });
|
||||
|
||||
await expect(store.updateState({ id: "gone", status: "stopped" })).resolves.toMatchObject({
|
||||
id: "gone",
|
||||
status: "stopped",
|
||||
});
|
||||
});
|
||||
|
||||
it("singleton cache returns same instance for same path", async () => {
|
||||
const projectDir = createTempProject();
|
||||
tempDirs.push(projectDir);
|
||||
|
||||
Reference in New Issue
Block a user