Merge remote-tracking branch 'upstream/master' into fix/reject-terminal-run-checkouts

This commit is contained in:
Engineer 2026-08-28 13:15:05 -05:00
commit 9a350c0bca
2 changed files with 14 additions and 3 deletions

View File

@ -2369,9 +2369,12 @@ describe("agent issue mutation checkout ownership", () => {
// Base boundary denied AND tasks:assign denied: the watchdog grant lets the
// mutation past the ownership boundary, but the assignment guard must still bite.
mockAccessService.decide.mockImplementation(async (input: { action: string }) => ({
allowed: input.action === "company_scope:read",
allowed: input.action === "company_scope:read" || input.action === "issue:read",
action: input.action,
reason: input.action === "company_scope:read" ? "allow_explicit_grant" : "deny_policy_restricted",
reason:
input.action === "company_scope:read" || input.action === "issue:read"
? "allow_explicit_grant"
: "deny_policy_restricted",
explanation:
input.action === "tasks:assign"
? "Target agent requires approval before task assignment."
@ -2385,6 +2388,9 @@ describe("agent issue mutation checkout ownership", () => {
expect(res.status, JSON.stringify(res.body)).toBe(403);
expect(res.body.error).toContain("requires approval");
expect(mockAccessService.decide).toHaveBeenCalledWith(
expect.objectContaining({ action: "tasks:assign" }),
);
expect(mockIssueService.update).not.toHaveBeenCalled();
});

View File

@ -8238,7 +8238,12 @@ describeEmbeddedPostgres("workspace runtime startup reconciliation", () => {
expect(services[0]?.url).not.toBe(rootUrl);
await expect(fetch(services[0]!.url!)).resolves.toMatchObject({ ok: true });
await expect(fetch(healthUrl)).resolves.toMatchObject({ ok: false, status: 503 });
expect(await readLocalServicePortOwner(stalePort!)).toBe(staleProcess.pid);
const stalePortOwnerPid = await readLocalServicePortOwner(stalePort!);
expect(stalePortOwnerPid).not.toBeNull();
expect(staleProcess.pid).toBeTypeOf("number");
await expect(
isLocalServiceProcessOwnedBy(stalePortOwnerPid!, staleProcess.pid!),
).resolves.toBe(true);
} finally {
leasedRunIds.delete(runId);
await releaseRuntimeServicesForRun(runId);