Repository navigation
[Bug]: Meta Muse device OAuth UI still presents callback-paste semantics and can show stale login hints #5881
Description
Area
Authentication / provider login UI
Summary
Meta Muse uses a device-code OAuth flow. After the user opens the Meta verification URL and approves the human-readable code, OpenCodex should keep polling and settle the login automatically.
The backend device flow already does that, but the shared add-provider OAuth UI still mixes device-code semantics with the manual redirect/callback paste fallback. In addition, later onAuth hint transitions from a long-running device flow are not reliably projected through the login-status surface, so the UI can remain on an older hint while the provider flow has moved on.
This makes a successful Meta approval look like OpenCodex is still waiting for a callback URL even though no callback paste is required for the device grant.
Verified against current main e70b3d86fb1201d7951dfeb25e09b7871c433047 (2.66.0): gui/src/components/login-url-block.tsx is device-code capable but the paste fallback is still rendered independently of that mode.
Reproduction
- Add/login to
meta-museusing OAuth from the dashboard. - Open the Meta device verification URL and enter the displayed Muse code.
- Approve the code on Meta.
- Return to OpenCodex.
The provider backend continues polling, but the UI can still present the redirect/callback paste affordance or stale instructions, implying that the operator must paste a callback.
Expected behavior
For a device-code login:
- show the human-readable device code, verification URL, and provider instructions;
- do not show the redirect/callback paste field while a
deviceCodeis active; - expose the current live login hint through the status endpoint so later
onAuthtransitions replace stale URL/code/instructions; - after approval, polling should settle the login automatically and persist the account with no manual callback input;
- cancellation should clear the transient hint.
Manual callback/code paste remains useful for authorization-code providers and should stay available there.
Suggested implementation shape
- Keep the latest auth hint in the login-flow state, not only the first hint returned by
startLoginFlow. - Include the current
url,deviceCode, andinstructionsingetLoginStatuswhile the flow is active. - Update the add-provider OAuth hook from the polled status hint.
- Gate the callback/paste component on the absence of
deviceCode.
Regression coverage
A deterministic public-surface test can pin:
- first
onAuthpublishes a device URL + device code; - a later
onAuthreplaces the live hint without restarting the flow; - no manual callback submission occurs;
- the flow settles
done=true / loggedIn=true; - the device-code UI hides callback paste while the device code is active.
A real Meta Muse smoke additionally confirms:
approval -> polling -> persisted account -> inference.
Checks
- I searched existing Meta Muse/device OAuth issues; I did not find an equivalent report.
- No device code, OAuth token, email, account ID, or private endpoint is included.
- The report separates backend polling (already present) from the UI/state projection bug.
Activity
fix(oauth): project the live device login hint through status
lidge-jun commentedon Sep 26, 2026
Fixed on
devby #5911, carried in bug-PR merge train batch 9D, #5986 (merge 6b2b66d). During a device-code grant the add-provider UI now hides the callback-paste control, and status polling replaces stale login hints with the current URL, instructions and device code. The paste control comes back for a later non-device flow. Closing; please reopen if a build that includes 6b2b66d still shows the paste field or an old code.