AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
ci(frontend): run the copilot journeys on the new chat stream runtime (#15616)
Reinier van der Leer925ba8a57c3d
diff --git a/autogpt_platform/frontend/src/playwright/journeys/copilot-reconnect-journey.spec.ts b/autogpt_platform/frontend/src/playwright/journeys/copilot-reconnect-journey.spec.tsindex 8162c1fb39..6aa97ff1b0 100644--- a/autogpt_platform/frontend/src/playwright/journeys/copilot-reconnect-journey.spec.ts+++ b/autogpt_platform/frontend/src/playwright/journeys/copilot-reconnect-journey.spec.ts@@ -25,6 +25,17 @@ const SCRIPT: ModelScript = slowAnswerScript;const ANSWER = SCRIPT.turns[0].text ?? "";test.describe("copilot reconnect journey", () => {+ // A resume after the turn finished finds its cursor trimmed, and the chat+ // seeds from the checkpoint this 409 carries.+ test.use({+ expectedResponses: [+ {+ status: 409,+ method: "GET",+ url: /\/api\/chat\/sessions\/[^/]+\/stream\?turn=/,+ },+ ],+ });test.beforeAll(requireScriptedModel);test("an answer cut off by a dropped connection arrives whole, once and as saved", async ({@@ -45,12 +56,6 @@ test.describe("copilot reconnect journey", () => {context,journeyUser,}) => {- // While offline, the pending follow-ups peek in useCopilotPendingChips.ts- // (`void getV2GetPendingMessages(sessionId).then(...)`, no catch) rejects- // with "Failed to fetch" and nothing handles it, so the page reports an- // uncaught error. Everything the user sees is right. Remove this marker- // when that request handles a network failure.- test.fail(true, "unhandled 'Failed to fetch' from useCopilotPendingChips");await loseConnectionMidAnswer({page,context,@@ -83,14 +88,22 @@ async function loseConnectionMidAnswer({).toBeVisible();// The connection drops mid-answer while the model is still writing it.+ // Online, one drop resumes silently: the chat speaks up from the second+ // failed attempt in a row.const reconnected = page.waitForRequest(isChatStream("GET"));if (offline) await context.setOffline(true);await cutChatStreams(page);- await expect(- page.getByText(/Reconnecting/).first(),- "the chat should say it lost the connection",- ).toBeVisible();- if (offline) await context.setOffline(false);+ if (offline) {+ await expect(+ page.getByText("You're offline", { exact: true }),+ "the page should say the browser is offline",+ ).toBeVisible();+ await expect(+ transcript.getByText(/Offline — waiting for the network/).first(),+ "the chat should say it is waiting for the network",+ ).toBeVisible();+ await context.setOffline(false);+ }await reconnected;await expect(diff --git a/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json b/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.jsonindex 5fc673adea..7621808e0b 100644--- a/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json+++ b/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json@@ -8,5 +8,6 @@"skills-hub": true,"graphiti-memory": true,"expert-spend-approval": true,- "enable-platform-payment": true+ "enable-platform-payment": true,+ "copilot-stream-runtime": true}