# Wetech Dashboard navigation race

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "wetech-dashboard-navigation-race-2026-09-07",
  "problems": [{
    "problemId": "dashboard-signin-competes-with-p81-redirect",
    "summary": "Dashboard token recovery starts a signin navigation while P81 is still connecting; P81's application redirect cancels it with ERR_ABORTED.",
    "status": "candidate",
    "applicability": "Wetech Managed Tool Dashboard bootstrap while the browser remains on the P81 connect origin.",
    "issueKeys": ["APID-29464", "APID-29470"],
    "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29470#problem:dashboard-navigation-race"],
    "signalTextIncludesAny": ["ERR_ABORTED", "provider_dashboard_login_failed"],
    "observedThrough": "2026-09-07",
    "effectiveAt": null,
    "verifiedAt": null,
    "attemptedAction": "Only refresh the Dashboard token and navigate to signin when the browser is on the exact target origin; preserve P81's existing connection loop and deadline.",
    "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29470"
  }]
}
-->

Owner: Wetech Managed Tool Provider Executor, `ensureDashboardSession` in
`tools/agent9-auto-oncall/managed-wetech/index.mjs`. Fetched repair base:
`d2126b19f77b3049f943d7507d2a93c856c2be80`. Wetech package v42 contains the
change. No diagnostic prompt, credential profile, retry count, query or
installation authority changes.

A real temporary E2B reproduced the v41 failure on SaaS02. At 3790 ms the Tool
navigated from P81 `/connect` to Dashboard `/#/signin`; at 3939 ms P81's own
frontend script initiated application navigation, canceling the Tool's request
at 3941 ms with `net::ERR_ABORTED`. CDP recorded `canceled=true` and the P81
script initiator. P81 connect returned HTTP 200 without a nested error, and no
Dashboard credentials had been submitted. The original flow also successfully
returned three Slow Query rows on yk-qfxt, demonstrating the intermittent path.

The one-condition candidate passed real E2B Slow Query checks on SaaS02 and
yk-qfxt, three rows each, with a five-minute range and limit 3. Playwright was
1.61.1 / Chromium 149.0.7827.55, headful Xvfb, on the standard
`ubuntu-2404-devtools-pw2` template. The corrected SaaS02 flow waited for P81's
application redirect before entering Dashboard and submitting credentials.
These are bounded source experiments, not deployed-package or full-ticket proof.

The first experimental sandbox used the package-default restricted network and
hit the previously known nested P81 `INCONSISTENT_USER_AGENT` rejection. It was
excluded from this diagnosis. Valid experiments used the installation's
unrestricted outbound network posture with public inbound traffic disabled.
Both temporary sandboxes were deleted. Local Docker was unavailable; the user
explicitly authorized temporary E2B as the fallback for root-cause testing.

Evidence and the tested candidate are retained privately under
`~/.cache/auto-oncall-services/investigations/wetech-dashboard-navigation-20260907/`.
The candidate has no broad ERR_ABORTED swallowing or additional login retry.
The regression executes the production login loop and verifies delayed P81
redirect, a stalled connection's original deadline, ready-session reuse, and
explicit P81 rejection. Historical replay logs have the same failure signature
but lack CDP events, so the experiment does not prove every historical navigation
failure had this cause.

Status: source candidate, not deployed. The blocking criterion is successful
Dashboard acquisition through the P81 automatic redirect without a competing
Tool signin navigation. After release, verify the exact v42 installation with
one bounded Managed Tool canary. If full ticket verification is performed, use
`npm run replay:isolated` pinned to the Ready deployed image and export the exact
run before cleanup. Do not treat this transport repair as resolving missing
TopSQL comparison windows, target Digest selection, or ticket diagnosis.
