(
timeoutMs: number,
options: { readonly port?: number } = {},
)
| 183 | |
| 184 | /** Poll for a reachable supervised daemon until the deadline. */ |
| 185 | const waitForSupervisedAttach = async ( |
| 186 | timeoutMs: number, |
| 187 | options: { readonly port?: number } = {}, |
| 188 | ): Promise<SidecarConnection | null> => { |
| 189 | const deadline = Date.now() + timeoutMs; |
| 190 | for (;;) { |
| 191 | const attached = await attachToSupervisedDaemon(); |
| 192 | if (attached && (options.port === undefined || attached.port === options.port)) return attached; |
| 193 | if (Date.now() >= deadline) return null; |
| 194 | await delay(300); |
| 195 | } |
| 196 | }; |
| 197 | |
| 198 | const confirmEnableBackgroundService = async (): Promise<boolean> => { |
| 199 | // EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam |
no test coverage detected