mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 20:21:35 +00:00
* feat(codex): add native session supervision * fix(codex): harden supervision integration * fix(codex): preserve locked harness ownership * fix(codex): fence native session archive * fix(codex): revalidate archive binding ownership * feat(codex): integrate supervision runtime * feat(sessions): preserve harness-owned execution * feat(sessions): persist harness ownership invariants * feat(gateway): enforce harness-owned sessions * feat(setup): enable detected Codex supervision * feat(mac): expose supervised Codex sessions * feat(ui): make Codex sessions actionable * docs(codex): document session supervision * test(codex): cover integration ownership * chore(i18n): refresh supervision inventories * fix(setup): finalize Codex activation atomically * test(codex): narrow binding store update * fix(sessions): preserve legacy model locks * test(macos): serialize Codex catalog fixtures * fix(sessions): preserve legacy lock admission * chore(i18n): reconcile supervision metadata * test(sessions): mark legacy lock fixture * fix(macos): drain final Codex catalog frame * docs: leave supervision note to release * style(macos): satisfy Codex catalog type length * chore: record session accessor seam owners * fix(macos): honor configured Codex supervision * fix(codex): preserve harness-owned model locks * fix(codex): satisfy supervision lint gates * chore(i18n): refresh native supervision inventory * fix(codex): align supervision validation contracts * fix(codex): close supervision boundary gaps * fix(codex): preserve supervision activation contracts * fix(codex): dispose standalone supervision runtime * fix(codex): pin supervised source connection * fix(plugins): bind delegated runs to exact session target * fix(codex): scope supervised sessions to configured agents * fix(codex): fingerprint effective supervision home * fix(codex): normalize supervision plugin policy * fix(codex): keep supervised bindings stable across upgrades * fix(codex): guard all supervised binding connections * fix(codex): preserve catalog filters and pending CAS identity * fix(codex): preserve supervision identity for diagnostics * fix(codex): bind uncertain commits to supervision connection * fix(codex): satisfy supervision type boundaries * fix(macos): reconcile current main validation * fix(codex): handle absent runtime config in supervision * fix(doctor): own local audio acceleration check * fix(codex): satisfy integration lint gates * fix(codex): satisfy lifecycle safety guards
77 lines
2.3 KiB
TypeScript
77 lines
2.3 KiB
TypeScript
// Codex tests cover command rpc plugin behavior.
|
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
import { CodexAppServerRpcError } from "./app-server/client.js";
|
|
import { codexControlRequest, safeValue } from "./command-rpc.js";
|
|
|
|
const requestCodexAppServerJsonMock = vi.hoisted(() => vi.fn());
|
|
|
|
vi.mock("./app-server/request.js", () => ({
|
|
requestCodexAppServerJson: requestCodexAppServerJsonMock,
|
|
}));
|
|
|
|
describe("Codex command RPC helpers", () => {
|
|
beforeEach(() => {
|
|
requestCodexAppServerJsonMock.mockReset();
|
|
});
|
|
|
|
it("formats unsupported control methods from JSON-RPC error codes", async () => {
|
|
await expect(
|
|
safeValue(async () => {
|
|
throw new CodexAppServerRpcError({ code: -32601, message: "Method not found" }, "x/y");
|
|
}),
|
|
).resolves.toEqual({
|
|
ok: false,
|
|
error: "unsupported by this Codex app-server",
|
|
});
|
|
});
|
|
|
|
it("uses an explicit control connection instead of ordinary harness start options", async () => {
|
|
requestCodexAppServerJsonMock.mockResolvedValue({ thread: { id: "thread-1" } });
|
|
const startOptions = {
|
|
transport: "stdio" as const,
|
|
homeScope: "user" as const,
|
|
command: "codex",
|
|
args: ["app-server", "--listen", "stdio://"],
|
|
headers: {},
|
|
};
|
|
|
|
await codexControlRequest(
|
|
{},
|
|
"thread/read",
|
|
{ threadId: "thread-1", includeTurns: false },
|
|
{ startOptions },
|
|
);
|
|
|
|
expect(requestCodexAppServerJsonMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({ startOptions }),
|
|
);
|
|
});
|
|
|
|
it("forwards explicit native auth for supervised control connections", async () => {
|
|
requestCodexAppServerJsonMock.mockResolvedValue({});
|
|
|
|
await codexControlRequest(
|
|
{},
|
|
"thread/compact/start",
|
|
{ threadId: "thread-1" },
|
|
{
|
|
authProfileId: null,
|
|
},
|
|
);
|
|
|
|
expect(requestCodexAppServerJsonMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({ authProfileId: null }),
|
|
);
|
|
});
|
|
|
|
it("forwards an explicit per-request timeout budget", async () => {
|
|
requestCodexAppServerJsonMock.mockResolvedValue({ data: [] });
|
|
|
|
await codexControlRequest({}, "thread/list", { archived: false }, { timeoutMs: 321 });
|
|
|
|
expect(requestCodexAppServerJsonMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({ timeoutMs: 321 }),
|
|
);
|
|
});
|
|
});
|