Skip to content

fix(auxiliary): omit temperature for GPT-5 Responses - #63800

Open
AXEG0 wants to merge 2 commits into
NousResearch:mainfrom
AXEG0:fix/aux-gpt5-temperature
Open

fix(auxiliary): omit temperature for GPT-5 Responses#63800
AXEG0 wants to merge 2 commits into
NousResearch:mainfrom
AXEG0:fix/aux-gpt5-temperature

Conversation

@AXEG0

@AXEG0 AXEG0 commented Jul 13, 2026

Copy link
Copy Markdown

What does this PR do?

Makes auxiliary-request temperature handling route-aware for GPT-5 models.

When the resolved auxiliary route uses the Responses API (codex_responses), the request omits temperature, which that route rejects for affected GPT-5 models. Chat-completions routes—including custom providers and OpenRouter—continue to receive the caller's configured temperature. This keeps the fix aligned with the actual transport contract instead of applying a model-name-only rule.

Related Issue

N/A — no public issue is linked.

Related/overlapping work:

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • agent/auxiliary_client.py: carry the resolved API mode through sync, async, and retry request builders; omit GPT-5 temperature only for codex_responses; preserve existing Kimi and Arcee handling.
  • tests/agent/test_auxiliary_client.py: add route-specific builder and request coverage proving Responses requests omit temperature while chat-completions requests preserve it.

How to Test

  1. Run scripts/run_tests.sh tests/agent/test_auxiliary_client.py -q.
  2. Verify GPT-5 auxiliary requests resolved to codex_responses omit temperature.
  3. Verify the same model on chat_completions preserves the configured temperature.

Focused result: 178 passed.

Additional checks: ruff check ., git diff --check, and scripts/check-windows-footguns.py --all pass.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass (focused affected suite passes; the full GitHub Actions matrix is awaiting maintainer approval)
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A; no user-facing interface or behavior documentation changed
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A; no configuration keys changed
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A; no architecture or workflow changed
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — platform-independent Python change; Windows footgun check passes
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A; no tool schema changed

Screenshots / Logs

N/A — regression coverage and command results are listed above.

AI Assistance

OpenAI — GPT-5 via Codex CLI (implementation assistance, test execution, and PR-description drafting).

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API labels Jul 14, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused regression coverage. Two issues need resolution before this can be salvaged.

Problems

  • The added predicate matches gpt-5.4 (agent/auxiliary_client.py:408), but the unchanged test still expects that model to preserve temperature (tests/agent/test_auxiliary_client.py:3118-3132). The PR's test file therefore has conflicting expectations.
  • The predicate has no provider, endpoint, or API-mode check. Main explicitly keeps GPT-5 on chat completions for Nous and generic custom providers (run_agent.py:1429-1437), and this helper also feeds the main chat path (agent/chat_completion_helpers.py:946-952). Meanwhile the Codex auxiliary Responses adapter already omits temperature (agent/auxiliary_client.py:971-972). The change needs to distinguish the affected LiteLLM/Responses route from non-Responses GPT-5 routes.

Suggested changes

  • Reconcile the existing gpt-5.4 expectation with the intended contract.
  • Make the omission route-aware and add request-level coverage for both the affected route and a GPT-5 chat-completions route.

Automated hermes-sweeper review.

Comment thread agent/auxiliary_client.py Outdated
Comment thread tests/agent/test_auxiliary_client.py Outdated
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 16, 2026
@AXEG0

AXEG0 commented Jul 16, 2026

Copy link
Copy Markdown
Author

Addressed both review points in fee1f188a2.

  • agent/auxiliary_client.py:404-413: GPT-5 temperature omission is now gated on api_mode == "codex_responses"; chat-completions routes (Nous/custom) retain it. The resolved mode is threaded through sync, async, and retry request construction (:3437-3448, :6544-6548, :7147-7151). Codex adapter behavior remains unchanged (it independently omits temperature; :920-922).
  • tests/agent/test_auxiliary_client.py:3172-3235: reconciled GPT-5.4 expectations and added request-level assertions for Responses omission and chat-completions preservation, including Nous/custom routes.

Validation: pytest -q tests/agent/test_auxiliary_client.py — 309 passed (37.98s); targeted route tests — 12 passed; ruff check passed.

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

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants