From 44e54d6185aacda921d303d95f26b774b629cd43 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 8 Nov 2026 23:09:58 -0600 Subject: [PATCH] test(evals): wait for the owner handoff's project link to render The reply settled with a project link in its text, but the thread had not rendered the link yet when the step read it. Poll briefly for the rendered link before failing. Co-Authored-By: Claude Opus 5.5 --- tests/runner-e2e/chat-catalog-domains/internal-privacy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/runner-e2e/chat-catalog-domains/internal-privacy.ts b/tests/runner-e2e/chat-catalog-domains/internal-privacy.ts index 8aa0d5bb391..62c2a05e65a 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-privacy.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-privacy.ts @@ -194,10 +194,13 @@ function shareProject(): ChatCatalogCase { await ctx.input.evidence("chat-catalog-before-owner-project-sharing.json", state.beforeShare); if (agentMutation !== 403 || ![403, 404].includes((state.beforeShare as { observerProjectStatus: number }).observerProjectStatus)) throw new Error("Private-project audience changed without the authorized human control"); - const href = first.links.find(link => hasLink({ ...first, links: [link] }, "projects", p)); + // The reply can settle before its links render in the thread; wait briefly for them. + const linked = await pollUntil({ label: "Owner handoff project link rendered", deadlineAt: Date.now() + 20_000, + load: () => observeInternal(ctx, state), accept: o => o.links.some(link => hasLink({ ...o, links: [link] }, "projects", p)) }).catch(() => first); + const href = linked.links.find(link => hasLink({ ...linked, links: [link] }, "projects", p)); if (!href) throw new Error("Owner handoff omitted the actual project link"); const sourceUrl = ctx.input.page.url(); - await internalResultLink(ctx, first, href).first().click(); + await internalResultLink(ctx, linked, href).first().click(); await ctx.input.page.getByText("Configuration", { exact: true }).last().click(); await ctx.input.page.getByRole("button", { name: "Manage access", exact: true }).click(); const dialog = ctx.input.page.getByRole("dialog", { name: "Private project access", exact: true });