Skip to content

Title: [BUG] [alpha] Browser login wait screen: **c** copies the device URL before the code= query is present, yielding a useless link #53390

@glorysr1209-png

Description

@glorysr1209-png

Project

cortex

Description

During Waiting for browser authentication, the TUI prints the device flow URL and invites the user to press c to copy. The string copied is whatever the client has assembled so far. If the user presses c in the short window before the URL is extended with the code= (or equivalent) query segment, the clipboard holds only the bare path (e.g. host + /device with no code).

The screen still reads as if copying is the right next step, so users paste into the browser and land on a generic device page that does not complete the handshake. Recovery requires noticing the mistake, waiting for the full URL (or re-copying), or typing the code manually.

Root cause: Likely copy handler bound to a string that is updated asynchronously; no guard to disable copy or no merge of "minimum viable" URL before accepting c.

Error Message

Debug Logs

System Information

OS: Ubuntu 22.04.5 LTS (reported); issue is timing-dependent on any terminal
Component: Cortex CLI alpha (exact build not pinned in this note)

Screenshots

https://github.com/glorysr1209-png/check/blob/main/2026-04-15_14h53_30.png

Steps to Reproduce

  1. Start login and select the flow that ends on waiting for browser authentication with a device URL on screen.
  2. As soon as the base URL line appears, press c (before the line updates with the query string carrying the device code).
  3. Paste into the browser address bar and load.

Expected Behavior

At least one of:

  • c does nothing (or shows "wait") until the full URL with device code exists, then copies that string, or
  • c always copies a complete authorization URL (or copies the code separately with clear labeling), or
  • Inline warning if copy runs while the URL is still incomplete.

Actual Behavior

Early c copies an incomplete URL; user is not warned.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions