diff --git a/src/lib/onboard/machine/handlers/sandbox-messaging.test.ts b/src/lib/onboard/machine/handlers/sandbox-messaging.test.ts index bd8adc08d8d..ce7e784b1ca 100644 --- a/src/lib/onboard/machine/handlers/sandbox-messaging.test.ts +++ b/src/lib/onboard/machine/handlers/sandbox-messaging.test.ts @@ -396,7 +396,7 @@ describe("reconcileReusedSandboxMessaging", () => { const result = reconcileReusedSandboxMessaging( structuredClone(plan), { name: "openclaw" }, - { clearPlanEnv }, + { clearPlanEnv, note: vi.fn(), writePlanToEnv: vi.fn() }, plan, ); @@ -417,7 +417,7 @@ describe("reconcileReusedSandboxMessaging", () => { const result = reconcileReusedSandboxMessaging( structuredClone(plan), { name: "openclaw" }, - { clearPlanEnv: vi.fn() }, + { clearPlanEnv: vi.fn(), note: vi.fn(), writePlanToEnv: vi.fn() }, plan, ); @@ -432,7 +432,7 @@ describe("reconcileReusedSandboxMessaging", () => { const result = reconcileReusedSandboxMessaging( structuredClone(plan), { name: "openclaw" }, - { clearPlanEnv: vi.fn() }, + { clearPlanEnv: vi.fn(), note: vi.fn(), writePlanToEnv: vi.fn() }, plan, ); @@ -693,6 +693,9 @@ describe("reconcileSandboxMessaging plan authority", () => { // input; a channel the environment no longer configures must not re-enter // the selection, or its egress preset is re-applied. expect(deps.setupMessagingChannels).not.toHaveBeenCalled(); + expect(deps.note).toHaveBeenCalledWith(expect.stringContaining("No host inputs configure discord")); + expect(deps.clearPlanEnv).toHaveBeenCalledOnce(); + expect(deps.writePlanToEnv).not.toHaveBeenCalled(); expect(result).toEqual({ plan: null, selectedChannels: [] }); }); diff --git a/src/lib/onboard/machine/handlers/sandbox-messaging.ts b/src/lib/onboard/machine/handlers/sandbox-messaging.ts index c8bc01d15ca..e5fa010b6ce 100644 --- a/src/lib/onboard/machine/handlers/sandbox-messaging.ts +++ b/src/lib/onboard/machine/handlers/sandbox-messaging.ts @@ -373,6 +373,7 @@ async function selectionFromMessagingSetup( ); } +/** Reconcile checkpoint channels against current host inputs before reuse. */ function selectionFromRecordedChannels( recordedChannels: string[], envPlan: SandboxMessagingPlan | null, @@ -386,7 +387,7 @@ function selectionFromRecordedChannels( if (envPlan) selection = selectionFromReusablePlan(envPlan, options.agent, false, options.deps); else if (registryPlan) selection = selectionFromReusablePlan(registryPlan, options.agent, true, options.deps); - selection = filterUnconfiguredHostChannelsFromSelection(selection, options.agent); + selection = filterUnconfiguredHostChannelsFromSelection(selection, options.agent, options.deps); if (selection.selectedChannels.length > 0) { options.deps.note( ` [non-interactive] Reusing messaging channel configuration: ${selection.selectedChannels.join(", ")}`,