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

推荐订阅源

雷峰网
雷峰网
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
博客园_首页
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
美团技术团队
小众软件
小众软件
Jina AI
Jina AI
S
SegmentFault 最新的问题
博客园 - Franky
让小产品的独立变现更简单 - 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: migrate shipped plugin install config records · open...
shakkernerd · 2026-04-26 · via Recent Commits to openclaw:main

@@ -18,6 +18,10 @@ import {

1818

collectRelevantDoctorPluginIds,

1919

listPluginDoctorLegacyConfigRules,

2020

} from "../plugins/doctor-contract-registry.js";

21+

import {

22+

loadInstalledPluginIndexInstallRecordsSync,

23+

writePersistedInstalledPluginIndexInstallRecordsSync,

24+

} from "../plugins/installed-plugin-index-records.js";

2125

import { sanitizeTerminalText } from "../terminal/safe-text.js";

2226

import { isRecord } from "../utils.js";

2327

import { VERSION } from "../version.js";

@@ -60,6 +64,7 @@ import {

6064

projectSourceOntoRuntimeShape,

6165

restoreEnvRefsFromMap,

6266

resolvePersistCandidateForWrite,

67+

resolveManagedUnsetPathsForWrite,

6368

resolveWriteEnvSnapshotForPath,

6469

} from "./io.write-prepare.js";

6570

import { findLegacyConfigIssues } from "./legacy.js";

@@ -70,6 +75,10 @@ import {

7075

} from "./materialize.js";

7176

import { applyMergePatch } from "./merge-patch.js";

7277

import { resolveConfigPath, resolveStateDir } from "./paths.js";

78+

import {

79+

extractShippedPluginInstallConfigRecords,

80+

stripShippedPluginInstallConfigRecords,

81+

} from "./plugin-install-config-migration.js";

7382

import { applyConfigOverrides } from "./runtime-overrides.js";

7483

