Repository navigation
Description
Client or integration
OpenCodex dashboard
Area
Dashboard
Summary
Adding a Devin account via the dashboard's Add-provider login dialog fails with a misleading error after a normal, successful browser sign-in:
The dashboard target changed. Reopen this form on the current server.
(仪表板目标已更改。请在当前服务器上重新打开此表单。)
Nothing about the server target actually changed: a single standalone instance (ocx start --port 10100) served the dashboard for the whole session on a fixed port, with no Remote Link / hub-relay. What really happened is that the client-side login session had already been torn down by the time the token was pasted. The login never lands (auth.json gains no devin entry), and the message sends the user hunting for a server problem that does not exist.
Reproduction
- Dashboard → Providers → Add provider → Devin → Login. Browser opens
https://windsurf.com/windsurf/signin?...&prompt=login. - Complete the Cognition/Windsurf sign-in in the browser (a first-time login with 2FA / email verification easily takes more than 3 minutes).
- Copy the on-screen auth token, return to the still-open dashboard modal, paste it, click Submit.
- Observe the "dashboard target changed" error above.
Root cause (from source; v2.100.2 == dev on these files) — three unrelated failures share the single i18n key prov.targetChanged in gui/src/components/use-add-provider-oauth.ts (submitManualCode):
- Capture miss —
activeCapturesRef.current.get(providerId)returns nothing becauseloginOAuthalready dropped this provider's capture: the poll loop has a fixed budget ofloginPollAttempts(deviceFlow, OAUTH_LOGIN_POLL_INTERVAL_MS, 100)= 100 × 2 s ≈ 3 min 20 s for non-device flows (line 174). Devin's windsurf flow has no device code, so it always gets the short budget. When the budget lapses, the hook cancels the server-side flow (/api/oauth/login/cancel) and deletes the capture. isApiTargetCaptureCurrent(capture)re-validation failure (origin/apiBase/transport/generation changed).- Server 409
{ error: "target_changed" }— produced only bysrc/client/hub-relay.ts(hub-relay / link mode), i.e. impossible in standalone.
In a stable standalone setup, #2 and #3 cannot fire, so what users actually hit is #1. Two aggravating details:
gui/src/pages/use-providers-oauth.ts:213(the other login surface) already usesloginPollAttempts(deviceFlow, 2000, 150)— 5 minutes. The Add-provider modal still uses 100, so the two surfaces disagree.- When the poll loop exits through an
!isCurrent()guard,finallydeletes the capture but skips the UI cleanup (setOauthUrl("")runs only underisCurrent()), leaving the auth URL and the paste box rendered with no live flow behind them — a zombie form whose only symptom is the misleading message on submit.
Expected behavior:
- A capture-miss on submit should say the login session ended/expired and to start the login again — not that the dashboard target changed.
- The browser-login budget should be long enough for a real first-time provider sign-in (≥ the 150 attempts used by
use-providers-oauth.ts, or honor theexpiresAtthat/api/oauth/loginalready returns for code mode instead of a fixed attempt count). - If the capture is dropped while the modal is still visible, the modal should be reset (URL cleared / timeout notice shown) rather than left usable.
Suggested fix:
- Add a distinct key, e.g.
prov.loginFlowEnded: "This login session has ended — click Login again, then paste the token for the new session." (zh: 「该登录流程已结束或超时,请重新点击登录后再粘贴验证码。」) - Raise the Add-provider browser-flow budget to 150 (matching
use-providers-oauth.ts), or drive polling off the flow'sexpiresAt. - Reset the modal surface whenever the capture for a visible login is dropped.
Happy to verify a fix on my setup.
Version
@bitkyc08/[email protected] (npm)
Operating system
macOS (Darwin 25.6.0, arm64)
Provider and model
Devin (windsurf.com sign-in URL with redirect_uri=show-auth-token — URL + paste-token "code" flow, no device code)
Logs or error output
# Dashboard modal (manual-code message area):
仪表板目标已更改。请在当前服务器上重新打开此表单。
# English locale:
The dashboard target changed. Reopen this form on the current server.
# Server was stable and single-instance throughout:
# bun ... src/cli/index.ts start --port 10100 (one process, PID unchanged)
# Listening: 127.0.0.1:10100 (management), plus the proxy/shared planes; no restarts during the attempt.Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
github-actions commentedon Nov 13, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
[-][Bug] Add-provider OAuth code login (Devin/windsurf): expired login flow surfaces as "The dashboard target changed. Reopen this form on the current server."[/-][+][Bug]: Add-provider OAuth code login (Devin/windsurf) — expired login flow surfaces as "The dashboard target changed. Reopen this form on the current server."[/+]Ingwannu commentedon Nov 13, 2026
Confirmed against current dev
8f6d9b64e9by source inspection: Add-provider's non-device poll budget is still100×2s,finallydrops the capture, andsubmitManualCodemaps a missing capture toprov.targetChanged. A stable server can therefore reach that message after a flow ends; it is not evidence that the server actually changed. No real login token or account was used in this triage.A focused fix should keep the target-capture fence intact and distinguish ended/expired login from a genuine target-change/409. Reuse the existing timeout/cancellation handling where appropriate, reconcile the browser-flow lifetime with the API's explicit expiry/other login surface, and clear only the surface still owned by that login generation. A superseded old login must not clear a replacement, and an old code must never be posted to a newly selected server.
Please cover these with fake timers/transport fixtures: non-device expiry followed by code submit, slower successful login within its supported lifetime, real target change, replacement-login cleanup and device-flow behavior. This does not require sharing or reusing a live pasted token. The frontend flow/copy change still needs its focused implementation review; no live config/service or UI was changed here.
fix(gui): send an Accounts-row pasted code through the login that own…
fix(gui): clear an Accounts-row code when its login or target changes (…
fix(gui): reset the add-provider form when its target moves under the…
fix(gui): never let an old target login reset its replacement (#8618 …
fix: issue sweep 261115 (Qoder lazy MCP, ended OAuth paste, resolve o…