From 8f8162704ddf7d1d2ef87168e65e791107a5fa0f Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 19 Jun 2026 02:53:35 +0800 Subject: [PATCH] refactor(gateway): remove stale restart sentinel wake predicate --- src/gateway/server-restart-sentinel.ts | 4 ---- src/gateway/server-startup-post-attach.test.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/gateway/server-restart-sentinel.ts b/src/gateway/server-restart-sentinel.ts index f35fda71251..29dee193a71 100644 --- a/src/gateway/server-restart-sentinel.ts +++ b/src/gateway/server-restart-sentinel.ts @@ -646,10 +646,6 @@ export async function scheduleRestartSentinelWake(params: { deps: CliDeps }) { await scheduleRestartSentinelWakeAttempt({ ...params, attempt: 0 }); } -export function shouldWakeFromRestartSentinel() { - return !process.env.VITEST && process.env.NODE_ENV !== "test"; -} - export async function refreshLatestUpdateRestartSentinel(): Promise { const current = await readRestartSentinel(); if ( diff --git a/src/gateway/server-startup-post-attach.test.ts b/src/gateway/server-startup-post-attach.test.ts index 78e567da67a..e9bbab8985f 100644 --- a/src/gateway/server-startup-post-attach.test.ts +++ b/src/gateway/server-startup-post-attach.test.ts @@ -38,7 +38,6 @@ const hoisted = vi.hoisted(() => { skipped: 0, })); const scheduleRestartAbortedMainSessionRecovery = vi.fn(); - const shouldWakeFromRestartSentinel = vi.fn(() => false); const scheduleRestartSentinelWake = vi.fn(); const refreshLatestUpdateRestartSentinel = vi.fn< typeof import("./server-restart-sentinel.js").refreshLatestUpdateRestartSentinel @@ -91,7 +90,6 @@ const hoisted = vi.hoisted(() => { markStartupOrphanedMainSessionsForRecovery, recoverStartupOrphanedMainSessions, scheduleRestartAbortedMainSessionRecovery, - shouldWakeFromRestartSentinel, scheduleRestartSentinelWake, refreshLatestUpdateRestartSentinel, getAcpRuntimeBackend, @@ -177,7 +175,6 @@ vi.mock("../acp/runtime/registry.js", () => ({ vi.mock("./server-restart-sentinel.js", () => ({ refreshLatestUpdateRestartSentinel: hoisted.refreshLatestUpdateRestartSentinel, scheduleRestartSentinelWake: hoisted.scheduleRestartSentinelWake, - shouldWakeFromRestartSentinel: hoisted.shouldWakeFromRestartSentinel, })); vi.mock("./server-startup-memory.js", () => ({ @@ -327,7 +324,6 @@ describe("startGatewayPostAttachRuntime", () => { skipped: 0, }); hoisted.scheduleRestartAbortedMainSessionRecovery.mockClear(); - hoisted.shouldWakeFromRestartSentinel.mockReturnValue(false); hoisted.scheduleRestartSentinelWake.mockClear(); hoisted.getAcpRuntimeBackend.mockReset(); hoisted.getAcpRuntimeBackend.mockReturnValue(null);