Skip to content

app: setup says a dead OpenRouter key works #2022

Closed

Description

@AbirAbbas

What happens

On Windows with engine app/v3 12dadd64a, setup reports “Key works · 457 models available” and “Connected” for a credential whose first chat turn fails with HTTP 401, “User not found.”

Expected

Connect proves that OpenRouter accepts the credential before reporting success or saving it. Fetching a public model catalog is insufficient.

Repro

  1. Launch the desktop app with an isolated, unconfigured profile and this engine revision.
  2. Choose OpenRouter, enter a revoked credential, and press Connect.
  3. Continue setup, select a model, and send a short chat message.
  4. Compare setup's success with the turn's 401.

Evidence

Windows stability check, 2026-10-28, setup §1 and O2. At 12dadd64a, cmd/codeaf/appaccount.go:144 selects /models/user; :309 invokes appCheckKey; :471 sends GET with Authorization; :510 sets OK: true after parsing a 200 model list. A separate credential-free check using a deliberately invalid bearer value returned 200 with 457 models from both /models and /models/user, versus 401 from /key. No real credential was used for that check.

Since when

Pre-existing: /models/user selection is already present at 5c5e66c7f (2026-10-16), before the October 28 merges. The first affected release is unknown.

Likely cause / where to look

Engine-owned provider validation: appCheckKey treats a successful listing as authentication. The desktop forwards keys.check. Use an endpoint that actually rejects invalid credentials, then fetch models separately; cover invalid-credential/200-catalog behavior with a stub.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    93974f4
  2. added
    bug
    area:chat
    sev:serious
    on Nov 1, 2026
  3. added 3 commits that reference this issue on Nov 2, 2026
    87934c5
    7a0cd00
    d1b1a48
  4. AbirAbbas commented on Nov 2, 2026

    @AbirAbbas
    CollaboratorAuthor

    Fixed by #2040 (merged into app/v3 as d1b1a48): setup now proves OpenRouter accepts a key before it says the key works.

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

    area:chatbugsev:serious

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions