Files
openclaw/extensions/qa-lab/index.ts
Peter Steinberger d14bb8ec44 fix: resume replay-safe work after gateway restarts (#104997)
* fix: resume replay-safe work after gateway restart

* chore: leave restart note to release process

* fix: sync restart recovery protocol artifacts
2026-07-12 06:37:22 +01:00

63 lines
2.0 KiB
TypeScript

// Qa Lab plugin entrypoint registers its OpenClaw integration.
import { setTimeout as sleep } from "node:timers/promises";
import { jsonResult } from "openclaw/plugin-sdk/tool-results";
import { definePluginEntry } from "./runtime-api.js";
import { registerQaLabCli } from "./src/cli.js";
import { createQaLabWebSearchProvider } from "./src/qa-web-search-provider.js";
import { createStaticSshWorkerProvider } from "./src/static-ssh-worker-provider.js";
const EMPTY_TOOL_PARAMETERS = {
type: "object",
properties: {},
additionalProperties: false,
} as const;
export default definePluginEntry({
id: "qa-lab",
name: "QA Lab",
description: "Private QA automation harness and debugger UI",
register(api) {
api.registerTool(
{
name: "qa_restart_wait",
label: "QA Restart Wait",
description: "Hold a replay-safe QA call pending until restart aborts the run.",
parameters: EMPTY_TOOL_PARAMETERS,
async execute(_toolCallId, _params, signal) {
await sleep(30_000, undefined, { signal });
return jsonResult({ status: "released" });
},
},
{ name: "qa_restart_wait" },
);
api.registerTool(
{
name: "qa_restart_unsafe_probe",
label: "QA Restart Unsafe Probe",
description: "Detect whether restart recovery permits a non-replay-safe plugin call.",
parameters: EMPTY_TOOL_PARAMETERS,
async execute() {
return jsonResult({ status: "unsafe-probe-executed" });
},
},
{ name: "qa_restart_unsafe_probe" },
);
api.registerWorkerProvider(createStaticSshWorkerProvider());
api.registerWebSearchProvider(createQaLabWebSearchProvider());
api.registerCli(
async ({ program }) => {
registerQaLabCli(program);
},
{
descriptors: [
{
name: "qa",
description: "Run QA scenarios and launch the private QA debugger UI",
hasSubcommands: true,
},
],
},
);
},
});