hermes-agent/agent
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 Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
anthropic_adapter.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
auxiliary_client.py merge: resolve conflicts with main (URL update to hermes-agent.nousresearch.com) 2026-03-12 17:49:26 -07:00
context_compressor.py chore: lower default compression threshold from 85% to 50% (#1096) 2026-03-12 15:51:50 -07:00
display.py Merge PR #736: feat(honcho): async writes, memory modes, session title integration, setup CLI 2026-03-12 19:05:11 -07:00
insights.py chore: add GLM/Kimi/MiniMax models to insights pricing (zero cost) 2026-03-06 19:12:14 -08:00
model_metadata.py fix(anthropic): live model fetching + adaptive thinking for 4.5+ models 2026-03-12 17:04:31 -07:00
prompt_builder.py Merge PR #785: feat: conditional skill activation based on tool availability 2026-03-11 08:43:30 -07:00
prompt_caching.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
redact.py Merge PR #713: docs: clarify Telegram token regex constraint 2026-03-10 16:59:54 -07:00
skill_commands.py feat: platform-conditional skill loading + Apple/macOS skills 2026-03-07 00:47:54 -08:00
trajectory.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00