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

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏

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: refresh finalize state after doctor · openclaw/openc...
shakkernerd · 2026-05-15 · via Recent Commits to openclaw:main

@@ -7,6 +7,7 @@ import { Command } from "commander";

77

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

88

import { TEST_BUNDLED_RUNTIME_SIDECAR_PATHS } from "../../test/helpers/bundled-runtime-sidecars.js";

99

import type { OpenClawConfig, ConfigFileSnapshot } from "../config/types.openclaw.js";

10+

import type { PluginInstallRecord } from "../config/types.plugins.js";

1011

import { writePackageDistInventory } from "../infra/package-dist-inventory.js";

1112

import { isBetaTag } from "../infra/update-channels.js";

1213

import type { UpdateRunResult } from "../infra/update-runner.js";

@@ -3378,6 +3379,7 @@ describe("update-cli", () => {

33783379

expect(process.env.OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE).toBeUndefined();

33793380

expect(doctorCommand).toHaveBeenCalledWith(defaultRuntime, {

33803381

nonInteractive: true,

3382+

repair: true,

33813383

yes: true,

33823384

});

33833385

expect(syncPluginCall()?.channel).toBe("stable");

@@ -3399,6 +3401,109 @@ describe("update-cli", () => {

33993401

);

34003402

});

340134033404+

it("updateFinalizeCommand repairs doctor by default and refreshes plugin state after doctor", async () => {

3405+

const preDoctorConfig = {

3406+

update: { channel: "stable" },

3407+

plugins: { entries: { pre: { enabled: true } } },

3408+

} as OpenClawConfig;

3409+

const postDoctorConfig = {

3410+

update: { channel: "beta" },

3411+

plugins: { entries: { post: { enabled: true } } },

3412+

} as OpenClawConfig;

3413+

const preDoctorSnapshot: ConfigFileSnapshot = {

3414+

...baseSnapshot,

3415+

sourceConfig: preDoctorConfig,

3416+

resolved: preDoctorConfig,

3417+

runtimeConfig: preDoctorConfig,

3418+

config: preDoctorConfig,

3419+

hash: "pre-doctor",

3420+

};

3421+

const postDoctorSnapshot: ConfigFileSnapshot = {

3422+

...baseSnapshot,

3423+

sourceConfig: postDoctorConfig,

3424+

resolved: postDoctorConfig,

3425+

runtimeConfig: postDoctorConfig,

3426+

config: postDoctorConfig,

3427+

hash: "post-doctor",

3428+

};

3429+

const postDoctorRecords = {

3430+

"post-plugin": {

3431+

source: "npm",

3432+

spec: "post-plugin@1.0.0",

3433+

},

3434+

} satisfies Record<string, PluginInstallRecord>;

3435+

vi.mocked(readConfigFileSnapshot)

3436+

.mockResolvedValueOnce(preDoctorSnapshot)

3437+

.mockResolvedValueOnce(postDoctorSnapshot);

3438+

loadInstalledPluginIndexInstallRecords.mockResolvedValueOnce(postDoctorRecords);

3439+

syncPluginsForUpdateChannel.mockImplementationOnce(

3440+

async (params: { config?: OpenClawConfig }) => ({

3441+

changed: true,

3442+

config: params.config ?? baseConfig,

3443+

summary: {

3444+

switchedToBundled: [],

3445+

switchedToNpm: [],

3446+

warnings: [],

3447+

errors: [],

3448+

},

3449+

}),

3450+

);

3451+3452+

await updateFinalizeCommand({ json: true, timeout: "9", restart: false });

3453+3454+

expect(doctorCommand).toHaveBeenCalledWith(defaultRuntime, {

3455+

nonInteractive: true,

3456+

repair: true,

3457+

yes: false,

3458+

});

3459+

expect(syncPluginCall()?.channel).toBe("beta");

3460+

expect(syncPluginCall()?.config).toEqual({

3461+

...postDoctorConfig,

3462+

plugins: {

3463+

...postDoctorConfig.plugins,

3464+

installs: postDoctorRecords,

3465+

},

3466+

});

3467+

expect(lastReplaceConfigCall()?.baseHash).toBe("post-doctor");

3468+

expect(vi.mocked(doctorCommand).mock.invocationCallOrder[0] ?? 0).toBeLessThan(

3469+

loadInstalledPluginIndexInstallRecords.mock.invocationCallOrder[0] ?? 0,

3470+

);

3471+

expect((lastWriteJsonCall() as { channel?: string } | undefined)?.channel).toBe("beta");

3472+

});

3473+3474+

it("updateFinalizeCommand reapplies requested channel against post-doctor config", async () => {

3475+

const preDoctorConfig = { update: { channel: "stable" } } as OpenClawConfig;

3476+

const postDoctorConfig = { update: { channel: "beta" } } as OpenClawConfig;

3477+

const preDoctorSnapshot: ConfigFileSnapshot = {

3478+

...baseSnapshot,

3479+

sourceConfig: preDoctorConfig,

3480+

resolved: preDoctorConfig,

3481+

runtimeConfig: preDoctorConfig,

3482+

config: preDoctorConfig,

3483+

hash: "pre-doctor",

3484+

};

3485+

const postDoctorSnapshot: ConfigFileSnapshot = {

3486+

...baseSnapshot,

3487+

sourceConfig: postDoctorConfig,

3488+

resolved: postDoctorConfig,

3489+

runtimeConfig: postDoctorConfig,

3490+

config: postDoctorConfig,

3491+

hash: "post-doctor",

3492+

};

3493+

vi.mocked(readConfigFileSnapshot)

3494+

.mockResolvedValueOnce(preDoctorSnapshot)

3495+

.mockResolvedValueOnce(postDoctorSnapshot);

3496+3497+

await updateFinalizeCommand({ channel: "dev", json: true, restart: false });

3498+3499+

expect(replaceConfigCall(0)?.baseHash).toBe("pre-doctor");

3500+

expect(replaceConfigCall(0)?.nextConfig).toEqual({ update: { channel: "dev" } });

3501+

expect(replaceConfigCall(1)?.baseHash).toBe("post-doctor");

3502+

expect(replaceConfigCall(1)?.nextConfig).toEqual({ update: { channel: "dev" } });

3503+

expect(syncPluginCall()?.channel).toBe("dev");

3504+

expect((lastWriteJsonCall() as { channel?: string } | undefined)?.channel).toBe("dev");

3505+

});

3506+34023507

it.each([

34033508

{

34043509

name: "update command invalid timeout",