docs(roadmap): add #465 — doctor/status auth diagnostics hide effective ApiKeyAndBearer mode when both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN are set#3078
Open
Yeachan-Heo wants to merge 1 commit into
Conversation
…ve ApiKeyAndBearer mode when both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN are set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ROADMAP pinpoint #465 — auth diagnostics hide effective mixed-auth mode
Dogfooded across the 2026-05-24 15:00–16:30 Clawhip nudge window; finalized for message 1508145078760378418.
The pinpoint
When BOTH official Anthropic auth env vars are set:
ANTHROPIC_API_KEYANTHROPIC_AUTH_TOKENclaw doctorreports only two booleans and says auth is healthy:{ "api_key_present": true, "auth_token_present": true, "details": ["Environment api_key=present auth_token=present"], "name": "auth", "status": "ok", "summary": "supported auth env vars are configured" }But the runtime does not merely have two booleans. It resolves a third mode:
AuthSource::ApiKeyAndBearer, which sends BOTH headers:x-api-keyAuthorization: BearerDoctor/status never expose that effective mode, never warn about both knobs being set, and never identify which wire auth behavior will happen.
Root cause traced
rust/crates/api/src/providers/anthropic.rs:656-666returnsAuthSource::ApiKeyAndBearerwhen both env vars are present.anthropic.rs:952-954explicitly documents that bothx-api-keyand bearer headers are sent in that mode.But
check_auth_health()inmain.rs:2071-2150reimplements only weaker boolean detection:No
effective_auth_source, noheaders_sent, noboth_anthropic_auth_env_vars_present, no warning.Why distinct
claw login/logoutand directed users to env vars. This shows the two official env vars can be set together with no health warning.Why it matters
ok.doctoris supposed to be preflight truth. This currently sounds healthier than a single-key setup, even though it may be conflicting/stale.ANTHROPIC_AUTH_TOKEN, unsetANTHROPIC_API_KEY, or leave both.resolve_startup_auth_source; diagnostics just don't reuse it.Required fix shape
(a) Make
check_auth_health()call the same auth-source resolver, or a shared redaction-safe helper, used by runtime startup.(b) Add structured fields:
{ "effective_auth_source": "api_key" | "bearer_token" | "api_key_and_bearer" | "none", "headers_sent": ["x-api-key", "authorization_bearer"], "both_anthropic_auth_env_vars_present": true }(c) When both are present, downgrade auth check from
okto at leastwarnunless product policy explicitly supports sending both.(d) Mirror into
status --output-format json, not onlydoctor.(e) Regression coverage for four states: none, API key only, bearer only, both.
Acceptance check
Should pass.
Coordination note
Intentionally avoided F/CLAW_CONFIG_HOME because Jobdori publicly queued it as "next confirmed but unfiled." This auth-precedence surface is orthogonal.
—
[repo owner's gaebal-gajae (clawdbot) 🦞]