





















@@ -755,7 +755,7 @@ describe("maybeRepairGatewayServiceConfig", () => {
755755expect(mocks.install).not.toHaveBeenCalled();
756756});
757757758-it("stages service config repairs during non-interactive update repairs", async () => {
758+it("defers systemd service config rewrites during non-interactive update repairs", async () => {
759759setupGatewayEntrypointRepairScenario({
760760currentEntrypoint: "/Users/test/Library/npm/node_modules/openclaw/dist/entry.js",
761761installEntrypoint: "/Users/test/Library/npm/node_modules/openclaw/dist/index.js",
@@ -771,6 +771,29 @@ describe("maybeRepairGatewayServiceConfig", () => {
771771"Gateway service entrypoint does not match the current install.",
772772"Gateway service config",
773773);
774+expectNoteContaining("left the live systemd unit unchanged", "Gateway service config");
775+expect(mocks.stage).not.toHaveBeenCalled();
776+expect(mocks.install).not.toHaveBeenCalled();
777+});
778+779+it("keeps staging non-systemd service config repairs during non-interactive update repairs", async () => {
780+mockProcessPlatform("darwin");
781+setupGatewayEntrypointRepairScenario({
782+currentEntrypoint: "/Users/test/Library/npm/node_modules/openclaw/dist/entry.js",
783+installEntrypoint: "/Users/test/Library/npm/node_modules/openclaw/dist/index.js",
784+installWorkingDirectory: "/tmp",
785+});
786+787+await runNonInteractiveRepair({
788+cfg: { gateway: {} },
789+updateInProgress: true,
790+});
791+792+expectNoteContaining(
793+"Gateway service entrypoint does not match the current install.",
794+"Gateway service config",
795+);
796+expectNoNoteContaining("left the live systemd unit unchanged", "Gateway service config");
774797expect(mocks.stage).toHaveBeenCalledTimes(1);
775798expect(mocks.install).not.toHaveBeenCalled();
776799});
@@ -842,7 +865,7 @@ describe("maybeRepairGatewayServiceConfig", () => {
842865);
843866});
844867845-it("does not persist embedded service tokens during non-interactive update repairs", async () => {
868+it("does not persist or stage embedded service tokens during systemd update repairs", async () => {
846869Object.defineProperty(process.stdin, "isTTY", {
847870value: false,
848871configurable: true,
@@ -874,7 +897,8 @@ describe("maybeRepairGatewayServiceConfig", () => {
874897);
875898876899expect(mocks.replaceConfigFile).not.toHaveBeenCalled();
877-expect(mocks.stage).toHaveBeenCalledTimes(1);
900+expectNoteContaining("left the live systemd unit unchanged", "Gateway service config");
901+expect(mocks.stage).not.toHaveBeenCalled();
878902expect(mocks.install).not.toHaveBeenCalled();
879903},
880904);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。