Skip to content

Commit 0de0106

Browse files
authored
Add a test seam to skip the background-service consent dialog under automation (#1170)
The first-run "keep Executor running in the background?" dialog cannot be answered from CDP or Playwright, so a packaged first-run boot under automation blocks here with no way to proceed (on macOS the modal also starves the app's main run loop). Add an EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE env seam, the same pattern confirmResetState already uses: "1" keeps the service, any other value declines, and when unset the dialog is shown as before.
1 parent 94647f1 commit 0de0106

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"executor": patch
3+
---
4+
5+
Add a test seam to skip the first-run "keep Executor running in the background?" consent dialog under automation, matching the existing `confirmResetState` seam. Set `EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE=1` to keep the background service or any other value to decline. When the variable is unset the dialog is shown exactly as before. Native dialogs cannot be answered from CDP or Playwright, so a packaged first-run boot under automation previously blocked at this prompt with no way to proceed.

apps/desktop/src/main/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ const waitForSupervisedAttach = async (
190190
};
191191

192192
const confirmEnableBackgroundService = async (): Promise<boolean> => {
193+
// EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam
194+
// as confirmResetState. Native dialogs are unreachable from CDP/Playwright, so
195+
// a first-run boot under automation otherwise blocks here forever with no way
196+
// to answer. "1" keeps the background service; any other value declines and
197+
// falls back to the managed sidecar.
198+
const autoConfirm = process.env.EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE;
199+
if (autoConfirm !== undefined) return autoConfirm === "1";
193200
const { response } = await dialog.showMessageBox({
194201
type: "question",
195202
title: "Keep Executor running in the background?",

0 commit comments

Comments
 (0)