Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(phai): match e2e stream route without trailing slash (#67485)

Raúl Negrón-Oterob550cdaf35e2
diff --git a/products/posthog_ai/frontend/e2e/run-surface.spec.ts b/products/posthog_ai/frontend/e2e/run-surface.spec.ts
index 4e93873cc5c8..36881dce26b6 100644
--- a/products/posthog_ai/frontend/e2e/run-surface.spec.ts
+++ b/products/posthog_ai/frontend/e2e/run-surface.spec.ts
@@ -116,7 +116,10 @@ async function routeTasksApi(page: Page, mock: TasksApiMock): Promise<void> {
const runRe = new RegExp(`/tasks/${TASK_ID}/runs/${RUN_ID}/$`)
const tokenRe = new RegExp(`/runs/${RUN_ID}/stream_token/$`)
const logsRe = new RegExp(`/runs/${RUN_ID}/logs/$`)
- const streamRe = new RegExp(`/runs/${RUN_ID}/stream/$`)
+ // The `stream` action URL has no trailing slash (`.../stream?start=latest`), unlike the other
+ // resource paths — match it with an optional slash so the route intercepts instead of falling through
+ // to the real backend (a fall-through 404s the fake run id and masks the clean-EOF drop under test).
+ const streamRe = new RegExp(`/runs/${RUN_ID}/stream/?$`)
await page.route((url) => taskRe.test(url.pathname), fulfillJson(makeTask(mock.runStatus)))
await page.route(