Skip to content

[Bug]: /gpt-account add renders the OpenAI Codex login-method select as an empty text input (Unknown OpenAI Codex login method:) #1485

Description

@code-yeongyu

What happened?

Reported in the Jobdori Hub Discord (2026-09-08; ihurag on Linux, reproduced by typeey on Linux) against OmO Native 5.0.0-0.beta.48 / senpi 2026.9.7-2:

  • /gpt-account add prints Select OpenAI Codex login method: but renders an empty text input instead of the two options.
  • Pressing Enter sends an empty string and the command fails with Error: Unknown OpenAI Codex login method:.
  • Typing device_code into the empty input starts the device flow, but the notice only shows the verification URL — the user code is never displayed, so the flow cannot be completed.
  • Typing browser shows the authorize URL as a plain wrapped notice and nothing opens the browser, although the provider's instruction says "A browser window should open".
  • In the same environment /loginOpenAI Codex correctly shows Browser login (default) / Device code login (headless).

Steps to reproduce

  1. senpi (or OmO Native beta.48) in a terminal.
  2. /gpt-account add + Enter.
  3. Observe the empty input under Select OpenAI Codex login method:; press Enter → Error: Unknown OpenAI Codex login method:.

Root cause

packages/coding-agent/src/core/extensions/builtin/gpt-account.ts (addAccount, lines 50-58) passes an AuthInteraction whose prompt relays every AuthPrompt to ctx.ui.input(prompt.message):

prompt: async (prompt) => {
    const answer = await ctx.ui.input(prompt.message);
    if (answer === undefined) throw new Error(LOGIN_CANCELLED_MESSAGE);
    return answer;
},
notify: (event) => ctx.ui.notify(authEventMessage(event), "info"),
  • prompt.type === "select" (the login-method chooser emitted by packages/ai/src/auth/oauth/openai-codex.ts:499-506) is shown as a text input; prompt.options are ignored, so the user cannot see or pick an option, and the empty answer reaches the provider's Unknown OpenAI Codex login method guard.
  • prompt.placeholder and the per-prompt prompt.signal are ignored, so the manual_code dialog is not dismissed when the local callback server wins the browser race.
  • authEventMessage drops userCode from device_code events and never opens the browser for auth_url.

The correct routing already exists for /login (core/auth-storage.ts:719-731onSelect; modes/rpc/login-prompts.ts) — the extension command simply does not use it. claude-sdk-oauth/account-command.ts addAccount has the same relay shape (its provider flow does not emit a select prompt today, but it shares the placeholder / signal / browser gaps).

Expected behavior (ideal end state)

  1. /gpt-account add shows the login-method chooser as a real selector (ctx.ui.select with the option labels, chosen label mapped back to the option id) — the same two choices as /login.
  2. text / secret / manual_code prompts go to ctx.ui.input(message, placeholder, { signal }), where the signal combines the command signal and the provider's per-prompt signal, so the manual-code dialog closes by itself once the callback server completes the login.
  3. device_code events display the verification URL and Enter code: <userCode>.
  4. auth_url events open the browser in the TUI (same as /login) and still print the URL as a fallback.
  5. The relay lives in one shared builtin helper used by both /gpt-account add and /claude-account add, with regression tests in test/suite/account-extension.test.ts.

Version

senpi 2026.9.7-2 (OmO Native 5.0.0-0.beta.48), reproduced on Linux and macOS.

Plan

Fix lands from branch fix/gpt-account-login-method-select; progress (RED tests, fix, real-TUI verification, PR) will be reported in comments on this issue.

Discord thread: https://discord.com/channels/1452487457085063218/1490539106797621259/1546781611930951741

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions