Bug reportCompleted

Add account → OpenCode stuck on 'Waiting for login…' after CLI says Connected to OpenCode (1.90.0)

Khang NguyenPosted Shipped in 1.91.1

Bug Details

What happens

Accounts & Quota → Add account → OpenCode → Sign in. The login terminal runs opencode auth login; choose OpenCode → API key (service account), paste the key. The CLI prints Connected to OpenCode and Done, then returns to the prompt. The sheet stays on step 2 Waiting for login… indefinitely — the spinner never stops, step 3 (Name) never opens, and only Cancel works.

Expected

The account saves as soon as the CLI reports success, then step 3 (Name) appears.

Root cause (1.90.0 app.asar)

  • aiAccounts/paths.js resolves OpenCode auth as ~/.local/share/opencode/auth.json.
  • captureLiveAuth('opencode') in aiAccounts/index.js reads only that file and returns null when it is missing.
  • runtime.js only finalizes a non-Claude login when getLiveAuthDigest() changes from the baseline. With a null digest it never finalizes, so the UI waits until Cancel or the 30-minute cap.
  • The bundled OpenCode CLI 2.4.2 stores credentials in ~/.local/share/opencode/opencode.db, table credential (rows with integration_id = 'opencode'), and writes no auth.json. On this Mac auth.json is absent; the active credential row (label OpenCode 2) was created at the login time.
  • shared/loginTerminalOutput.js only treats the literal Login successful as success (Claude); OpenCode prints Connected to OpenCode / Done.

Suggested fix

  • Read OpenCode credentials from opencode.db (credential where integration_id='opencode' and active=1) or support both stores, chosen by CLI version.
  • Add OpenCode's success strings to the login-output parser, or finalize on the DB write directly.
  • If neither store changes, show a timeout/error instead of an endless spinner.

Environment

1DevTool 1.90.0, macOS 26.5.2, Apple Silicon. OpenCode CLI 2.4.2 (bundled). No secrets included.

Reproducibility: Unknown · Impact: Minor issue

Environment

VERSION
unknown
OS
—
ARCH
—
CHANNEL
—

Resolution progress

SHIPPED · 1.91.1
  1. PENDING

  2. REVIEWING

    —

  3. IN PROGRESS

  4. COMPLETED

  • — Khang Nguyen submitted this request
  • — Khoa - StoicSoft Team moved it to In progress
  • — Khoa - StoicSoft Team moved it to Completed “Fixed in 1DevTool 1.91.1: logins made with OpenCode 2.x are now detected, so Add account moves on to naming the account as soon as the CLI says it is connected. Switching to a saved OpenCode account now also changes the account OpenCode itself uses. Update from the app menu to get it.”

Discussion0

Newest first
  • No comments yet. Add context or ask a question below.

Sign in to comment, vote and follow this request.

Sign in to reply