Skip to content

Dashboard E2E red on main since #1421: Playwright suite makes keyless Tower requests; the auth fast-follow covered only the vitest harness #1519

Closed

Description

@amrmelsayed

Dashboard E2E Tests is red on main: run 32115101362 at ee1fffdde (2026-08-18T08:11Z), 27 failed / 1 flaky / 33 passed of 65. Last green: 2026-08-17T08:16Z at 47477ca76. Every failure is either element(s) not found on Tower-served pages or an API-contract assertion — across dashboard-bugs, dashboard-terminals, team-tab and siblings, i.e. environment-shaped, not one feature.

Root cause: the PR #1421 auth enforcement, reaching the one suite that never runs on PRs

PR #1421 (advisory GHSA-xvjp-7748-v88v) put every Tower route outside a narrow public allowlist behind the shared local key. Its in-PR CI fix (acb828560, "authenticate Tower e2e suites") keyed the vitest harness — a global fetch wrapper in packages/codev/vitest-e2e-setup.ts plus socket-key plumbing in tower-test-utils.ts. That made the required checks green.

The dashboard suite is a Playwright harness (packages/codev/src/agent-farm/__tests__/e2e/*.test.ts), which the vitest setup file cannot touch — and its workflow is schedule-only, so it never runs on a PR. It kept making keyless requests (dashboard-bugs.test.ts hits http://localhost:4100 and the workspace API with no key anywhere; grep for key/auth in those files comes back empty), and turned red the first time its schedule fired after the merge.

Timeline: green daily through 08-17 08:16 → #1421 merged in f1a5b3bd9 → red at the next scheduled run, 08-18 08:11.

The fix is alignment with the shipped browser design, not a bypass

server-utils.ts shows the intended browser flow: /, /index.html and the SPA shell under /workspace/<enc>/ are public; the key is injected into the shell same-origin, and the shell presents it on every data fetch; all api//ws/ subpaths stay keyed (isPublicRoute, server-utils.ts:142-160; injection note at :291-293).

So the suite splits two ways:

  1. Tests that drive the real UI (front page instances, SPA views) should keep doing exactly that and pass because the shell's key injection works — if any of these still fail once direct-API tests are keyed, that is a product bug in the injection path, not a test gap, and it is the part of this failure worth caring about most.
  2. Tests that hit APIs directly (/api/state, /api/team, proxy API, WS handshakes) must present the key the way a real client does — e.g. browser.newContext({ extraHTTPHeaders }) with the local key, or the suite's own fetch helper, mirroring what vitest-e2e-setup.ts did for the other harness.

Two structural notes for whoever picks this up

  • "Checks green on the PR" and "all workflows that will run against this commit" are different sets. A schedule-only workflow can only ever fail after merge, so any change with a known test-impact class (here: "keyless e2e requests now 401") needs that class chased across all harnesses, not just the ones the PR can turn red. This was even foreseen: the 08-12 review explicitly deferred "the e2e-auth update" as a fast-follow for the suites that were red — the suites that couldn't go red on the PR never made the list.
  • This is the instrument lesson again: the PR's green board was true of the PR's check set, not of the commit's future. Nothing lied; the question answered was narrower than the one that mattered.

Related: #1421 (the enforcement), advisory GHSA-xvjp-7748-v88v, #1435/#1456 (the other current CI-signal noise — note today's alert was a TRUE positive, unlike #1456's two false ones this week).

Activity

  1. added
    area/tower
    on Aug 18, 2026
  2. amrmelsayed commented on Aug 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on a fix now.

  3. added 5 commits that reference this issue on Aug 18, 2026
    66e0a44
    f90f029
    6b03415
    36a47e2
    9ee02c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions