hermes - 💡(How to fix) Fix [Bug] opencode-go + kimi models: cannot specify both 'thinking' and 'reasoning_effort' (HTTP 400)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

BadRequestError [HTTP 400] Provider: opencode-go Model: kimi-k2.6 Endpoint: https://opencode.ai/zen/go/v1 Error: HTTP 400: Error from provider: cannot specify both 'thinking' and 'reasoning_effort'

Root Cause

In agent/transports/chat_completions.py, the build_kwargs() method has separate code paths that add reasoning_effort (top-level kwarg for Kimi/Moonshot models, per #21577) and thinking (for thinking-capable models when reasoning_effort is configured). These two paths are not mutually exclusive, so both parameters end up in the request.

The fix should ensure that when reasoning_effort is sent as a top-level kwarg for Kimi/Moonshot, the thinking parameter is not also added.

Fix Action

Workaround

Set reasoning_effort to empty in config and use the /reasoning slash command per-session for non-Kimi models:

agent:
  reasoning_effort: ''  # disable global default

Code Example

HTTP 400: Error from provider: cannot specify both 'thinking' and 'reasoning_effort'

---

model:
  default: kimi-k2.6
  provider: opencode-go
  base_url: https://opencode.ai/zen/go/v1
  api_mode: chat_completions

---

agent:
  reasoning_effort: medium

---

BadRequestError [HTTP 400]
Provider: opencode-go  Model: kimi-k2.6
Endpoint: https://opencode.ai/zen/go/v1
Error: HTTP 400: Error from provider: cannot specify both 'thinking' and 'reasoning_effort'

---

agent:
  reasoning_effort: ''  # disable global default
RAW_BUFFERClick to expand / collapse

Bug Description

When using a Kimi/Moonshot model (e.g. kimi-k2.6) through the opencode-go provider with agent.reasoning_effort set to a non-empty value, the API request includes both thinking and reasoning_effort parameters. The Moonshot API rejects this with:

HTTP 400: Error from provider: cannot specify both 'thinking' and 'reasoning_effort'

These two parameters are mutually exclusive on the provider side, but Hermes sends both simultaneously.

Steps to Reproduce

  1. Configure opencode-go as the provider with a Kimi model:
model:
  default: kimi-k2.6
  provider: opencode-go
  base_url: https://opencode.ai/zen/go/v1
  api_mode: chat_completions
  1. Set a global reasoning effort:
agent:
  reasoning_effort: medium
  1. Send any message to the agent.

  2. The API call fails immediately:

BadRequestError [HTTP 400]
Provider: opencode-go  Model: kimi-k2.6
Endpoint: https://opencode.ai/zen/go/v1
Error: HTTP 400: Error from provider: cannot specify both 'thinking' and 'reasoning_effort'

Expected Behavior

Hermes should send either thinking or reasoning_effort, never both. When reasoning_effort is set, Kimi/Moonshot models should receive it as a top-level reasoning_effort kwarg and the thinking parameter should be omitted, or vice versa.

Actual Behavior

Both thinking and reasoning_effort are included in the same request body, causing a non-retryable 400 error that aborts the session.

Root Cause

In agent/transports/chat_completions.py, the build_kwargs() method has separate code paths that add reasoning_effort (top-level kwarg for Kimi/Moonshot models, per #21577) and thinking (for thinking-capable models when reasoning_effort is configured). These two paths are not mutually exclusive, so both parameters end up in the request.

The fix should ensure that when reasoning_effort is sent as a top-level kwarg for Kimi/Moonshot, the thinking parameter is not also added.

Workaround

Set reasoning_effort to empty in config and use the /reasoning slash command per-session for non-Kimi models:

agent:
  reasoning_effort: ''  # disable global default

Environment

Related Issues

  • #21577 — Added top-level reasoning_effort support for Kimi/Moonshot and opencode-go (likely introduced or exposed this conflict)
  • #21256 — Feature request for per-model reasoning_effort defaults (would also help avoid this)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug] opencode-go + kimi models: cannot specify both 'thinking' and 'reasoning_effort' (HTTP 400)