hermes-agent/agent
Teknium b2e1a095f8
fix(anthropic): write scopes field to Claude Code credentials on token refresh (#4126)
Claude Code >=2.1.81 checks for a 'scopes' array containing 'user:inference'
in ~/.claude/.credentials.json before accepting stored OAuth tokens as valid.

When Hermes refreshes the token, it writes only accessToken, refreshToken, and
expiresAt — omitting the scopes field. This causes Claude Code to report
'loggedIn: false' and refuse to start, even though the token is valid.

This commit:
- Parses the 'scope' field from the OAuth refresh response
- Passes it to _write_claude_code_credentials() as a keyword argument
- Persists the scopes array in the claudeAiOauth credential store
- Preserves existing scopes when the refresh response omits the field

Tested against Claude Code v2.1.87 on Linux — auth status correctly reports
loggedIn: true and claude --print works after this fix.

Co-authored-by: Nick <git@flybynight.io>
2026-03-30 18:35:16 -07:00
..
__init__.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
anthropic_adapter.py fix(anthropic): write scopes field to Claude Code credentials on token refresh (#4126) 2026-03-30 18:35:16 -07:00
auxiliary_client.py fix: add INFO-level logging for auxiliary provider resolution (#3866) 2026-03-29 21:29:00 -07:00
context_compressor.py fix: cap percentage displays at 100% in stats, gateway, and memory tool (#3599) 2026-03-28 14:55:18 -07:00
context_references.py fix: add timeout to subprocess calls in context_references (#3469) 2026-03-27 17:51:14 -07:00
copilot_acp_client.py fix(acp): preserve leading whitespace in streaming chunks 2026-03-20 09:38:13 -07:00
display.py feat(display): configurable tool preview length -- show full paths by default (#3841) 2026-03-29 18:02:42 -07:00
insights.py chore: fix 154 f-strings, simplify getattr/URL patterns, remove dead code (#3119) 2026-03-25 19:47:58 -07:00
model_metadata.py fix(agent): support full context length resolution for direct Gemini API endpoints (#3876) 2026-03-29 21:56:07 -07:00
models_dev.py fix: write models.dev disk cache atomically (#3588) 2026-03-28 14:20:30 -07:00
prompt_builder.py feat(skills): support external skill directories via config (#3678) 2026-03-29 00:33:30 -07:00
prompt_caching.py fix(prompt-caching): skip top-level cache_control on role:tool for OpenRouter 2026-03-21 16:54:43 -07:00
redact.py fix(security): extend secret redaction to ElevenLabs, Tavily and Exa API keys (#3920) 2026-03-30 08:13:01 -07:00
skill_commands.py feat(skills): support external skill directories via config (#3678) 2026-03-29 00:33:30 -07:00
skill_utils.py feat(skills): support external skill directories via config (#3678) 2026-03-29 00:33:30 -07:00
smart_model_routing.py feat: integrate GitHub Copilot providers across Hermes 2026-03-17 23:40:22 -07:00
title_generator.py feat(agent): configurable timeouts for auxiliary LLM calls via config.yaml (#3597) 2026-03-28 14:35:28 -07:00
trajectory.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
usage_pricing.py fix: status bar shows 26K instead of 260K for token counts with trailing zeros (#3024) 2026-03-25 12:45:58 -07:00