Skip to content

feat(harness): Keep auth method kind so agent-type login can be a button #1000

Closed

Description

@omesser

Why

Spun out of #991 / #993. That fix ships the terminal login hint and a disabled composer when auth is refused mid-session. It deliberately does not add an in-app login button.

For claude (the Harness in #991), a button is impossible today: it advertises no initialize.authMethods, so there is nothing to call session/authenticate with. Login is claude /login in a terminal.

Other Harnesses do advertise methods. A button is only honest for ACP agent-type methods (client sends authenticate). terminal-type methods mean re-running the agent in an interactive terminal, which ADR-0018 forbids (ai-buddy hosts no terminal and does not set clientCapabilities.auth.terminal).

Where it is stuck

auth_hint in src-tauri/src/acp_wire.rs flattens AuthMethod::Terminal and AuthMethod::Agent into one AuthHint { name, description } with no kind. The app cannot tell which advertised methods are button-able.

Measured on 2026-09-24 (one probe attach per Harness):

Harness authMethods
claude none
codex API Key, ChatGPT
cursor-agent Cursor Login
opencode Login with opencode
goose Configure Provider
hermes custom runtime credentials, Configure Hermes provider
grok xai.api_key, cached_token, Grok
pi Launch pi in the terminal

Known limits recorded 2026-09-14 during #654 / #661 and not re-verified when filing this: claude-code-acp throws not-implemented on authenticate, and opencode no-ops. On that reading a button would help Codex and maybe cursor-agent first.

Done when

  • AuthHint (or equivalent) keeps the ACP method kind (agent vs terminal), not only name/description.
  • The Chat / connect surface can offer an in-app login action only for agent-type methods.
  • terminal-type methods stay hint-only (name the external login), never a fake button.
  • Harnesses with empty authMethods (e.g. claude) stay on the fix(harness): Expired OAuth mid-session dumps a raw internal error into chat #991 hint path; no button appears.
  • A test pins that kind is preserved through the handshake → surface path.

Out of scope

Replacing the #991 mid-session refuse/re-enable path. That already landed on main via #993.

— Cursor agent (Coder), on @omesser's behalf.

Activity

  1. added
    enhancementNew feature or request
    needs-triageMaintainer needs to evaluate this issue
    p2Eventually: real, but nothing waits on it
    on Sep 25, 2026
  2. added this to the V1 milestone on Sep 25, 2026
  3. omesser commented on Sep 25, 2026

    @omesser
    OwnerAuthor

    One measurement to add, from a probe attach per installed Harness on 2026-09-25, reading what each advertises in initialize.authMethods:

    Harness authMethods
    claude none
    codex API Key, ChatGPT
    cursor-agent Cursor Login
    opencode Login with opencode
    goose Configure Provider
    hermes custom runtime credentials, Configure Hermes provider
    grok xai.api_key, cached_token, Grok
    pi Launch pi in the terminal

    Seven of eight advertise something, so the kind this issue is about decides seven rows, not a corner case. None of them can be classified from what the app holds today, which is the point.

    pi's reads as terminal from its name alone. The rest are unknowable from here.

    — Claude Code agent, on @omesser's behalf.

  4. omesser commented on Sep 27, 2026

    @omesser
    OwnerAuthor

    Shipped on main via #1054 (merge 93206f34).

    What landed

    • Handshake keeps agent-method ids on the offer and drops terminal method id/args/env (AuthOffer).
    • Needs-login Chat landing shows a button only for agent methods ("Login using:"), then the terminal command; empty methods / terminal-only stay command-only ("Run this in a terminal:").
    • Button calls authenticate then a fresh session/new; Ok that changes nothing leaves the landing up. Settings/header stay a sentence.
    • Covered by a_login_opening_carries_agent_sign_in_and_omits_it_otherwise, a_sign_in_clears_the_landing_only_when_the_next_session_opens, and tests/chat-connect.test.js.

    Leftovers stay elsewhere: Codex API Key button needs #1061.

    Acceptance on this issue is met; GitHub already closed it as completed when the PR merged.

    — Cursor agent (Coder), on @omesser's behalf.

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

    enhancementNew feature or requestharnessneeds-triageMaintainer needs to evaluate this issuep2Eventually: real, but nothing waits on it

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions