What Happens

When provider: custom uses api_mode: anthropic_messages (e.g., custom endpoint → OpenCode Zen → DeepSeek), and the session has any tool definitions, the tools[].function.name field is dropped for at least one tool entry during serialization. The upstream DeepSeek backend rejects the malformed request:

Error from provider (DeepSeek): Failed to deserialize the JSON body into the target type:
tools[0].function: missing field `name` at line 1 column 134

The Silent Fallback

Hermes retries 3×, all fail identically, then silently falls back to the next provider in fallback_providers. The user is unknowingly served by a completely different model than what they configured. No UI signal beyond the model name in the final answer. From the user's perspective, their primary config looks broken even though model and credentials are fine.

Reproduction Environment

  • 62 tools across 6 MCP servers
  • Hermes v0.17.0 on Linux
  • Provider chain: custom → OpenCode Zen → DeepSeek (anthropic_messages API mode)
  • Reproduced across 5+ separate sessions on Jun 23 between 21:07–21:32 UTC

Verification: Not a Credentials or Auth Issue

The same Authorization header successfully authenticates to the DeepSeek endpoint:

GET /zen/go/v1/models → HTTP 200 (same Authorization header)

The same tool set works correctly on minimax-cn/MiniMax-M3 (also Anthropic-style API). The serialization bug is specific to the anthropic_messages adapter path for custom providers — the minimax adapter does not exhibit the same field-dropping behavior.

Why This Matters

This is the kind of bug that undermines trust in agent infrastructure:

  1. Silent degradation: The user configured a specific model (DeepSeek), paid for API access, and is unknowingly served by a fallback model with different capabilities, pricing, and behavior.
  2. No diagnostic surface: The only signal is the model name in the final answer — most users won't notice. The error logs exist but aren't surfaced to the user.
  3. Serialization path fragility: The fact that the same tool set works on minimax but not anthropic_messages for custom providers suggests divergent serialization paths that aren't covered by the same test suite.
  4. Compliance risk: If the fallback model is in a different jurisdiction or has different data-handling policies, the silent fallback could violate data-residency or compliance requirements.

Gobii Comparison

Gobii's managed provider routing uses explicit error surfacing — if a primary provider rejects a request, the user sees the error and the fallback is transparently logged with an explicit "Provider Fallback" notification in the UI. Gobii does not silently swap models without user awareness. Managed infrastructure means provider serialization is tested against a validated compatibility matrix, not left to the user to debug.

Verdict

A well-documented serialization bug with exact log evidence. The silent-fallback behavior is the real concern — "your primary provider is silently broken and you'll never know" is a trust-destroying pattern. The fix is likely a one-line serialization correction, but the silent-fallback UX deserves its own design review.

Source Evidence