hermes-agent/tests/agent
briandevans cc5b9fb581 fix(transport): omit thinking_config for Gemma on the gemini provider (#17426)
The `gemini` provider also serves Gemma (e.g. `gemma-4-31b-it`) and
historically other Google models like PaLM. Those reject
`extra_body.thinking_config` with HTTP 400:

    Unknown name "thinking_config": Cannot find field

`_build_gemini_thinking_config()` was unconditionally producing a
config dict for any model on the `gemini` / `google-gemini-cli`
provider, which `ChatCompletionsTransport.build_kwargs` then dropped
into `extra_body["thinking_config"]`. The result: every chat turn for
Gemma users on the gemini provider blew up at the API edge.

The fix is the same shape Hermes already uses for the Gemini-2.5 vs
Gemini-3 family clamping: normalise the model id, strip an
`OpenRouter`-style `google/` prefix, and short-circuit early when the
result doesn't start with `gemini`. We return `None` rather than
`{"includeThoughts": False}`, because the API rejects the field name
itself — even the polite "off" form trips the same 400.

Three regression tests cover Gemma with reasoning enabled, Gemma with
reasoning disabled, and the `google/gemma-…` OpenRouter-style id; the
existing Gemini-2.5 / Gemini-3 / `google/gemini-…` cases keep passing
because the Gemini guard fires after the prefix strip.

Fixes #17426

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 04:29:04 -07:00
..
transports fix(transport): omit thinking_config for Gemma on the gemini provider (#17426) 2026-04-30 04:29:04 -07:00
__init__.py
…
test_anthropic_adapter.py fix(anthropic): reactive recovery for OAuth 1M-context beta rejection (#17752) 2026-04-29 21:56:54 -07:00
test_anthropic_keychain.py
…
test_auxiliary_client.py fix(aux): remove hardcoded Codex fallback model, drop Codex from auto chain (#17765) 2026-04-29 23:23:50 -07:00
test_auxiliary_client_anthropic_custom.py
…
test_auxiliary_config_bridge.py
…
test_auxiliary_main_first.py
…
test_auxiliary_named_custom_providers.py
…
test_auxiliary_transport_autodetect.py
…
test_bedrock_1m_context.py
…
test_bedrock_adapter.py
…
test_bedrock_integration.py
…
test_codex_cloudflare_headers.py fix(aux): remove hardcoded Codex fallback model, drop Codex from auto chain (#17765) 2026-04-29 23:23:50 -07:00
test_compress_focus.py
…
test_compressor_image_tokens.py
…
test_context_compressor.py
…
test_context_engine.py
…
test_context_references.py
…
test_copilot_acp_client.py fix(ci): recover 38 failing tests on main (#17642) 2026-04-29 20:05:32 -07:00
test_credential_pool.py
…
test_credential_pool_routing.py
…
test_crossloop_client_cache.py
…
test_curator.py fix(curator): unify under auxiliary.curator (hermes model, dashboard) (#17868) 2026-04-30 02:46:01 -07:00
test_curator_reports.py
…
test_deepseek_anthropic_thinking.py test(anthropic): regression guard for DeepSeek /anthropic thinking replay 2026-04-29 08:10:29 -07:00
test_direct_provider_url_detection.py
…
test_display.py
…
test_display_emoji.py
…
test_error_classifier.py fix(anthropic): reactive recovery for OAuth 1M-context beta rejection (#17752) 2026-04-29 21:56:54 -07:00
test_external_skills.py
…
test_gemini_cloudcode.py
…
test_gemini_free_tier_gate.py
…
test_gemini_native_adapter.py
…
test_gemini_schema.py
…
test_image_gen_registry.py
…
test_image_routing.py
…
test_insights.py
…
test_kimi_coding_anthropic_thinking.py
…
test_local_stream_timeout.py
…
test_memory_provider.py
…
test_memory_session_switch.py fix(hindsight): route flush-on-switch through writer queue, not raw thread 2026-04-29 08:09:03 -07:00
test_memory_user_id.py
…
test_minimax_auxiliary_url.py
…
test_minimax_provider.py fix(ci): stabilize main test suite regressions (#17660) 2026-04-29 23:18:55 -07:00
test_model_metadata.py
…
test_model_metadata_local_ctx.py
…
test_model_metadata_ssl.py
…
test_models_dev.py
…
test_moonshot_schema.py
…
test_nous_rate_guard.py
…
test_onboarding.py docs(onboarding): lead OpenClaw residue banner with migrate, warn that cleanup breaks OpenClaw (#17507) 2026-04-29 08:08:36 -07:00
test_prompt_builder.py
…
test_prompt_caching.py
…
test_proxy_and_url_validation.py
…
test_rate_limit_tracker.py
…
test_redact.py
…
test_shell_hooks.py
…
test_shell_hooks_consent.py
…
test_skill_commands.py
…
test_skill_commands_reload.py refactor(reload-skills): queue note for next turn, drop cache invalidation + agent tool 2026-04-29 21:07:47 -07:00
test_streaming_context_scrubber.py
…
test_subagent_progress.py
…
test_subagent_stop_hook.py
…
test_subdirectory_hints.py
…
test_title_generator.py
…
test_unsupported_parameter_retry.py
…
test_unsupported_temperature_retry.py
…
test_usage_pricing.py
…
test_vision_resolved_args.py
…