Skip to content

model-benchmark: claude adapter available() reports "No Claude auth found" for macOS subscription installs (claude -p works) #1890

@chrono-meta

Description

@chrono-meta

Observed problem

test/helpers/providers/claude.ts ClaudeAdapter.available() treats Claude auth as present only when ~/.claude/.credentials.json exists or ANTHROPIC_API_KEY is set:

const credsPath = path.join(os.homedir(), '.claude', '.credentials.json');
const hasCreds = fs.existsSync(credsPath);
const hasKey = !!process.env.ANTHROPIC_API_KEY;
if (!hasCreds && !hasKey) {
  return { ok: false, reason: 'No Claude auth found. Log in via `claude` interactive session, or export ANTHROPIC_API_KEY.' };
}

On a macOS subscription install (the default Claude Code install on Mac), ~/.claude/.credentials.json is absent — the credential lives elsewhere (likely the Keychain) — yet the subscription session authenticates claude -p fine. So the file-existence check is a proxy that misses a valid auth state, and the adapter reports NOT READY for a provider whose run() path (claude -p --output-format json) would actually succeed.

This is internal to the adapter: run() uses the subscription via claude -p, so available() rejecting that same auth state is an inconsistency, not a user-config gap. (ANTHROPIC_API_KEY is a workaround, but macOS subscription users have no key and don't need one for claude -p.)

Current behavior on main (cab774c)

$ gstack-model-benchmark --dry-run --prompt "hi"
  claude: NOT READY — No Claude auth found. Log in via `claude` interactive session, or export ANTHROPIC_API_KEY.

On the same machine:

  • ~/.claude/.credentials.json — absent
  • claude CLI — resolves (claude --version → 2.1.x), logged in via subscription; claude -p works
  • available() returns {ok:false} purely on the missing file

Any code path gated on this available() (model-benchmark, and the LLM-judge path) silently drops the claude provider for this population.

Expected behavior

A logged-in macOS subscription install (no ANTHROPIC_API_KEY, no .credentials.json, but claude -p working) should report the claude adapter as available.

Possible fix

run() already classifies runtime auth failures gracefully (/unauthorized|auth|login/iauth). So available() could be optimistic when resolveClaudeCommand() resolves on macOS (defer the real auth decision to run()), or detect the Keychain credential — whichever you prefer.

Duplicate search performed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions