Skip to content

Claude tab: 'could not verify authentication status' when user is on Max OAuth (apiKeySource="none") #2653

Description

@kevinhsykes

Environment

  • T3 Code v0.0.23 (winget) on Windows 11
  • Claude Code CLI 2.1.139 (claude --version)
  • Authentication: Max plan via OAuth (~/.claude/.credentials.json), no ANTHROPIC_API_KEY set in user/machine env
  • SessionStart hooks configured in ~/.claude/settings.json (cap-guard, ready-queue summary, workspace-root-guard)

Symptom

Opening the Claude tab and sending any prompt returns could not verify authentication status from initialization result. No assistant content rendered.

Likely root cause: misinterpreting apiKeySource: "none"

Running the same command t3code presumably spawns:

claude --print --output-format stream-json --verbose "say only pong"

…with ANTHROPIC_API_KEY unset (i.e. an OAuth/Max-plan setup) emits this init event:

{"type":"system","subtype":"init", ...,"apiKeySource":"none","claude_code_version":"2.1.139", ...}

apiKeySource: "none" is the expected value for OAuth/Max users — it means "no API key needed, OAuth is being used." Following events stream normally and the assistant returns the response cleanly:

{"type":"assistant","message":{...,"content":[{"type":"text","text":"pong"}], ...}}
{"type":"result","subtype":"success","is_error":false,"result":"pong", ...}

So Claude Code IS authenticated and DOES return content. T3code's init parser appears to treat apiKeySource: "none" as "no auth resolved" and throw before consuming subsequent events.

Contributing factor: SessionStart hook events come BEFORE the init event

If the user has SessionStart hooks configured, claude emits hook lifecycle events first:

{"type":"system","subtype":"hook_started","hook_name":"SessionStart:startup", ...}   x N
{"type":"system","subtype":"hook_response","hook_name":"SessionStart:startup", ...}  x N
{"type":"system","subtype":"init", ...,"apiKeySource":"none", ...}
{"type":"assistant", ...}

T3code may also be hitting a timeout or first-event mismatch on the hook events before reaching the init event.

What works (confirmed)

  • claude --print "say pong" returns pong cleanly from the same shell (with ANTHROPIC_API_KEY cleared)
  • Claude Code is fully authenticated; the credentials file is valid; the result stream event reports total_cost_usd > 0 (real billing under the Max plan)

Suggested fix

  1. In t3code's init-event parser, accept apiKeySource: "none" as valid auth (OAuth path)
  2. Skip type: "system", subtype: "hook_started" and hook_response events when scanning for the init event

Possibly related

Same renderer bucket as #2652 (OpenCode tab assistant messages save to opencode.db but don't render). v0.0.23 alpha may have multiple init/parser bugs across provider tabs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions