Description
After updating to the latest main (commit 7e60b092), all Mattermost gateway bots fail with:
⚠️ API call failed (attempt 1/3): AttributeError
🔌 Provider: anthropic Model: claude-sonnet-4-6
🌐 Endpoint: https://api.anthropic.com
📝 Error: 'NoneType' object has no attribute 'get'
⏱️ Elapsed: 0.00s Context: 4 msgs, ~9,865 tokens
The error occurs before the HTTP request is sent (Elapsed: 0.00s), suggesting it happens during request construction in the Anthropic adapter or prompt builder.
Environment
- Platform: Mattermost gateway (Docker)
- Provider: Anthropic (direct, ANTHROPIC_API_KEY)
- Models: claude-sonnet-4-6, claude-opus-4-6
- Previous working version: v0.8.0 (commit
86960cdb)
- Broken since: latest main (
7e60b092)
Reproduction
- Configure Hermes with Mattermost gateway
- Set
model.default: claude-sonnet-4-6 and model.provider: anthropic
- Send any message to the bot via Mattermost
- Bot fails with the AttributeError above, falls back to fallback model
What works
- Direct Anthropic API calls from the same container (using
anthropic.Anthropic().messages.create()) work fine
_resolve_runtime_agent_kwargs() correctly resolves provider: anthropic, base_url: https://api.anthropic.com, api_mode: anthropic_messages
- Creating an
AIAgent manually with those resolved kwargs and calling run_conversation() works
- The issue only appears when the Mattermost gateway creates the agent
What doesn't work
- Any message via Mattermost gateway → AttributeError before API call
- Tested with completely clean
state.db (0 messages) — same error
- Tested with only 4 messages in context — same error
- All 4 bots (Kellu/Sonnet, Werken/Sonnet, Nometun/Opus, Dewun/Opus) affected
Workaround
Rolled back to pre-update commit (260dfec1, based on v0.8.0) which works correctly.
Config
model:
default: "claude-sonnet-4-6"
provider: "anthropic"
fallback_model:
provider: openrouter
model: meta-llama/llama-4-maverick
Description
After updating to the latest
main(commit7e60b092), all Mattermost gateway bots fail with:The error occurs before the HTTP request is sent (Elapsed: 0.00s), suggesting it happens during request construction in the Anthropic adapter or prompt builder.
Environment
86960cdb)7e60b092)Reproduction
model.default: claude-sonnet-4-6andmodel.provider: anthropicWhat works
anthropic.Anthropic().messages.create()) work fine_resolve_runtime_agent_kwargs()correctly resolvesprovider: anthropic,base_url: https://api.anthropic.com,api_mode: anthropic_messagesAIAgentmanually with those resolved kwargs and callingrun_conversation()worksWhat doesn't work
state.db(0 messages) — same errorWorkaround
Rolled back to pre-update commit (
260dfec1, based on v0.8.0) which works correctly.Config