diff --git a/CHANGELOG.md b/CHANGELOG.md index b335edc2460..d720884aa23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,7 @@ Docs: https://docs.openclaw.ai - Active Memory: stop reviving removed live `active-memory` config from startup snapshots, so removing the plugin entry turns the hook off immediately instead of waiting for a restart. Thanks @vincentkoc. - GitHub Copilot: re-read plugin discovery config from the live runtime snapshot, so toggling `plugins.entries.github-copilot.config.discovery.enabled` takes effect without a restart. Thanks @vincentkoc. - Ollama: re-read plugin discovery config from the live runtime snapshot, so toggling `plugins.entries.ollama.config.discovery.enabled` takes effect without a restart. Thanks @vincentkoc. +- OpenAI: re-read the plugin prompt-overlay personality from live runtime config, so GPT-5 system prompt contributions update without a restart when `plugins.entries.openai.config.personality` changes. Thanks @vincentkoc. - Agents/subagents: drop bare `NO_REPLY` from the parent turn when the session still has pending spawned children, so direct-conversation surfaces such as Telegram DMs no longer rewrite the sentinel into visible fallback chatter while waiting for the child completion event. (#69942) Thanks @neeravmakwana. - Plugins/install: keep bundled plugin dependencies off npm install while repairing them when plugins activate from a packaged install, including Feishu/Lark, Browser, and direct bundled channel setup-entry loads. - CLI/channels: skip and cache bundled channel plugin, setup, and secrets load failures during read-only discovery, so one broken unused bundled channel cannot crash `openclaw status` or bootstrap secret scans. diff --git a/extensions/openai/index.test.ts b/extensions/openai/index.test.ts index b7e60cd5a83..b8b2a373ca8 100644 --- a/extensions/openai/index.test.ts +++ b/extensions/openai/index.test.ts @@ -563,6 +563,42 @@ describe("openai plugin", () => { }); }); + it("uses live plugin config for GPT-5 prompt overlay mode", async () => { + const { providers } = await registerOpenAIPluginWithHook({ + pluginConfig: { personality: "off" }, + }); + + const openaiProvider = requireRegisteredProvider(providers, "openai"); + expect( + openaiProvider.resolveSystemPromptContribution?.({ + config: { + plugins: { + entries: { + openai: { + config: { + personality: "friendly", + }, + }, + }, + }, + }, + agentDir: undefined, + workspaceDir: undefined, + provider: "openai", + modelId: "gpt-5.4", + promptMode: "full", + runtimeChannel: undefined, + runtimeCapabilities: undefined, + agentId: undefined, + }), + ).toEqual({ + stablePrefix: OPENAI_GPT5_BEHAVIOR_CONTRACT, + sectionOverrides: { + interaction_style: OPENAI_FRIENDLY_PROMPT_OVERLAY, + }, + }); + }); + it("treats on as an alias for the friendly prompt overlay", async () => { const { providers } = await registerOpenAIPluginWithHook({ pluginConfig: { personality: "on" }, diff --git a/extensions/openai/index.ts b/extensions/openai/index.ts index ffa17b63224..c7f4b9d5642 100644 --- a/extensions/openai/index.ts +++ b/extensions/openai/index.ts @@ -1,3 +1,4 @@ +import { resolvePluginConfigObject } from "openclaw/plugin-sdk/config-runtime"; import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry"; import { buildProviderToolCompatFamilyHooks } from "openclaw/plugin-sdk/provider-tools"; import { buildOpenAICodexCliBackend } from "./cli-backend.js"; @@ -23,21 +24,25 @@ export default definePluginEntry({ name: "OpenAI Provider", description: "Bundled OpenAI provider plugins", register(api) { - const promptOverlayMode = resolveOpenAIPromptOverlayMode(api.pluginConfig); const openAIToolCompatHooks = buildProviderToolCompatFamilyHooks("openai"); const buildProviderWithPromptContribution = >( provider: T, ): T => ({ ...provider, ...openAIToolCompatHooks, - resolveSystemPromptContribution: (ctx) => - resolveOpenAISystemPromptContribution({ + resolveSystemPromptContribution: (ctx) => { + const runtimePluginConfig = resolvePluginConfigObject(ctx.config, "openai"); + const pluginConfig = + runtimePluginConfig ?? + (ctx.config ? undefined : (api.pluginConfig as Record)); + return resolveOpenAISystemPromptContribution({ config: ctx.config, - legacyPluginConfig: api.pluginConfig, - mode: promptOverlayMode, + legacyPluginConfig: pluginConfig, + mode: resolveOpenAIPromptOverlayMode(pluginConfig), modelProviderId: provider.id, modelId: ctx.modelId, - }), + }); + }, }); api.registerCliBackend(buildOpenAICodexCliBackend()); api.registerProvider(buildProviderWithPromptContribution(buildOpenAIProvider()));