fix(hopper): verify lease cleanup and repair the macOS test lane (#1111)

* fix(hopper): distinguish shared lease roots from leaked sessions

* fix(ci): follow the moved process CLI regression tests
This commit is contained in:
Ysopwnable
2026-10-09 02:41:34 +08:00
committed by GitHub
parent ec6db0f063
commit b743bd20a0
6 changed files with 253 additions and 46 deletions
+6 -2
View File
@@ -23,7 +23,11 @@ export type HopperTargetLeaseAcquisition =
| { readonly acquired: true; readonly lease: HopperTargetLease }
| { readonly acquired: false; readonly owner: HopperTargetLeaseOwner };
const leaseDirectory = join("/tmp", `rea-hopper-${process.getuid?.() ?? 0}`);
/** Shared private parent of per-target lease sockets; it outlives individual sessions. */
export const HOPPER_TARGET_LEASE_DIRECTORY = join(
"/tmp",
`rea-hopper-${process.getuid?.() ?? 0}`,
);
/** Keep two REA processes from opening duplicate Hopper documents for one target/profile. */
export const acquireHopperTargetLease = async (input: {
@@ -33,7 +37,7 @@ export const acquireHopperTargetLease = async (input: {
readonly runId: string;
readonly directory?: string;
}): Promise<HopperTargetLeaseAcquisition> => {
const directory = input.directory ?? leaseDirectory;
const directory = input.directory ?? HOPPER_TARGET_LEASE_DIRECTORY;
await ensureLeaseDirectory(directory);
// The canonical path only derives the lease key; it never authorizes access.
// Common expected `realpath` failures include a missing target or path