hermes-agent/hermes_cli
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
..
__init__.py chore: bump version to v0.2.0 + add curated first-release changelog 2026-03-12 01:52:53 -07:00
auth.py fix: Anthropic OAuth — beta header, token refresh, config contamination, reauthentication (#1132) 2026-03-12 20:45:50 -07:00
banner.py feat: add versioning infrastructure and release script 2026-03-12 01:35:47 -07:00
callbacks.py feat: add 'View full command' option to dangerous command approval (#887) 2026-03-12 06:27:21 -07:00
checklist.py fix: skip hanging tests + add global test timeout 2026-03-12 01:23:28 -07:00
claw.py feat: add 'hermes claw migrate' command + migration docs 2026-03-12 08:20:12 -07:00
clipboard.py fix: clean up empty file after failed wl-paste clipboard extraction 2026-03-11 02:56:19 -07:00
codex_models.py fix: unify visibility filter in codex model discovery 2026-03-10 15:15:33 +03:00
colors.py Cleanup time! 2026-02-20 23:23:32 -08:00
commands.py feat(cli): add /reasoning command for effort level and display toggle 2026-03-11 06:02:18 -07:00
config.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
cron.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
curses_ui.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
doctor.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
gateway.py feat: add email gateway platform (IMAP/SMTP) 2026-03-11 06:32:01 -07:00
main.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
models.py fix: Anthropic OAuth — beta header, token refresh, config contamination, reauthentication (#1132) 2026-03-12 20:45:50 -07:00
pairing.py Cleanup time! 2026-02-20 23:23:32 -08:00
runtime_provider.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
setup.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
skills_config.py fix: wire email platform into toolset mappings + add documentation 2026-03-11 06:34:32 -07:00
skills_hub.py chore(skills): clean up PR #862 — simplify manifest guard, DRY up tests 2026-03-12 08:08:22 -07:00
skin_engine.py fix: add themed hero art for all skins, fix triple-quote syntax 2026-03-10 03:54:12 -07:00
status.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
tools_config.py fix: wire email platform into toolset mappings + add documentation 2026-03-11 06:34:32 -07:00
uninstall.py Cleanup time! 2026-02-20 23:23:32 -08:00