mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-19 17:21:38 +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
90 lines
2.9 KiB
TypeScript
90 lines
2.9 KiB
TypeScript
// Codex tests cover harness plugin behavior.
|
|
import { describe, expect, it } from "vitest";
|
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
import {
|
|
createCodexTestBindingStore,
|
|
sessionBindingIdentity,
|
|
testCodexAppServerBindingStore,
|
|
} from "./src/app-server/session-binding.test-helpers.js";
|
|
|
|
describe("Codex agent harness supports()", () => {
|
|
const harness = createCodexAppServerAgentHarness({
|
|
bindingStore: testCodexAppServerBindingStore,
|
|
});
|
|
|
|
it("supports the canonical codex virtual provider", () => {
|
|
expect(harness.supports({ provider: "codex", requestedRuntime: "codex" })).toEqual({
|
|
supported: true,
|
|
priority: 100,
|
|
});
|
|
});
|
|
|
|
it("delegates locked-session execution only to the voice-call plugin", () => {
|
|
expect(harness.delegatedExecutionPluginIds).toEqual(["voice-call"]);
|
|
});
|
|
|
|
it("supports openai as the primary OpenClaw routing id", () => {
|
|
expect(harness.supports({ provider: "openai", requestedRuntime: "codex" })).toEqual({
|
|
supported: true,
|
|
priority: 100,
|
|
});
|
|
});
|
|
|
|
it("supports the canonical openai routing id (documented Codex path)", () => {
|
|
expect(harness.supports({ provider: "openai", requestedRuntime: "codex" })).toEqual({
|
|
supported: true,
|
|
priority: 100,
|
|
});
|
|
});
|
|
|
|
it("rejects providers Codex app-server cannot resolve from its own config", () => {
|
|
const result = harness.supports({ provider: "9router", requestedRuntime: "codex" });
|
|
expect(result.supported).toBe(false);
|
|
expect(!result.supported ? (result.reason ?? "") : "").toContain("codex");
|
|
});
|
|
|
|
it("normalizes provider casing", () => {
|
|
expect(harness.supports({ provider: "OpenAI", requestedRuntime: "codex" })).toEqual({
|
|
supported: true,
|
|
priority: 100,
|
|
});
|
|
});
|
|
|
|
it("honors explicit provider id overrides", () => {
|
|
const narrowHarness = createCodexAppServerAgentHarness({
|
|
providerIds: ["codex"],
|
|
bindingStore: testCodexAppServerBindingStore,
|
|
});
|
|
const result = narrowHarness.supports({ provider: "openai", requestedRuntime: "codex" });
|
|
expect(result.supported).toBe(false);
|
|
});
|
|
});
|
|
|
|
describe("Codex agent harness reset()", () => {
|
|
it("retires the physical session generation", async () => {
|
|
const bindingStore = createCodexTestBindingStore();
|
|
const identity = sessionBindingIdentity({
|
|
agentId: "worker",
|
|
sessionId: "session-1",
|
|
sessionKey: "agent:worker:main",
|
|
});
|
|
await bindingStore.mutate(identity, {
|
|
kind: "set",
|
|
binding: { threadId: "thread-1", cwd: "/repo" },
|
|
});
|
|
const harness = createCodexAppServerAgentHarness({ bindingStore });
|
|
if (!harness.reset) {
|
|
throw new Error("expected Codex harness reset hook");
|
|
}
|
|
|
|
await harness.reset({
|
|
agentId: "worker",
|
|
sessionId: "session-1",
|
|
sessionKey: "agent:worker:main",
|
|
reason: "reset",
|
|
});
|
|
|
|
await expect(bindingStore.read(identity)).resolves.toBeUndefined();
|
|
});
|
|
});
|