Skip to content

The agent that grows with you

fmt(js): `npm run fix` on merge (#95329)

hermes-seaeye[bot]d1627d51338a
diff --git a/apps/desktop/electron/backend-release-gate.test.ts b/apps/desktop/electron/backend-release-gate.test.ts
index db5e82dcad6..c16a0ae950d 100644
--- a/apps/desktop/electron/backend-release-gate.test.ts
+++ b/apps/desktop/electron/backend-release-gate.test.ts
@@ -12,11 +12,7 @@
import { describe, expect, it } from 'vitest'
-import {
- RELEASE_GATE_POLL_MS,
- type ReleaseGateDeps,
- waitForBackendRelease
-} from './backend-release-gate'
+import { RELEASE_GATE_POLL_MS, type ReleaseGateDeps, waitForBackendRelease } from './backend-release-gate'
/** A fake clock where sleep() advances time instantly. */
function fakeClock() {
@@ -137,11 +133,7 @@ describe('waitForBackendRelease (#74805 first-attempt race)', () => {
return clock.now() < RELEASE_GATE_POLL_MS
}
- return (
- pid === 7777 &&
- stragglerKilledAt !== null &&
- clock.now() < stragglerKilledAt + 2 * RELEASE_GATE_POLL_MS
- )
+ return pid === 7777 && stragglerKilledAt !== null && clock.now() < stragglerKilledAt + 2 * RELEASE_GATE_POLL_MS
}
})
@@ -151,9 +143,7 @@ describe('waitForBackendRelease (#74805 first-attempt race)', () => {
expect(result.unlocked).toBe(true)
expect(result.lingeringPids).toEqual([])
// The gate must have dwelled until the straggler actually exited.
- expect(clock.now()).toBeGreaterThanOrEqual(
- (stragglerKilledAt ?? 0) + 2 * RELEASE_GATE_POLL_MS
- )
+ expect(clock.now()).toBeGreaterThanOrEqual((stragglerKilledAt ?? 0) + 2 * RELEASE_GATE_POLL_MS)
})
it('ignores invalid PIDs in the seed and straggler sets', async () => {
diff --git a/apps/desktop/electron/backend-release-gate.ts b/apps/desktop/electron/backend-release-gate.ts
index 01aee80279b..1d0dceb8e19 100644
--- a/apps/desktop/electron/backend-release-gate.ts
+++ b/apps/desktop/electron/backend-release-gate.ts
@@ -68,9 +68,7 @@ export async function waitForBackendRelease(
tag: string,
deadlineMs: number = RELEASE_GATE_DEADLINE_MS
): Promise<ReleaseGateResult> {
- const killedPids = new Set<number>(
- initialPids.filter(pid => Number.isInteger(pid) && pid > 0)
- )
+ const killedPids = new Set<number>(initialPids.filter(pid => Number.isInteger(pid) && pid > 0))
const deadline = deps.now() + deadlineMs
@@ -78,9 +76,7 @@ export async function waitForBackendRelease(
const lingering = [...killedPids].filter(pid => deps.isPidAlive(pid))
if (!deps.isShimLocked() && lingering.length === 0) {
- deps.log(
- `[${tag}] venv shim unlocked and ${killedPids.size} signalled backend PID(s) exited; safe to proceed`
- )
+ deps.log(`[${tag}] venv shim unlocked and ${killedPids.size} signalled backend PID(s) exited; safe to proceed`)
return { unlocked: true, lingeringPids: [] }
}
diff --git a/apps/desktop/electron/backend-release-gate.windows-live.test.ts b/apps/desktop/electron/backend-release-gate.windows-live.test.ts
index 72b67b570f6..3c188258507 100644
--- a/apps/desktop/electron/backend-release-gate.windows-live.test.ts
+++ b/apps/desktop/electron/backend-release-gate.windows-live.test.ts
@@ -25,11 +25,7 @@ const isWindows = process.platform === 'win32'
function spawnSleeper(): { pid: number; kill: () => void } {
// A real python if available (mirrors the backend shape), else powershell.
- const child = spawn(
- 'powershell',
- ['-NoProfile', '-Command', 'Start-Sleep -Seconds 300'],
- { stdio: 'ignore' }
- )
+ const child = spawn('powershell', ['-NoProfile', '-Command', 'Start-Sleep -Seconds 300'], { stdio: 'ignore' })
if (!child.pid) {
throw new Error('sleeper failed to spawn')
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 0f9f2acb193..45e4511236f 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -3495,31 +3495,35 @@ async function releaseBackendLock(updateRoot, tag) {
const shim = venvHermesShimPath(updateRoot)
- const gate = await waitForBackendRelease(initialPids, {
- isShimLocked: () => Boolean(isShimLocked(shim)),
- isPidAlive: isPidAliveWindows,
- collectStragglerPids: () => {
- const stragglers = []
+ const gate = await waitForBackendRelease(
+ initialPids,
+ {
+ isShimLocked: () => Boolean(isShimLocked(shim)),
+ isPidAlive: isPidAliveWindows,
+ collectStragglerPids: () => {
+ const stragglers = []
- const currentHermesProcess = backendConnectionState.getProcess()
+ const currentHermesProcess = backendConnectionState.getProcess()
- if (currentHermesProcess && Number.isInteger(currentHermesProcess.pid)) {
- stragglers.push(currentHermesProcess.pid)
- }
+ if (currentHermesProcess && Number.isInteger(currentHermesProcess.pid)) {
+ stragglers.push(currentHermesProcess.pid)
+ }
- for (const entry of backendPool.values()) {
- if (entry.process && Number.isInteger(entry.process.pid)) {
- stragglers.push(entry.process.pid)
+ for (const entry of backendPool.values()) {
+ if (entry.process && Number.isInteger(entry.process.pid)) {
+ stragglers.push(entry.process.pid)
+ }
}
- }
- return stragglers
+ return stragglers
+ },
+ killProcessTree: forceKillProcessTree,
+ sleep: (ms: number) => new Promise(r => setTimeout(r, ms)),
+ now: () => Date.now(),
+ log: rememberLog
},
- killProcessTree: forceKillProcessTree,
- sleep: (ms: number) => new Promise(r => setTimeout(r, ms)),
- now: () => Date.now(),
- log: rememberLog
- }, tag)
+ tag
+ )
if (gate.unlocked) {
return { unlocked: true }