Skip to content

Scenario helper t3.open(path) deep-links before the pairing sign-in finishes, landing unauthenticated #36534

Closed as duplicate

Description

@farseenmanekhan1232

What happened

In a web scenario, t3.open("/settings/keybindings") opens the pairing link and then immediately opens the deep path. The pair URL signs in asynchronously after the page loads, so the second navigation races it: the app lands on the deep path unauthenticated, the auth gate redirects back to /pair, and the scenario is stuck on the manual pairing form with the token already stripped from the URL. The next tap fails with LOCATOR_NOT_FOUND, so a proof run records "could not run" instead of showing the behavior under test.

Diagnosis

scripts/scenarios/t3.ts's open awaits app.open(pairingPath) and then app.open(path) with nothing in between. PairingRouteSurface auto-submits the pairing token only after the route mounts, and onAuthenticated replaces the URL to / and reloads — all after app.open has already resolved (it waits for page load). The deep page's auth gate (resolveInitialServerAuthGateState) sees no session and no token, returns requires-auth, and the router redirects to /pair.

Every tracked scenario calls t3.open() with no path and stays on the sign-in journey, which is why nothing else has hit this.

Steps to reproduce

  1. Write a scenario that calls await t3.open("/settings/keybindings") (any non-root path) and then taps a control that only exists when signed in.
  2. Run it: cd scripts && pnpm exec e2e run scenarios/<file>.e2e.ts.
  3. The tap fails with LOCATOR_NOT_FOUND; the trace shows the app navigating to the deep path and back to /pair, with GET /api/orchestration/shell → 401 repeating.

Version

0.1.9 (commit 2e0bd97)

Environment

Arch Linux (omarchy), Linux 7.2.15, Node v26.13.1, e2e 0.23.0, bundled Chromium 156.0.8078.4

Evidence

From the failed attempt's trace.md (the keybinding layout scenario, before it was reworked to navigate client-side):

3. ✗ locator.tap getByRole("button", name: "Edit shortcut for Terminal: Toggle: Ctrl+J") — LOCATOR_NOT_FOUND
   ↪ navigated to /settings/keybindings
   ↪ navigated to /pair
   ✗ console error: WebSocket connection to 'ws://127.0.0.1:44459/ws?clientSurface=web&…' failed
   ⚠ network warning: GET /api/orchestration/shell?omitIdleSubagents=1&omitOlderSettled=1 401 Unauthorized
   ℹ WARN: Could not load the environment shell snapshot over HTTP; using the socket snapshot instead.
     {cause: EnvironmentAuthInvalidError: The environment rejected the request…}

Related issues

Found while proving #35787; PR #36532 works around it by navigating client-side (Settings → section) after t3.open(). This issue tracks the helper itself.

Fix applied or workaround

Scenarios avoid t3.open(path) and navigate client-side after t3.open(). A helper fix would wait for the sign-in to finish before opening the path, e.g. await browser.waitForURL(/^(?!.*\/pair)/) between the two app.open calls.

Filed by

claude (glm-5.3-cf) following the t3 triage template; the interactive t3 triage agent flow could not run from this session.

Activity

  1. juliusmarminge commented on Nov 14, 2026

    @juliusmarminge
    Member

    This is the same problem as #36054, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions