test(evals): reset Morgan's sessions from the profile header actions menu

The agent profile h1 is the agent's title, not its name, and the menu item now reads "Reset sessions". Identity is already confirmed by the named avatar in openRuntimeAgentProfile; use the main landmark and a case-insensitive reset label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 5.5 committed 2026-11-08 23:28:52 -06:00
1 parent 8680b56b89
commit 4a34c17d75
1 file changed
+4 -3
@@ -53,11 +53,12 @@ export const runtimeSessionCases = [runtimeDefinition("runs-adapters.reset-sessi
state.agentResetStatus = await probeAgentPermission(ctx, `/api/agents/${worker.id}/runtime-state/reset-session`, "POST", {});
state.sessionPresentBeforeHuman = (await ctx.input.api.get<unknown[]>(`/api/agents/${worker.id}/task-sessions`)).length > 0;
const source = ctx.input.page.url(); await openRuntimeAgentProfile(ctx, worker, query);
const profile = ctx.input.page.locator("#main-content");
await expect(profile.getByRole("heading", { name: worker.name!, exact: true })).toBeVisible();
// The profile header's h1 is Morgan's title; openRuntimeAgentProfile already confirmed whose
// profile this is by its named avatar. The reset control lives in the header's actions menu.
const profile = ctx.input.page.getByRole("main");
await profile.getByRole("button", { name: `Open actions for ${worker.name}`, exact: true }).click();
chatCatalogNativePhaseRemainingBudget(ctx)?.();
await ctx.input.page.getByRole("button", { name: "Reset Sessions", exact: true }).click();
await ctx.input.page.getByRole("button", { name: /^Reset sessions$/i }).click();
await pollUntil({ label: "Human reset clears the real task session", deadlineAt: Date.now() + 30_000,
load: () => ctx.input.api.get<unknown[]>(`/api/agents/${worker.id}/task-sessions`), accept: rows => rows.length === 0 });
state.humanReset = true; state.sessionsEmptyAfterHuman = true;