fix(sessions): preserve cross-session input ownership and history (#6613)
* fix(webui): reconcile cross-session history by message ID * fix(sessions): preserve target authority and input ownership Resolve cross-session follow-ups through the target route, carry stable input IDs through admission and recovery, and associate live and replayed answers with the inputs actually consumed. Keep ordinary input scope isolation and omit historical anomaly repair. Resolves NAN-430. * fix(sessions): complete input identity integration across boundaries Carry input identity explicitly in projected input events, keep runner annotations out of public history, and reuse the canonical WebUI session parser during recovery. Type validated recovery metadata and align existing channel and subagent regressions with explicit response ownership. All nine failed compatibility cases and adjacent recovery coverage pass in a focused 58-test run. * fix(sessions): unify input recording and block remote commands * fix(webui): keep input ownership checks page-bounded Look up referenced inputs through the existing identity index before invoking transcript backfill. Complete pages no longer scan the full prompt history, including answers whose inputs live on earlier pages. Cover cold-cache pagination and cross-turn ownership in existing regressions. Focused pagination, replay and follow-up recovery checks: 88 passed. * fix(webui): preserve response ownership during history replay * fix: resolve strict typing in response replay * fix: preserve continuation ownership during recovery * test: diagnose stuck gateway asyncio shutdown * test: retain gateway thread stack diagnostics * test(webui): stabilize native autoscroll browser setup
This commit is contained in:
1 parent
0ce335bf12
commit
394a78e82d
51 files changed
+1412
-334
No files matched your search
@@ -8,7 +8,7 @@ test.use({ launchOptions: {
|
||||
test("lets native autoscroll leave the live tail and reverse after returning", async ({ page }) => {
|
||||
// A real scrolling control catches browser configurations without native autoscroll.
|
||||
await page.setContent('<div id="control" style="height:600px;overflow:auto"><div style="height:5000px">Autoscroll control</div></div>');
|
||||
await page.mouse.click(200, 200, { button: "middle" });
|
||||
await page.locator("#control").click({ button: "middle", position: { x: 200, y: 200 } });
|
||||
await page.mouse.move(200, 300);
|
||||
await expect.poll(() => page.locator("#control").evaluate((node) => node.scrollTop)).toBeGreaterThan(100);
|
||||
await page.keyboard.press("Escape");
|
||||
@@ -16,24 +16,26 @@ test("lets native autoscroll leave the live tail and reverse after returning", a
|
||||
await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en"));
|
||||
await page.goto("/browser/fixture.html?case=history-boundary&local=1");
|
||||
const body = page.getByTestId("thread-message-region");
|
||||
await expect(body.getByText("Cached message 279", { exact: true })).toBeVisible();
|
||||
const bottom = await body.evaluate((node) => node.scrollHeight - node.clientHeight);
|
||||
expect(bottom).toBeGreaterThan(1_000);
|
||||
await expect.poll(() => body.evaluate((node) => node.scrollTop)).toBeGreaterThan(bottom - 1);
|
||||
const bounds = await body.getByText("Cached message 279", { exact: true }).boundingBox();
|
||||
// The plain-text fallback is replaced when the lazy Markdown renderer loads.
|
||||
const tail = body.locator(".markdown-content").getByText("Cached message 279", { exact: true });
|
||||
await expect(tail).toBeVisible();
|
||||
const distanceFromBottom = () => body.evaluate((node) => node.scrollHeight - node.clientHeight - node.scrollTop);
|
||||
expect(await body.evaluate((node) => node.scrollHeight - node.clientHeight)).toBeGreaterThan(1_000);
|
||||
await expect.poll(distanceFromBottom).toBeLessThan(1);
|
||||
await tail.click({ button: "middle" });
|
||||
const bounds = await tail.boundingBox();
|
||||
expect(bounds).not.toBeNull();
|
||||
const x = bounds!.x + bounds!.width / 2;
|
||||
const y = bounds!.y + bounds!.height / 2;
|
||||
|
||||
await page.mouse.click(x, y, { button: "middle" });
|
||||
await page.mouse.move(x, y - 100);
|
||||
await expect.poll(() => body.evaluate((node) => node.scrollTop)).toBeLessThan(bottom - 150);
|
||||
await expect.poll(distanceFromBottom).toBeGreaterThan(150);
|
||||
await page.mouse.move(x, y + 100);
|
||||
await expect.poll(() => body.evaluate((node) => node.scrollTop)).toBeGreaterThan(bottom - 1);
|
||||
await expect.poll(distanceFromBottom).toBeLessThan(1);
|
||||
await page.mouse.move(x, y - 100);
|
||||
await expect.poll(() => body.evaluate((node) => node.scrollTop)).toBeLessThan(bottom - 150);
|
||||
await expect.poll(distanceFromBottom).toBeGreaterThan(150);
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByRole("button", { name: "Scroll to bottom" })).toBeVisible();
|
||||
await page.getByRole("button", { name: "Scroll to bottom" }).click();
|
||||
await expect.poll(() => body.evaluate((node) => node.scrollTop)).toBeGreaterThan(bottom - 1);
|
||||
await expect.poll(distanceFromBottom).toBeLessThan(1);
|
||||
});
|
||||
Reference in new issue
Block a user