From d25609bc06003b607a2e41ff0b6a35dea28599be Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Apr 2026 16:14:48 +0100 Subject: [PATCH] fix: default OpenAI personality overlay to friendly --- docs/providers/openai.md | 12 +++++----- extensions/openai/index.test.ts | 32 ++++++++++++++++++++++++-- extensions/openai/openclaw.plugin.json | 2 +- extensions/openai/prompt-overlay.ts | 2 +- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/docs/providers/openai.md b/docs/providers/openai.md index 9461c73378d..1721019b965 100644 --- a/docs/providers/openai.md +++ b/docs/providers/openai.md @@ -15,7 +15,7 @@ OpenAI explicitly supports subscription OAuth usage in external tools/workflows ## Default interaction style OpenClaw can add a small OpenAI-specific prompt overlay for both `openai/*` and -`openai-codex/*` runs. When enabled, the overlay keeps the assistant warm, +`openai-codex/*` runs. By default, the overlay keeps the assistant warm, collaborative, concise, direct, and a little more emotionally expressive without replacing the base OpenClaw system prompt. @@ -25,8 +25,8 @@ Config key: Allowed values: -- `"friendly"`: enable the OpenAI-specific overlay. -- `"off"`: default; disable the overlay and use the base OpenClaw prompt only. +- `"friendly"`: default; enable the OpenAI-specific overlay. +- `"off"`: disable the overlay and use the base OpenClaw prompt only. Scope: @@ -34,8 +34,8 @@ Scope: - Applies to `openai-codex/*` models. - Does not affect other providers. -This behavior is off by default. Enable it explicitly if you want the OpenAI -personality overlay: +This behavior is on by default. Keep `"friendly"` explicitly if you want that +to survive future local config churn: ```json5 { @@ -53,7 +53,7 @@ personality overlay: ### Disable the OpenAI prompt overlay -If you want the unmodified base OpenClaw prompt, keep the overlay off: +If you want the unmodified base OpenClaw prompt, set the overlay to `"off"`: ```json5 { diff --git a/extensions/openai/index.test.ts b/extensions/openai/index.test.ts index 85f87a768f3..36c98e7f2e3 100644 --- a/extensions/openai/index.test.ts +++ b/extensions/openai/index.test.ts @@ -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" }, }); diff --git a/extensions/openai/openclaw.plugin.json b/extensions/openai/openclaw.plugin.json index 90a0551b7dd..b8ebeb13ae7 100644 --- a/extensions/openai/openclaw.plugin.json +++ b/extensions/openai/openclaw.plugin.json @@ -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." } } diff --git a/extensions/openai/prompt-overlay.ts b/extensions/openai/prompt-overlay.ts index 14ca6d086ee..31478f2d03e 100644 --- a/extensions/openai/prompt-overlay.ts +++ b/extensions/openai/prompt-overlay.ts @@ -48,7 +48,7 @@ export type OpenAIPromptOverlayMode = "friendly" | "off"; export function resolveOpenAIPromptOverlayMode( pluginConfig?: Record, ): OpenAIPromptOverlayMode { - return pluginConfig?.personality === "friendly" ? "friendly" : "off"; + return pluginConfig?.personality === "off" ? "off" : "friendly"; } export function shouldApplyOpenAIPromptOverlay(params: {