Skip to content

fix(auxiliary): universal retry when any provider rejects temperature#15627

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-3a0db4b5
Apr 25, 2026
Merged

fix(auxiliary): universal retry when any provider rejects temperature#15627
teknium1 merged 2 commits into
mainfrom
hermes/hermes-3a0db4b5

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Auxiliary LLM calls now survive ''HTTP 400: Unsupported parameter: temperature'' from any provider, not just Codex Responses. Follow-up to #15620, which stripped temperature up front for ''codex_responses'' only — this PR closes the gap for every other provider/model combo via a reactive retry.

Why this isn't a provider-by-provider allowlist: the same backend can accept temperature for some models and reject it for others (gpt-5.4 accepts / gpt-5.5 rejects on the same OpenAI endpoint; similar patterns on Copilot reasoning models, OpenRouter reasoning routes, and Anthropic Opus 4.7+ via OAI-compat). React to the concrete error rather than maintain a list.

Changes

  • agent/auxiliary_client.py: add _is_unsupported_temperature_error helper; retry once without temperature when call_llm/async_call_llm see the marker error, before the existing max_tokens / payment / auth retry ladder.
  • tests/agent/test_unsupported_temperature_retry.py: 19 tests — detector phrasings across providers, sync + async retry, no-retry when temperature wasn't sent, unrelated 400s don't trigger a silent strip.
  • scripts/release.py: AUTHOR_MAP entry for ash@users.noreply.github.comash.

Validation

Before After
tests/agent/test_unsupported_temperature_retry.py N/A 19 passed
tests/agent/test_auxiliary_client.py + tests/run_agent/test_flush_memories_codex.py 104 passed 104 passed

Credit

Retry approach and detector originate from @BlueBirdBack's PR #15578 (authored by @ash). Commit authorship preserved; #15578 will be closed as superseded.

ash and others added 2 commits April 25, 2026 05:25
Universal reactive fix for 'HTTP 400: Unsupported parameter: temperature'
across all providers/models — not just Codex Responses.

The same backend can accept temperature for some models and reject it for
others (e.g. gpt-5.4 accepts but gpt-5.5 rejects on the same OpenAI
endpoint; similar patterns on Copilot, OpenRouter reasoning routes, and
Anthropic Opus 4.7+ via OAI-compat). An allow/deny-list by model name does
not scale.

call_llm / async_call_llm now detect the concrete 'unsupported parameter:
temperature' 400 and transparently retry once without temperature. Kimi's
server-managed omission and Opus 4.7+'s proactive strip stay in place —
this is the safety net for everything else.

Changes:
- agent/auxiliary_client.py: add _is_unsupported_temperature_error helper;
  wire into both sync and async call_llm paths before the existing
  max_tokens/payment/auth retry ladder
- tests/agent/test_unsupported_temperature_retry.py: 19 tests covering
  detector phrasings, sync + async retry, no-retry-without-temperature,
  and non-temperature 400s not triggering the retry

Builds on PR #15620 (codex_responses fallback) which stripped temperature
up front for that one api_mode. This PR closes the gap for every other
provider/model combo via reactive retry.

Credit: retry approach and detector originate from @BlueBirdBack's PR #15578.

Co-authored-by: BlueBirdBack <BlueBirdBack@users.noreply.github.com>
@teknium1 teknium1 merged commit b35d692 into main Apr 25, 2026
10 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-3a0db4b5 branch April 25, 2026 12:27
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Supersedes #15578, #15609, #15416, and #12523 — universal reactive retry covers all providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants