mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 02:45:38 -06:00
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
// Covers plugin middleware that can transform agent tool results.
|
|
import { describe, expect, it } from "vitest";
|
|
import { normalizeAgentToolResultMiddlewareRuntimes } from "./agent-tool-result-middleware.js";
|
|
|
|
describe("normalizeAgentToolResultMiddlewareRuntimes", () => {
|
|
it("defaults omitted runtimes to every supported runtime", () => {
|
|
expect(normalizeAgentToolResultMiddlewareRuntimes()).toEqual(["openclaw", "codex"]);
|
|
});
|
|
|
|
it("preserves an explicit empty runtime list", () => {
|
|
expect(normalizeAgentToolResultMiddlewareRuntimes({ runtimes: [] })).toEqual([]);
|
|
});
|
|
|
|
it("normalizes legacy harness names", () => {
|
|
expect(
|
|
normalizeAgentToolResultMiddlewareRuntimes({ harnesses: ["codex-app-server", "openclaw"] }),
|
|
).toEqual(["codex", "openclaw"]);
|
|
});
|
|
|
|
it("falls back to legacy harnesses when runtimes is undefined", () => {
|
|
expect(
|
|
normalizeAgentToolResultMiddlewareRuntimes({
|
|
runtimes: undefined,
|
|
harnesses: ["codex-app-server"],
|
|
}),
|
|
).toEqual(["codex"]);
|
|
});
|
|
});
|