惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
D
Docker
GbyAI
GbyAI
宝玉的分享
宝玉的分享
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Vercel News
Vercel News
博客园_首页
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
V
V2EX
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(plugins): reset context engine slot on uninstall · op...
steipete · 2026-04-26 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai

1212

- Doctor: honor `OPENCLAW_SERVICE_REPAIR_POLICY=external` by reporting gateway service health while skipping service install/start/restart/bootstrap, supervisor rewrites, and legacy service cleanup for externally managed environments. Thanks @shakkernerd.

1313

- CLI/update: run package post-update doctor with `--fix` so package updates repair config migrations before restart. Thanks @shakkernerd.

1414

- CLI/update: retry failed npm global updates with `--omit=optional` and ignore the superseded first failure when the fallback succeeds. Thanks @shakkernerd.

15+

- Plugins/uninstall: migrate and reset `plugins.slots.contextEngine` alongside memory slots when plugin ids change or selected plugins are removed. Thanks @shakkernerd.

1516

- Agents/Discord: keep raw `Agent failed before reply` runner failures out of Discord group/channel chats and show detailed runner errors in direct chats only when `/verbose` is enabled. Thanks @codex.

1617

- Package: include patched dependency files in the published npm package so downstream installs can resolve `patchedDependencies`. (#69224) Thanks @gucasbrg and @vincentkoc.

1718

- Plugins/channels: treat malformed bundled channel plugin loaders that return `undefined` as unavailable instead of crashing config and help paths. Fixes #69044. Thanks @frankhli843 and @vincentkoc.

Original file line numberDiff line numberDiff line change

@@ -594,6 +594,7 @@ export function resetPluginsCliTestState() {

594594

allowlist: false,

595595

loadPath: false,

596596

memorySlot: false,

597+

contextEngineSlot: false,

597598

directory: false,

598599

},

599600

});

Original file line numberDiff line numberDiff line change

@@ -634,6 +634,11 @@ export function registerPluginsCli(program: Command) {

634634

if (cfg.plugins?.slots?.memory === pluginId) {

635635

preview.push(`memory slot (will reset to "${defaultSlotIdForKey("memory")}")`);

636636

}

637+

if (cfg.plugins?.slots?.contextEngine === pluginId) {

638+

preview.push(

639+

`context engine slot (will reset to "${defaultSlotIdForKey("contextEngine")}")`,

640+

);

641+

}

637642

const channelIds = plugin?.status === "loaded" ? plugin.channelIds : undefined;

638643

const channels = cfg.channels as Record<string, unknown> | undefined;

639644

if (hasInstall && channels) {

@@ -723,6 +728,9 @@ export function registerPluginsCli(program: Command) {

723728

if (result.actions.memorySlot) {

724729

removed.push("memory slot");

725730

}

731+

if (result.actions.contextEngineSlot) {

732+

removed.push("context engine slot");

733+

}

726734

if (result.actions.channelConfig) {

727735

removed.push("channel config");

728736

}

Original file line numberDiff line numberDiff line change

@@ -40,6 +40,9 @@ describe("plugins cli uninstall", () => {

4040

installPath: ALPHA_INSTALL_PATH,

4141

},

4242

},

43+

slots: {

44+

contextEngine: "alpha",

45+

},

4346

},

4447

} as OpenClawConfig);

4548

