openclaw - 💡(How to fix) Fix /status shows "🔑 unknown" for working claude-cli runtime sessions [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#78632Fetched 2026-05-07 03:34:31
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

Root Cause

src/agents/model-auth-label.ts has a credential-file probe for the codex provider (lines 77 to 79):

if (providerKey === "codex" && readCodexCliCredentialsCached({ ttlMs: 5_000 })) {
  return "oauth (codex-cli)";
}

There is no analogous probe for claude-cli, even though the credential reader exists at src/agents/cli-credentials.ts:453 (readClaudeCliCredentialsCached) and is already used elsewhere (e.g. src/commands/doctor-claude-cli.ts:18).

When the agent's auth-profiles.json is absent, the resolver walks: profile store (empty), env api key (none), codex special case (provider not codex), custom api key (none), and falls through to "unknown".

Code Example

if (providerKey === "codex" && readCodexCliCredentialsCached({ ttlMs: 5_000 })) {
  return "oauth (codex-cli)";
}

---

if (providerKey === "claude-cli" && readClaudeCliCredentialsCached({ ttlMs: 5_000 })) {
  return "oauth (claude-cli)";
}
RAW_BUFFERClick to expand / collapse

Symptom

Agents using a claude-cli/<model> model id (or anthropic/<model> with agentRuntime: { id: "claude-cli" }) authenticate and run conversations correctly via OAuth, but /status reports the auth label as "unknown":

🧠 Model: claude-cli/claude-opus-4-7 · 🔑 unknown

This is purely a display issue, conversations work fine.

Repro

  1. Configure an agent with model: "claude-cli/claude-opus-4-7" and a working Claude CLI OAuth credential at ~/.claude/.credentials.json (the file the claude-cli runtime actually reads).
  2. Ensure the agent's agentDir does not contain an auth-profiles.json (a clean fresh install path, or after manual cleanup).
  3. Run /status against the agent.

Expected: 🔑 oauth (claude-cli) or similar, mirroring the codex-cli treatment. Actual: 🔑 unknown.

Root cause

src/agents/model-auth-label.ts has a credential-file probe for the codex provider (lines 77 to 79):

if (providerKey === "codex" && readCodexCliCredentialsCached({ ttlMs: 5_000 })) {
  return "oauth (codex-cli)";
}

There is no analogous probe for claude-cli, even though the credential reader exists at src/agents/cli-credentials.ts:453 (readClaudeCliCredentialsCached) and is already used elsewhere (e.g. src/commands/doctor-claude-cli.ts:18).

When the agent's auth-profiles.json is absent, the resolver walks: profile store (empty), env api key (none), codex special case (provider not codex), custom api key (none), and falls through to "unknown".

Suggested fix

Add a symmetric special case after the codex one:

if (providerKey === "claude-cli" && readClaudeCliCredentialsCached({ ttlMs: 5_000 })) {
  return "oauth (claude-cli)";
}

Functional behavior is unchanged; this only fixes the status display.

Environment

OpenClaw 2026.5.3 (Docker, openclaw-custom:2026.5.2 base).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix /status shows "🔑 unknown" for working claude-cli runtime sessions [1 comments, 2 participants]