import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import {
isStrictAgenticExecutionContractActive,
resolveEffectiveExecutionContract,
} from "./execution-contract.js";
describe("supported provider + model detection", () => {
it("auto-activates on bare gpt-5 model ids", () => {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: supportedProvider,
modelId: "gpt-5.4",
}),
).toBe("strict-agentic");
});
it("auto-activates on the mock-openai qa lane", () => {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: "mock-openai",
modelId: "mock-openai/gpt-5.4",
}),
).toBe("strict-agentic");
});
it("auto-activates on gpt-5o and variants without a separator", () => { for (const modelId of ["gpt-5", "gpt-5o", "gpt-5o-mini"]) {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: supportedProvider,
modelId,
}),
).toBe("strict-agentic");
}
});
it("auto-activates on dot-separated variants", () => { for (const modelId of ["gpt-5.0", "gpt-5.4", "gpt-5.4-alt", "gpt-5.99"]) {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: supportedProvider,
modelId,
}),
).toBe("strict-agentic");
}
});
it("auto-activates on dash-separated variants", () => { for (const modelId of ["gpt-5-preview", "gpt-5-turbo", "gpt-5-2025-03"]) {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: supportedProvider,
modelId,
}),
).toBe("strict-agentic");
}
});
it("auto-activates on prefixed model ids (openai/gpt-5.4, openai:gpt-5.4)", () => { // Regression for the adversarial review finding: prefixed model ids // must strip the provider prefix before matching the regex. for (const modelId of [ "openai/gpt-5.4", "openai:gpt-5.4", "openai/gpt-5o-mini", "openai-codex/gpt-5.4", "openai-codex:gpt-5.4", " openai/gpt-5.4 ", " OPENAI:GPT-5.4 ",
]) {
expect(
resolveEffectiveExecutionContract({
config: emptyConfig,
provider: supportedProvider,
modelId,
}),
).toBe("strict-agentic");
}
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.