buildPluginDiagnosticsReport.mockReturnValue({

@@ -53,6 +56,7 @@ describe("plugins cli uninstall", () => {

5356

expect(writeConfigFile).not.toHaveBeenCalled();

5457

expect(refreshPluginRegistry).not.toHaveBeenCalled();

5558

expect(runtimeLogs.some((line) => line.includes("Dry run, no changes made."))).toBe(true);

59+

expect(runtimeLogs.some((line) => line.includes("context engine slot"))).toBe(true);

5660

});

5761
5862

it("uninstalls with --force and --keep-files without prompting", async () => {

@@ -93,6 +97,7 @@ describe("plugins cli uninstall", () => {

9397

allowlist: false,

9498

loadPath: false,

9599

memorySlot: false,

100+

contextEngineSlot: false,

96101

directory: false,

97102

},

98103

});

@@ -162,6 +167,7 @@ describe("plugins cli uninstall", () => {

162167

allowlist: false,

163168

loadPath: false,

164169

memorySlot: false,

170+

contextEngineSlot: false,

165171

directory: false,

166172

},

167173

});

Original file line numberDiff line numberDiff line change

@@ -365,6 +365,22 @@ describe("removePluginFromConfig", () => {

365365

expect(actions.memorySlot).toBe(expectedChanged);

366366

});

367367
368+

it("clears context engine slot when uninstalling active context engine plugin", () => {

369+

const config = createPluginConfig({

370+

entries: {

371+

"context-plugin": { enabled: true },

372+

},

373+

slots: {

374+

contextEngine: "context-plugin",

375+

},

376+

});

377+
378+

const { config: result, actions } = removePluginFromConfig(config, "context-plugin");

379+
380+

expect(result.plugins?.slots?.contextEngine).toBe("legacy");

381+

expect(actions.contextEngineSlot).toBe(true);

382+

});

383+
368384

it("removes plugins object when uninstall leaves only empty slots", () => {

369385

const config = createSinglePluginWithEmptySlotsConfig();

370386
Original file line numberDiff line numberDiff line change

@@ -13,6 +13,7 @@ export type UninstallActions = {

1313

allowlist: boolean;

1414

loadPath: boolean;

1515

memorySlot: boolean;

16+

contextEngineSlot: boolean;

1617

channelConfig: boolean;

1718

directory: boolean;

1819

};

@@ -155,6 +156,7 @@ export function removePluginFromConfig(

155156

allowlist: false,

156157

loadPath: false,

157158

memorySlot: false,

159+

contextEngineSlot: false,

158160

channelConfig: false,

159161

};

160162

@@ -204,7 +206,7 @@ export function removePluginFromConfig(

204206

}

205207

}

206208
207-

// Reset memory slot if this plugin was selected

209+

// Reset slots if this plugin was selected.

208210

let slots = pluginsConfig.slots;

209211

if (slots?.memory === pluginId) {

210212

slots = {

@@ -213,6 +215,13 @@ export function removePluginFromConfig(

213215

};

214216

actions.memorySlot = true;

215217

}

218+

if (slots?.contextEngine === pluginId) {

219+

slots = {

220+

...slots,

221+

contextEngine: defaultSlotIdForKey("contextEngine"),

222+

};

223+

actions.contextEngineSlot = true;

224+

}

216225

if (slots && Object.keys(slots).length === 0) {

217226

slots = undefined;

218227

}

Original file line numberDiff line numberDiff line change

@@ -876,6 +876,41 @@ describe("updateNpmInstalledPlugins", () => {

876876

expect(result.config.plugins?.installs?.["voice-call"]).toBeUndefined();

877877

});

878878
879+

it("migrates context engine slot when a plugin id changes during update", async () => {

880+

installPluginFromNpmSpecMock.mockResolvedValue({

881+

ok: true,

882+

pluginId: "@openclaw/context-engine",

883+

targetDir: "/tmp/openclaw-context-engine",

884+

version: "0.0.2",

885+

extensions: ["index.ts"],

886+

});

887+
888+

const result = await updateNpmInstalledPlugins({

889+

config: {

890+

plugins: {

891+

slots: { contextEngine: "context-engine" },

892+

installs: {

893+

"context-engine": {

894+

source: "npm",

895+

spec: "@openclaw/context-engine",

896+

installPath: "/tmp/context-engine",

897+

},

898+

},

899+

},

900+

} as OpenClawConfig,

901+

pluginIds: ["context-engine"],

902+

});

903+
904+

expect(result.config.plugins?.slots?.contextEngine).toBe("@openclaw/context-engine");

905+

expect(result.config.plugins?.installs?.["@openclaw/context-engine"]).toMatchObject({

906+

source: "npm",

907+

spec: "@openclaw/context-engine",

908+

installPath: "/tmp/openclaw-context-engine",

909+

version: "0.0.2",

910+

});

911+

expect(result.config.plugins?.installs?.["context-engine"]).toBeUndefined();

912+

});

913+
879914

it("checks marketplace installs during dry-run updates", async () => {

880915

installPluginFromMarketplaceMock.mockResolvedValue({

881916

ok: true,

Original file line numberDiff line numberDiff line change

@@ -417,13 +417,13 @@ function migratePluginConfigId(cfg: OpenClawConfig, fromId: string, toId: string

417417

delete nextEntries[fromId];

418418

}

419419
420-

const nextSlots =

421-

slots?.memory === fromId

422-

? {

423-

...slots,

424-

memory: toId,

425-

}

426-

: slots;

420+

const nextSlots = slots

421+

? {

422+

...slots,

423+

...(slots.memory === fromId ? { memory: toId } : {}),

424+

...(slots.contextEngine === fromId ? { contextEngine: toId } : {}),

425+

}

426+

: undefined;

427427
428428

return {

429429

...cfg,