test(transport): preserve large coverage with bounded timeline rows

Build a response above 50 MiB from rows below the existing content budget. Make the deferred draft-publication journey select a model before submitting so it does not test unresolved provider selection.
This commit is contained in:
Mohamed Boudra
2026-10-30 16:33:13 +01:00
parent f3d8718c6a
commit ab55377458
2 changed files with 16 additions and 6 deletions
@@ -1,3 +1,4 @@
import { chooseModel, startWithoutRememberedModel } from "../support/helpers/model-memory";
import {
composerLocator,
enterComposerFullscreen,
@@ -97,6 +98,7 @@ test.describe("New workspace composer draft", () => {
const project = await seedWorkspace({ repoPrefix: "new-workspace-submitted-draft-" });
try {
await startWithoutRememberedModel(page);
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openNewWorkspaceComposer(page, {
@@ -104,6 +106,7 @@ test.describe("New workspace composer draft", () => {
projectDisplayName: project.projectDisplayName,
});
await chooseModel(page, "mock", "Ten second stream");
const composer = page.getByRole("textbox", { name: "Message agent..." });
const createButton = page.getByTestId("workspace-create-submit");
await expect(composer).toBeEditable({ timeout: 30_000 });
@@ -2107,17 +2107,24 @@ test(
config: { provider: "claude/claude-test", modeId: "full-access" },
title: "Large history",
});
const text = "x".repeat(50 * 1024 * 1024);
await b.daemon.agentManager.appendTimelineItem(agent.id, { type: "assistant_message", text });
// Keep each row below the established item budget; exercise transport size across rows.
const text = "x".repeat(240 * 1024);
const rowCount = 220;
for (let index = 0; index < rowCount; index++) {
await b.daemon.agentManager.appendTimelineItem(agent.id, { type: "user_message", text });
}
await origin.paseo.hosts.add({ connection: `127.0.0.1:${b.port}` });
const serverId = (await online(origin.paseo)).hosts[0]!.serverId!;
const remote = await origin.paseo.hosts.client(serverId);
const response = await remote.agents.ref(agent.id).timeline.refetch({ limit: 20 });
const response = await remote.agents.ref(agent.id).timeline.refetch({ limit: 0 });
const messages = response.entries.flatMap((row) =>
row.item.type === "assistant_message" ? [row.item.text] : [],
row.item.type === "user_message" ? [row.item.text] : [],
);
expect(messages).toHaveLength(1);
expect(messages[0] === text).toBe(true);
expect(messages).toHaveLength(rowCount);
expect(messages.every((message) => message === text)).toBe(true);
expect(
messages.reduce((bytes, message) => bytes + Buffer.byteLength(message), 0),
).toBeGreaterThan(50 * 1024 * 1024);
expect((await remote.workspaces.list()).entries).toHaveLength(1);
await remote.dispose();
},