fix: qualify Codex sandbox probe and diagnose retained native sessions

This commit is contained in:
Dotta committed 2026-09-11 14:19:06 -05:00
1 parent 3f55e74a22
commit bd59c07a21
5 files changed
+109 -6

No files matched your search

+7 -5
View File
@@ -245,7 +245,9 @@ export async function runChatFlow(input: {
enableClassicTaskInterface: false,
});
expect(await api.get(chatPath)).toBeNull();
await page.goto(route);
// Cold Vite startup can keep unrelated assets loading after the chat is
// interactive. The composer assertion below verifies actual UI readiness.
await page.goto(route, { waitUntil: "domcontentloaded", timeout: 60_000 });
await expect(page.getByTestId("task-chat-composer-input")).toBeVisible();
expect(await api.get(chatPath)).toBeNull();
expect(await allRuns()).toHaveLength(0);
@@ -261,7 +263,7 @@ export async function runChatFlow(input: {
const initialId = issue!.id;
const before = runs.filter((run) => !isResetRun(run))[0]!;
await noTasks();
await page.reload();
await page.reload({ waitUntil: "domcontentloaded", timeout: 60_000 });
if (caseId === "continuity-restart") {
await turn(
"What phrase did I just ask you to remember? Reply with the phrase only.",
@@ -272,7 +274,7 @@ export async function runChatFlow(input: {
).toContain(secret);
const count = runs.length;
await input.restart();
await page.reload();
await page.reload({ waitUntil: "domcontentloaded", timeout: 60_000 });
await idle(2);
expect(runs).toHaveLength(count);
await turn(
@@ -365,7 +367,7 @@ export async function runChatFlow(input: {
).toEqual(
oldComments.filter((c) => c.createdByRunId === cancelledId),
);
await page.reload();
await page.reload({ waitUntil: "domcontentloaded", timeout: 60_000 });
await expect(
page.getByText("New session", { exact: true }),
).toHaveCount(1);
@@ -677,7 +679,7 @@ export async function runChatFlow(input: {
expect(projects[0]!.workspaces.filter((w) => w.repoUrl)).toHaveLength(
0,
);
await page.reload();
await page.reload({ waitUntil: "domcontentloaded", timeout: 60_000 });
await expect(
page.getByRole("article", { name: /Project created:/ }),
).toHaveCount(1);
+6 -1
View File
@@ -36,7 +36,12 @@ export async function prepareCodexCiSandbox(repositoryRoot: string, temporaryRoo
execFileSync("sudo", ["-n", "apparmor_parser", "-r", profilePath], { timeout: 15_000, stdio: "pipe" });
const probeHome = path.join(temporaryRoot, "codex-sandbox-probe");
await mkdir(probeHome, { mode: 0o700 });
execFileSync(binary, ["sandbox", "-C", temporaryRoot, "--", "/bin/true"], {
execFileSync(binary, [
"sandbox", "--permission-profile", "paperclip-e2e-probe",
"-c", 'permissions.paperclip-e2e-probe.filesystem={":root"="read"}',
"-c", "permissions.paperclip-e2e-probe.network.enabled=false",
"-C", temporaryRoot, "--", "/bin/true",
], {
cwd: temporaryRoot,
env: { PATH: process.env.PATH, CODEX_HOME: probeHome },
timeout: 15_000,