mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
fix: default OpenAI personality overlay to friendly
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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" },
|
||||
});
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user