import {

7584

clearRuntimeConfigSnapshot as clearRuntimeConfigSnapshotState,

@@ -1009,9 +1018,12 @@ async function recoverConfigFromJsonRootSuffixWithDeps(params: {

10091018

readResolution.resolvedConfigRaw,

10101019

suffixRecovery.parsed,

10111020

);

1012-

const validated = validateConfigObjectWithPlugins(legacyResolution.effectiveConfigRaw, {

1013-

env: params.deps.env,

1014-

});

1021+

const validated = validateConfigObjectWithPlugins(

1022+

stripShippedPluginInstallConfigRecords(legacyResolution.effectiveConfigRaw),

1023+

{

1024+

env: params.deps.env,

1025+

},

1026+

);

10151027

if (!validated.ok) {

10161028

return false;

10171029

}

@@ -1198,6 +1210,41 @@ export function createConfigIO(

11981210

return applyConfigOverrides(cfgWithOwnerDisplaySecret);

11991211

}

120012121213+

function migrateAndStripShippedPluginInstallConfigRecords(configRaw: unknown): unknown {

1214+

const installRecords = extractShippedPluginInstallConfigRecords(configRaw);

1215+

const stripped = stripShippedPluginInstallConfigRecords(configRaw);

1216+

if (Object.keys(installRecords).length === 0) {

1217+

return stripped;

1218+

}

1219+1220+

try {

1221+

const stateDir = resolveStateDir(deps.env, deps.homedir);

1222+

const existingRecords = loadInstalledPluginIndexInstallRecordsSync({

1223+

env: deps.env,

1224+

stateDir,

1225+

});

1226+

const nextRecords = {

1227+

...installRecords,

1228+

...existingRecords,

1229+

};

1230+

if (Object.keys(installRecords).some((pluginId) => !(pluginId in existingRecords))) {

1231+

writePersistedInstalledPluginIndexInstallRecordsSync(nextRecords, {

1232+

config: coerceConfig(stripped),

1233+

env: deps.env,

1234+

stateDir,

1235+

});

1236+

}

1237+

} catch (err) {

1238+

deps.logger.warn(

1239+

`Config (${configPath}): could not migrate shipped plugins.installs records into the plugin index: ${formatErrorMessage(

1240+

err,

1241+

)}`,

1242+

);

1243+

}

1244+1245+

return stripped;

1246+

}

1247+12011248

function loadConfig(): OpenClawConfig {

12021249

try {

12031250

maybeLoadDotEnvForConfig(deps.env);

@@ -1230,7 +1277,9 @@ export function createConfigIO(

12301277

);

12311278

const resolvedConfig = readResolution.resolvedConfigRaw;

12321279

const legacyResolution = resolveLegacyConfigForRead(resolvedConfig, effectiveParsed);

1233-

const effectiveConfigRaw = legacyResolution.effectiveConfigRaw;

1280+

const effectiveConfigRaw = migrateAndStripShippedPluginInstallConfigRecords(

1281+

legacyResolution.effectiveConfigRaw,

1282+

);

12341283

for (const w of readResolution.envWarnings) {

12351284

deps.logger.warn(

12361285

`Config (${configPath}): missing env var "${w.varName}" at ${w.configPath} - feature using this value will be unavailable`,

@@ -1439,7 +1488,9 @@ export function createConfigIO(

1439148814401489

const resolvedConfigRaw = readResolution.resolvedConfigRaw;

14411490

const legacyResolution = resolveLegacyConfigForRead(resolvedConfigRaw, effectiveParsed);

1442-

const effectiveConfigRaw = legacyResolution.effectiveConfigRaw;

1491+

const effectiveConfigRaw = migrateAndStripShippedPluginInstallConfigRecords(

1492+

legacyResolution.effectiveConfigRaw,

1493+

);

14431494

fallbackSourceConfig = coerceConfig(effectiveConfigRaw);

14441495

const validated = validateConfigObjectWithPlugins(effectiveConfigRaw, {

14451496

env: deps.env,

@@ -1562,6 +1613,7 @@ export function createConfigIO(

15621613

writeOptions: {

15631614

envSnapshotForRestore: result.envSnapshotForRestore,

15641615

expectedConfigPath: configPath,

1616+

unsetPaths: resolveManagedUnsetPathsForWrite(undefined),

15651617

},

15661618

};

15671619

}

@@ -1609,7 +1661,9 @@ export function createConfigIO(

16091661

readResolution.resolvedConfigRaw,

16101662

recovered.parsed,

16111663

);

1612-

return coerceConfig(legacyResolution.effectiveConfigRaw);

1664+

return coerceConfig(

1665+

stripShippedPluginInstallConfigRecords(legacyResolution.effectiveConfigRaw),

1666+

);

16131667

} catch {

16141668

return {};

16151669

}

@@ -1620,6 +1674,7 @@ export function createConfigIO(

16201674

options: ConfigWriteOptions = {},

16211675

): Promise<{ persistedHash: string; persistedConfig: OpenClawConfig }> {

16221676

clearConfigCache();

1677+

const unsetPaths = resolveManagedUnsetPathsForWrite(options.unsetPaths);

16231678

let persistCandidate: unknown = cfg;

16241679

const snapshot = options.baseSnapshot ?? (await readConfigFileSnapshotInternal()).snapshot;

16251680

let envRefMap: Map<string, string> | null = null;

@@ -1655,10 +1710,7 @@ export function createConfigIO(

16551710

}

16561711

}

165717121658-

persistCandidate = applyUnsetPathsForWrite(

1659-

persistCandidate as OpenClawConfig,

1660-

options.unsetPaths,

1661-

);

1713+

persistCandidate = applyUnsetPathsForWrite(persistCandidate as OpenClawConfig, unsetPaths);

1662171416631715

const validated = validateConfigObjectRawWithPlugins(persistCandidate, { env: deps.env });

16641716

if (!validated.ok) {

@@ -1720,7 +1772,7 @@ export function createConfigIO(

17201772

envRefMap && changedPaths

17211773

? (restoreEnvRefsFromMap(cfgToWrite, "", envRefMap, changedPaths) as OpenClawConfig)

17221774

: cfgToWrite;

1723-

const outputConfig = applyUnsetPathsForWrite(outputConfigBase, options.unsetPaths);

1775+

const outputConfig = applyUnsetPathsForWrite(outputConfigBase, unsetPaths);

17241776

// Do NOT apply runtime defaults when writing - user config should only contain

17251777

// explicitly set values. Runtime defaults are applied when loading (issue #6070).

17261778

const stampedOutputConfig = stampConfigVersion(outputConfig);

@@ -2054,7 +2106,7 @@ export async function writeConfigFile(

20542106

expectedConfigPath: options.expectedConfigPath,

20552107

envSnapshotForRestore: options.envSnapshotForRestore,

20562108

}),

2057-

unsetPaths: options.unsetPaths,

2109+

unsetPaths: resolveManagedUnsetPathsForWrite(options.unsetPaths),

20582110

allowDestructiveWrite: options.allowDestructiveWrite,

20592111

skipRuntimeSnapshotRefresh: options.skipRuntimeSnapshotRefresh,

20602112

skipOutputLogs: options.skipOutputLogs,