






















@@ -1,7 +1,7 @@
11import { describe, expect, it } from "vitest";
22import {
33resolveDoctorHealthContributions,
4-shouldSkipLegacyUpdateDoctorMetadataWrite,
4+shouldSkipLegacyUpdateDoctorConfigWrite,
55} from "./doctor-health-contributions.js";
6677describe("doctor health contributions", () => {
@@ -30,54 +30,39 @@ describe("doctor health contributions", () => {
3030expect(ids.indexOf("doctor:command-owner")).toBeLessThan(ids.indexOf("doctor:write-config"));
3131});
323233-it("skips metadata-only doctor writes under legacy update parents", () => {
33+it("skips doctor config writes under legacy update parents", () => {
3434expect(
35-shouldSkipLegacyUpdateDoctorMetadataWrite({
35+shouldSkipLegacyUpdateDoctorConfigWrite({
3636env: { OPENCLAW_UPDATE_IN_PROGRESS: "1" },
37-before: { gateway: { mode: "local" }, meta: { lastTouchedVersion: "2026.4.26" } },
38-after: {
39-gateway: { mode: "local" },
40-meta: { lastTouchedVersion: "2026.4.27" },
41-wizard: { lastRunCommand: "doctor" },
42-},
4337}),
4438).toBe(true);
4539});
464047-it("keeps real doctor repairs writable during update", () => {
41+it("keeps doctor writes outside legacy update writable", () => {
4842expect(
49-shouldSkipLegacyUpdateDoctorMetadataWrite({
50-env: { OPENCLAW_UPDATE_IN_PROGRESS: "1" },
51-before: { gateway: { mode: "local" } },
52-after: { gateway: { mode: "remote" } },
43+shouldSkipLegacyUpdateDoctorConfigWrite({
44+env: {},
5345}),
5446).toBe(false);
5547});
564857-it("keeps repair writes from doctor config preflight writable during legacy update", () => {
49+it("keeps current update parents writable", () => {
5850expect(
59-shouldSkipLegacyUpdateDoctorMetadataWrite({
60-env: { OPENCLAW_UPDATE_IN_PROGRESS: "1" },
61-hasPendingConfigWrite: true,
62-before: { gateway: { mode: "remote" } },
63-after: {
64-gateway: { mode: "remote" },
65-meta: { lastTouchedVersion: "2026.4.27" },
66-wizard: { lastRunCommand: "doctor" },
51+shouldSkipLegacyUpdateDoctorConfigWrite({
52+env: {
53+OPENCLAW_UPDATE_IN_PROGRESS: "1",
54+OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE: "1",
6755},
6856}),
6957).toBe(false);
7058});
715972-it("keeps current update parents writable", () => {
60+it("treats falsey update env values as normal writes", () => {
7361expect(
74-shouldSkipLegacyUpdateDoctorMetadataWrite({
62+shouldSkipLegacyUpdateDoctorConfigWrite({
7563env: {
76-OPENCLAW_UPDATE_IN_PROGRESS: "1",
77-OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE: "1",
64+OPENCLAW_UPDATE_IN_PROGRESS: "0",
7865},
79-before: { meta: { lastTouchedVersion: "2026.4.26" } },
80-after: { meta: { lastTouchedVersion: "2026.4.27" } },
8166}),
8267).toBe(false);
8368});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。