Keep timeline history duplicate-free across daemon upgrades (#2789)

* fix(app): keep timeline pagination duplicate-free

Older daemons page projected history by canonical sequence ranges, so one projected block can appear in adjacent responses. Accept each block on the page containing its projection anchor while still advancing across empty projected pages.\n\nProjected siblings can share a provider message ID, so render identity also includes the timeline cursor instead of collapsing distinct blocks onto one layout row.

* fix(e2e): preserve isolated daemon launch contract

Keep the source-daemon spawn path recognizable to the repository launch-contract check while selecting the built supervisor only for published package fixtures.

* fix(app): preserve stable timeline item identity
This commit is contained in:
Mohamed Boudra
2026-08-02 12:21:47 +02:00
committed by GitHub
parent 0a106dd35f
commit 26bdb1d171
9 changed files with 407 additions and 44 deletions
@@ -56,7 +56,9 @@ interface OlderHistoryLoadingOperation {
interface OlderHistoryPages {
expectRequestedPages(count: number): Promise<void>;
expectSettledWithRequestedPages(count: number): Promise<void>;
expectNoRepeatedAssistantEntries(): void;
expectNoRepeatedEntries(): void;
expectRepeatedEntries(): void;
expectOwnedTextRendered(text: string): Promise<void>;
releasePage(pageNumber: number): void;
}
@@ -161,8 +163,12 @@ export async function expectTimelinePromptPositionPreserved(
.toBeLessThanOrEqual(2);
}
export async function openAgentTimeline(page: Page, agent: MockAgentWorkspace): Promise<void> {
await page.goto(buildAgentRoute(agent.workspaceId, agent.agentId));
export async function openAgentTimeline(
page: Page,
agent: MockAgentWorkspace,
serverId?: string,
): Promise<void> {
await page.goto(buildAgentRoute(agent.workspaceId, agent.agentId, serverId));
await page.waitForURL(
(url) => url.pathname.includes("/workspace/") && !url.searchParams.has("open"),
{ timeout: 60_000 },
@@ -262,8 +268,13 @@ export async function holdNextOlderTimelinePage(
export async function holdOlderHistoryPages(
page: Page,
agent: MockAgentWorkspace,
daemonPort?: number,
): Promise<OlderHistoryPages> {
const gate: OlderTimelinePagesGate = await holdAgentOlderTimelinePages(page, agent.agentId);
const gate: OlderTimelinePagesGate = await holdAgentOlderTimelinePages(
page,
agent.agentId,
daemonPort,
);
return {
async expectRequestedPages(count) {
await gate.waitForRequestCount(count);
@@ -273,8 +284,17 @@ export async function holdOlderHistoryPages(
await waitForTimelineGeometryToSettle(page);
expect(gate.getRequestCount()).toBe(count);
},
expectNoRepeatedAssistantEntries() {
expect(gate.getRepeatedAssistantEntryCount()).toBe(0);
expectNoRepeatedEntries() {
expect(gate.getRepeatedEntryCount()).toBe(0);
},
expectRepeatedEntries() {
expect(gate.getRepeatedEntryCount()).toBeGreaterThan(0);
},
async expectOwnedTextRendered(text) {
const expectedCount = gate.getOwnedEntryCountContaining(text);
expect(expectedCount).toBeGreaterThan(0);
const timeline = page.locator('[data-testid="agent-chat-scroll"]:visible').first();
await expect(timeline.getByText(text, { exact: false })).toHaveCount(expectedCount);
},
releasePage(pageNumber) {
gate.releasePage(pageNumber);