fix: default OpenAI personality overlay to friendly

This commit is contained in:
Peter Steinberger
2026-04-05 16:14:48 +01:00
parent 7e4c5294ae
commit d25609bc06
4 changed files with 38 additions and 10 deletions

View File

@@ -322,9 +322,37 @@ describe("openai plugin", () => {
);
});
it("defaults to no OpenAI interaction-style overlay", async () => {
it("defaults to the friendly OpenAI interaction-style overlay", async () => {
const { on, providers } = await registerOpenAIPluginWithHook();
expect(on).not.toHaveBeenCalledWith("before_prompt_build", expect.any(Function));
const openaiProvider = requireRegisteredProvider(providers, "openai");
expect(
openaiProvider.resolveSystemPromptContribution?.({
config: undefined,
agentDir: undefined,
workspaceDir: undefined,
provider: "openai",
modelId: "gpt-5.4",
promptMode: "full",
runtimeChannel: undefined,
runtimeCapabilities: undefined,
agentId: undefined,
}),
).toEqual({
stablePrefix: OPENAI_GPT5_OUTPUT_CONTRACT,
sectionOverrides: {
interaction_style: OPENAI_FRIENDLY_PROMPT_OVERLAY,
execution_bias: OPENAI_GPT5_EXECUTION_BIAS,
},
});
});
it("supports opting out of the friendly prompt overlay via plugin config", async () => {
const { on, providers } = await registerOpenAIPluginWithHook({
pluginConfig: { personality: "off" },
});
expect(on).not.toHaveBeenCalledWith("before_prompt_build", expect.any(Function));
const openaiProvider = requireRegisteredProvider(providers, "openai");
expect(
@@ -347,7 +375,7 @@ describe("openai plugin", () => {
});
});
it("supports opting into the friendly prompt overlay via plugin config", async () => {
it("supports explicitly configuring the friendly prompt overlay", async () => {
const { on, providers } = await registerOpenAIPluginWithHook({
pluginConfig: { personality: "friendly" },
});

View File

@@ -49,7 +49,7 @@
"personality": {
"type": "string",
"enum": ["friendly", "off"],
"default": "off",
"default": "friendly",
"description": "Controls the default OpenAI-specific personality used for OpenAI and OpenAI Codex runs."
}
}

View File

@@ -48,7 +48,7 @@ export type OpenAIPromptOverlayMode = "friendly" | "off";
export function resolveOpenAIPromptOverlayMode(
pluginConfig?: Record<string, unknown>,
): OpenAIPromptOverlayMode {
return pluginConfig?.personality === "friendly" ? "friendly" : "off";
return pluginConfig?.personality === "off" ? "off" : "friendly";
}
export function shouldApplyOpenAIPromptOverlay(params: {