mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* chore(ci): audit packaging costs and repeated test execution Read-only audit: Linux packaging and smokes consume 12-14 minutes; all three CLI shards repeat the 294-test source suite and build the server twice. Preserve the 17 required contexts, move packaging to main, run CLI source tests once, and consolidate repeated E2E setup into journeys. Historical logs and the complete audit were reported outside the repository. * ci: move packaging to main and remove repeated CLI suites PR runners were rebuilding distribution artifacts and executing the entire CLI source suite on all three E2E shards. Keep packaging coverage after merge, let the local E2E runner own its dependency build, and execute source tests once in an existing required check. Root typecheck already validates plugin examples. * test(ci): consolidate journeys and remove repeated startup work Run user journeys with shared setup, retain one Hub CLI contract, and weight the existing Playwright shards using observed costs. Remove implementation-only and ad-hoc measurement checks. Await root-watch closure and publish creation failure commands atomically so teardown and failure injection have completion boundaries. * test(hub): remove incidental observation and speculative shutdown changes Hub control RPCs need a connected client without an agent observation. Preserve the failed-create subscription contract and remove product shutdown changes whose Windows cleanup cause was not reproduced. * fix(client): clear the scheduled retry when a connect attempt opens a transport An explicit connect() during reconnect backoff opened a new transport but left the scheduled retry armed. When it fired on the healthy connection it disposed the transport and reconnected, dropping requests in flight. This is why owned-subscriptions-old-daemon could still fail after #4858 added the explicit reconnect. attemptConnect now owns the rule ensureConnected already applied; the new unit test fails on the old client. * test(e2e): keep the completed-block, font-readiness, and live-page guards inside journeys - agent-stream-ui: the auto-scroll journey anchors on the completed intro block by content and requires its Markdown root to stay the same mounted node while later blocks stream (#1989 guard, reshaped off the tail block). - changes-pane: the code-typography journey holds font loads and requires no diff geometry before they resolve, then applies the font change. - agent-timeline-pagination: the live-output page load runs against a thirty-minute mock stream and gates the release on the running turn, so the status assertion no longer races a ten-second turn. * test(desktop): install the Electron binary once before the unit suite Electron 44 downloads its binary on the first Node require("electron") instead of at npm ci. Vitest workers importing electron-log/main raced that download and extraction (File exists on dist/electron, then "Electron failed to install correctly" in a sibling worker) on both Ubuntu and Windows desktop-tests jobs. Run the package's idempotent install-electron in one process before vitest forks. * ci(desktop-packages): pin actions and smoke packaging-path pull requests Pin checkout, setup-node, and upload-artifact to full commit SHAs. Keep packaging off ordinary PR CI, but run the Linux package smoke on pull requests that touch packages/desktop, nix, or the workflow so a packaging or sandbox regression cannot land on main unchecked. The desktop release workflow already builds and smokes its own artifacts on all platforms.
230 lines
8.8 KiB
TypeScript
230 lines
8.8 KiB
TypeScript
import { expect, test } from "../support/fixtures";
|
|
import {
|
|
expectStableHistoryStartGutter,
|
|
expectTimelineAtHistoryStart,
|
|
expectTimelinePromptCentered,
|
|
expectTimelinePromptNotMounted,
|
|
expectTimelinePromptPositionPreserved,
|
|
expectTimelinePromptVisible,
|
|
holdBootstrapTimelinePage,
|
|
holdDaemonHydration,
|
|
holdOlderHistoryPages,
|
|
makeLoadedTimelineFitViewport,
|
|
openAgentTimeline,
|
|
rememberTimelineViewport,
|
|
rememberTimelinePromptPosition,
|
|
reloadAgentTimelineFromPersistedReplica,
|
|
scrollTimelineUntilOlderHistoryIsReachable,
|
|
scrollTimelineToOldestLoadedEdge,
|
|
scrollTimelineToNewestLoadedEdge,
|
|
seedLongMockAgentTimeline,
|
|
scrollThroughOlderHistoryPages,
|
|
seedRealisticOlderTimeline,
|
|
sendLiveTurnBeforeHydration,
|
|
expectTimelineViewportAnchoredAfterPrepend,
|
|
userNavigatesTimelineToHistoryStartWithKeyboard,
|
|
userScrollsTimelineToHistoryStart,
|
|
} from "../support/helpers/timeline-pagination";
|
|
|
|
test.describe("Agent timeline pagination", () => {
|
|
test("keeps the history-start gutter and visible position stable through the final page", async ({
|
|
page,
|
|
}) => {
|
|
const agent = await seedLongMockAgentTimeline({ turns: 40 });
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await expectStableHistoryStartGutter(page);
|
|
|
|
await userScrollsTimelineToHistoryStart(page);
|
|
await history.expectRequestedPages(1);
|
|
await expectStableHistoryStartGutter(page);
|
|
const viewport = await rememberTimelineViewport(page);
|
|
|
|
history.releasePage(1);
|
|
await expectTimelineViewportAnchoredAfterPrepend(page, viewport);
|
|
await history.expectSettledWithRequestedPages(1);
|
|
await expectStableHistoryStartGutter(page);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("loads one page each time the user returns to history start", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedLongMockAgentTimeline({ turns: 80 });
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await expectTimelinePromptVisible(page, agent.newestPrompt);
|
|
await expectTimelinePromptCentered(page, agent.newestPrompt);
|
|
await expectTimelinePromptNotMounted(page, agent.oldestPrompt);
|
|
await expectTimelinePromptNotMounted(page, agent.initialTailOldestPrompt);
|
|
|
|
await userScrollsTimelineToHistoryStart(page);
|
|
await expectTimelinePromptVisible(page, agent.initialTailOldestPrompt);
|
|
await history.expectRequestedPages(1);
|
|
const viewport = await rememberTimelineViewport(page);
|
|
history.releasePage(1);
|
|
await expectTimelineViewportAnchoredAfterPrepend(page, viewport);
|
|
await history.expectSettledWithRequestedPages(1);
|
|
|
|
await userScrollsTimelineToHistoryStart(page);
|
|
await expectTimelinePromptCentered(page, agent.firstOlderPagePrompt);
|
|
await history.expectRequestedPages(2);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("loads older history when the user navigates to history start with the keyboard", async ({
|
|
page,
|
|
}) => {
|
|
const agent = await seedLongMockAgentTimeline({ turns: 40 });
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
|
|
await userNavigatesTimelineToHistoryStartWithKeyboard(page);
|
|
await history.expectRequestedPages(1);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("does not repeat an assistant block that spans older history pages", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedRealisticOlderTimeline();
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await expectTimelinePromptVisible(page, agent.newestPrompt);
|
|
|
|
await scrollThroughOlderHistoryPages(page, 3, history);
|
|
history.expectNoRepeatedEntries();
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("keeps visible history anchored when live output grows during a prepend", async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedLongMockAgentTimeline({ turns: 80 });
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await userScrollsTimelineToHistoryStart(page);
|
|
await history.expectRequestedPages(1);
|
|
const position = await rememberTimelinePromptPosition(page, agent.initialTailOldestPrompt);
|
|
|
|
await agent.client.sendAgentMessage(
|
|
agent.agentId,
|
|
"timeline live during held older page: emit 20 coalesced agent stream updates",
|
|
);
|
|
await agent.client.waitForFinish(agent.agentId, 15_000);
|
|
history.releasePage(1);
|
|
|
|
await expectTimelinePromptPositionPreserved(page, position);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("finishes loading an older page while live output continues", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
// The live turn streams for thirty minutes, so it is still running at every assertion.
|
|
const agent = await seedLongMockAgentTimeline({ turns: 40, liveTurns: "thirty-minute-stream" });
|
|
try {
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await userScrollsTimelineToHistoryStart(page);
|
|
await history.expectRequestedPages(1);
|
|
|
|
await agent.client.sendAgentMessage(agent.agentId, "keep streaming while history settles");
|
|
await agent.client.waitForAgentUpsert(
|
|
agent.agentId,
|
|
(snapshot) => snapshot.status === "running",
|
|
);
|
|
const timeline = page.locator('[data-testid="agent-chat-scroll"]:visible').first();
|
|
await expect(timeline.getByText("walking through").first()).toBeAttached();
|
|
history.releasePage(1);
|
|
|
|
await expect(timeline.getByText(agent.newestOlderPagePrompt, { exact: true })).toBeAttached();
|
|
await expect(page.getByTestId("load-older-history-spinner")).toBeHidden({ timeout: 5_000 });
|
|
const running = await agent.client.fetchAgents({ scope: "active" });
|
|
expect(running.entries.find((entry) => entry.agent.id === agent.agentId)?.agent.status).toBe(
|
|
"running",
|
|
);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("keeps loading while older pages still leave history start exposed", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedLongMockAgentTimeline({ turns: 80 });
|
|
try {
|
|
await makeLoadedTimelineFitViewport(page);
|
|
const history = await holdOlderHistoryPages(page, agent);
|
|
await openAgentTimeline(page, agent);
|
|
await scrollTimelineToOldestLoadedEdge(page);
|
|
await history.expectRequestedPages(1);
|
|
await expect(page.getByTestId("load-older-history-spinner")).toBeVisible();
|
|
|
|
history.releasePage(1);
|
|
await history.expectRequestedPages(2);
|
|
await expectTimelineAtHistoryStart(page);
|
|
await expect(page.getByTestId("load-older-history-spinner")).toBeVisible();
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("keeps complete loaded history reachable after reload", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedLongMockAgentTimeline({ turns: 80 });
|
|
try {
|
|
await openAgentTimeline(page, agent);
|
|
await scrollTimelineUntilOlderHistoryIsReachable(page, agent.oldestPrompt);
|
|
await expectTimelinePromptVisible(page, agent.oldestPrompt);
|
|
|
|
const hydration = await holdDaemonHydration(page);
|
|
await reloadAgentTimelineFromPersistedReplica(page, agent);
|
|
hydration.release();
|
|
await scrollTimelineUntilOlderHistoryIsReachable(page, agent.oldestPrompt);
|
|
|
|
await expectTimelinePromptVisible(page, agent.oldestPrompt);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
|
|
test("preserves a live row received before replica hydration", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
const agent = await seedLongMockAgentTimeline({ turns: 80 });
|
|
try {
|
|
await openAgentTimeline(page, agent);
|
|
await scrollTimelineUntilOlderHistoryIsReachable(page, agent.oldestPrompt);
|
|
|
|
const hydration = await holdBootstrapTimelinePage(page, agent);
|
|
await reloadAgentTimelineFromPersistedReplica(page, agent);
|
|
await hydration.waitForDelayedResponse();
|
|
const livePrompt = await sendLiveTurnBeforeHydration(agent);
|
|
await expectTimelinePromptVisible(page, livePrompt);
|
|
|
|
hydration.release();
|
|
await hydration.waitForDelayedCatchUp();
|
|
await expectTimelinePromptVisible(page, livePrompt);
|
|
hydration.releaseCatchUp();
|
|
await scrollTimelineUntilOlderHistoryIsReachable(page, agent.oldestPrompt);
|
|
await expectTimelinePromptVisible(page, agent.oldestPrompt);
|
|
await scrollTimelineToNewestLoadedEdge(page);
|
|
await expectTimelinePromptVisible(page, livePrompt);
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|
|
});
|