kshitijk4poor
bb3f5ed32a
fix: separate Anthropic OAuth tokens from API keys
Persist OAuth/setup tokens in ANTHROPIC_TOKEN instead of ANTHROPIC_API_KEY.
Reserve ANTHROPIC_API_KEY for regular Console API keys.
Changes:
- anthropic_adapter: reorder resolve_anthropic_token() priority —
ANTHROPIC_TOKEN first, ANTHROPIC_API_KEY as legacy fallback
- config: add save_anthropic_oauth_token() / save_anthropic_api_key() helpers
that clear the opposing slot to prevent priority conflicts
- config: show_config() prefers ANTHROPIC_TOKEN for display
- setup: OAuth login and pasted setup-tokens write to ANTHROPIC_TOKEN
- setup: API key entry writes to ANTHROPIC_API_KEY and clears ANTHROPIC_TOKEN
- main: same fixes in _run_anthropic_oauth_flow() and _model_flow_anthropic()
- main: _has_any_provider_configured() checks ANTHROPIC_TOKEN
- doctor: use _is_oauth_token() for correct auth method validation
- runtime_provider: updated error message
- run_agent: simplified client init to use resolve_anthropic_token()
- run_agent: updated 401 troubleshooting messages
- status: prefer ANTHROPIC_TOKEN in status display
- tests: updated priority test, added persistence helper tests
Cherry-picked from PR #1141 by kshitijk4poor, rebased onto current main
with unrelated changes (web_policy config, blocklist CLI) removed.
Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
2026-03-13 02:09:52 -07:00
..
2026-03-12 00:29:04 -07:00
2026-03-11 09:22:32 +01:00
2026-02-28 14:28:04 +03:00
2026-03-12 19:05:11 -07:00
2026-03-12 19:34:19 -07:00
2026-03-12 16:23:34 -04:00
2026-03-11 20:14:44 -07:00
2026-03-10 00:35:14 -07:00
2026-03-12 06:27:21 -07:00
2025-10-01 23:29:25 +00:00
2026-03-12 01:23:28 -07:00
2026-03-12 08:35:45 -07:00
2026-03-12 01:23:28 -07:00
2026-03-10 15:22:44 -07:00
2026-03-12 01:23:28 -07:00
2026-03-11 06:52:55 -07:00
2026-03-11 06:52:55 -07:00
2026-03-13 02:09:52 -07:00
2026-03-13 02:09:52 -07:00
2026-03-07 21:00:12 -05:00
2026-03-06 05:50:12 -08:00
2026-03-01 19:59:24 -08:00
2026-03-02 17:18:15 +11:00
2026-03-11 21:06:54 -07:00
2026-03-06 05:50:12 -08:00
2026-03-10 06:05:02 -07:00
2026-03-12 08:35:45 -07:00
2026-03-10 17:31:00 -07:00
2026-03-12 16:02:35 -07:00
2026-03-11 22:04:42 -07:00
2026-03-08 20:22:33 -07:00
2026-03-08 18:30:27 -07:00
2026-03-09 21:01:40 -07:00
2026-03-01 19:59:24 -08:00
2026-03-11 21:38:29 -07:00
2026-03-09 02:19:32 -07:00
2026-03-11 21:06:54 -07:00
2026-03-09 23:59:26 -07:00
2026-03-01 03:12:37 -05:00
2026-03-06 14:50:57 -08:00
2026-03-12 08:35:45 -07:00
2026-03-12 08:35:45 -07:00
2026-03-11 06:52:55 -07:00
2026-03-10 17:12:34 -07:00
2026-03-05 18:46:30 -08:00
2026-03-09 17:31:54 +03:00
2026-03-07 10:14:19 -08:00
2026-03-09 07:38:06 +03:00
2026-03-12 15:05:42 -04:00
2026-03-12 05:38:19 -07:00
2026-03-12 08:35:45 -07:00
2026-03-08 17:45:45 -07:00
2026-03-11 04:28:31 -07:00
2026-03-12 19:07:06 -07:00
2026-03-11 20:14:44 -07:00
2026-03-13 04:42:26 +03:00
2026-03-11 08:42:04 -07:00
2026-03-11 06:52:55 -07:00
2026-02-26 13:54:20 +03:00
2026-03-09 23:27:19 -07:00
2026-02-28 21:28:28 +03:00
2026-03-07 21:05:40 -08:00