Skip to content

fix(agents): omit temperature on native isolated completions for models that reject it - #196641

Merged
obviyus merged 1 commit into
mainfrom
fix/codex-isolated-temperature
Nov 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/codex-isolated-temperature

Conversation

@obviyus

@obviyus obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #196617. Thanks @Marvinthebored for the detailed report and the side-by-side API check.

Problem

Activity recaps on a model that rejects temperature (for example openai/gpt-6-luna) fail with HTTP 400 every time when the utility model runs on the native Codex runtime. The recap passes temperature: 0.2, the request goes out with it, and OpenAI answers Unsupported parameter: 'temperature' is not supported with this model.

Root cause

Since #177227, isolated completions on the Codex harness go through the Codex app-server. The Codex extension's inference relay copies streamParams.temperature into the Responses body as is (extensions/codex/src/app-server/inference-context.ts, the registration.streamParams block). Codex itself never sends a temperature: its ResponsesApiRequest has no such field (codex-rs/codex-api/src/common.rs, ResponsesApiRequest, checked at openai/codex ce0323f2), so the value comes only from OpenClaw.

The normal OpenAI transports skip temperature when supportsOpenAITemperature(model) is false (openai-responses-shared.ts, openai-responses-params-internal.ts, openai-chatgpt-responses-request.ts). The native harness handoff did not apply that check.

Fix

resolveIsolatedStreamParams already fits the isolated stream params to the prepared model (the output-token clamp). It now also drops temperature when supportsOpenAITemperature(model) says the model rejects it. The check is the same one the transports use. Models that accept temperature keep it. No new config or wording.

Evidence

Built Gateway (dist/entry.js) from main 66f7455cabef and from this PR eda90ca19d70, run in one secretless node:24.22.1 Docker container with the real Codex app-server binary (@openai/codex 0.164.0, linux-arm64). The openai provider keeps its official https://api.openai.com/v1 route with a synthetic API key, so routing matches the report. A local stand-in endpoint answers api.openai.com through HTTPS_PROXY with a proof-only CA. It returns the issue's exact HTTP 400 body when a gpt-6-luna request contains temperature, and passes everything else to the stock scripts/e2e/mock-openai-server.mjs. Each run sends one chat turn on openai/gpt-6-luna (Codex runtime), then triggers the Activity recap through sessions.activitySummary.ensure.

Recap request bodies seen by the endpoint (Codex request, tool_choice: "none"):

Run Utility model temperature in body max_output_tokens Endpoint Recap
main gpt-6-luna 0.2 240 400 Unsupported parameter: 'temperature'… failed (unavailable, deferred with that error)
this PR gpt-6-luna absent 240 200 current, text returned
main (control) gpt-5.5 0.2 240 200 current
this PR (control) gpt-5.5 0.2 240 200 current

Main body keys for the recap: client_metadata, include, input, max_output_tokens, model, parallel_tool_calls, prompt_cache_key, reasoning, store, stream, temperature, text, tool_choice, tools. With this PR, the same set without temperature.

Ordinary chat turns are unchanged: the chat-turn Responses bodies from main and this PR are identical apart from per-run ids and timestamps (no temperature in either), and the turn completes on both.

Regression: the gpt-6-luna row in isolated-completion.budget.test.ts (fits the answer budget to model capabilities) fails on main and passes here. isolated-completion.budget, isolated-completion and the Codex isolated-completion.api-boundary tests pass.

@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: eda90ca19d701bea944950e0826c47136029f2c3
  • Maintainer: @obviyus
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/isolated-completion-model-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@obviyus

obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Omit unsupported temperature values before dispatching isolated completions to the selected runtime.

Example: An Activity recap uses openai/gpt-6-luna with temperature 0.2 and a 240-token budget.

  • Before: The native request includes temperature and receives HTTP 400.
  • After: The request omits temperature, preserves the token budget, and returns the recap.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with supplied shipped-entry-point before/after evidence, useful regression coverage, and no identified defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied trace exercises built Gateway sessions.activitySummary.ensure through the real Codex 0.164.0 process in secretless Docker against a fault-injecting HTTPS endpoint: base sends temperature and fails, head omits it and returns a recap, and supported-model controls retain it; provider responses are synthetic.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Activity recaps fail or unnecessarily fall back when the selected native utility model rejects temperature.
Reason: The maintainer-authored direction restores established model compatibility without adding configuration or changing authentication policy.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a verified native-completion failure with a focused change; no actionable defects were found.

Priority: P2
Reviewed head: eda90ca19d701bea944950e0826c47136029f2c3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Activity recaps and other utility callers pass sampling settings through the shared isolated-completion owner to the selected harness, which constructs the provider request.

flowchart LR
  A[Activity recap] --> B[Utility completion]
  B --> C[Prepared model]
  C --> D[Isolated stream parameters]
  D --> E[Codex native harness]
  E --> F[Responses request]
  F --> G[Recap result]
Loading

Technical review

Best possible solution:

Apply the existing model-capability policy at the shared isolated-completion boundary while preserving supported sampling settings and token limits.

Do we have a high-confidence way to reproduce the issue?

Source establishes the complete failing path, and the reporter supplies matching provider traces; this read-only review did not independently execute the reproduction.

Is this the best way to solve the issue?

The patch restores the existing transport contract at the shared producer, with no unnecessary machinery or unrelated behavior changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ac21026addd.

Provenance checked

  • Isolated stream-parameter preparation keeps the original intent (75499a8: Moved existing stream-budget preparation into the model-authority owner while consolidating deadline ownership.)
  • Native sampling forwarding changes intended behavior with a stated reason (feat(codex): execute isolated completions through native runtime #177227: Preserve caller token and sampling settings through the native inference relay.)
  • Utility answer-budget regression coverage keeps the original intent (2a64309: Reserve reasoning capacity while retaining explicit limits and model output caps.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 75499a8 adds src/agents/isolated-completion-model-authority.ts:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 75499a8cad84; files: src/agents/isolated-completion-model-authority.ts)

PR surface

Source +6, Tests -1. Total +5 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 10 4 +6
Tests 1 10 11 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 15 +5

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Unsupported parameters repeatedly fail background recaps or force unnecessary fallback while ordinary chat remains usable.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Unsupported parameters repeatedly fail background recaps or force unnecessary fallback while ordinary chat remains usable.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 10, 2026, 6:39 AM ET / 11:39 UTC.

@obviyus
obviyus merged commit 8fe5701 into main Nov 10, 2026
127 checks passed
@obviyus
obviyus deleted the fix/codex-isolated-temperature branch November 10, 2026 11:43
@obviyus

obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 8fe5701. Thanks @Marvinthebored for the report.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…ls that reject it (openclaw#196641)

fix(agents): drop temperature for models that reject it in isolated completions

Since openclaw#177227, isolated completions such as Activity recaps run through the Codex app-server, and the Codex relay copies streamParams.temperature into the Responses body. Codex itself never sends temperature (ResponsesApiRequest in codex-rs/codex-api/src/common.rs:279 at ce0323f2 has no such field), so the value comes only from OpenClaw. The normal OpenAI transports skip temperature when supportsOpenAITemperature(model) is false, but the isolated path never ran that check, so recaps on models such as gpt-6-luna failed with HTTP 400 "Unsupported parameter: 'temperature'". resolveIsolatedStreamParams, which already adapts these params to the prepared model, now also drops temperature when that existing check says the model rejects it. No config or wording is new.

Evidence: main and this change built in secretless node:24.22.1 Docker with the real Codex app-server (@openai/codex 0.164.0), the provider on the official api.openai.com route with a synthetic key, and a local stand-in endpoint returning the issue's exact 400 when a gpt-6-luna request carried temperature. Each run sent a chat turn and then requested the recap through sessions.activitySummary.ensure. On main the gpt-6-luna recap sent temperature 0.2 and failed; with this change it sent no temperature and succeeded. A gpt-5.5 control sent temperature 0.2 and succeeded on both, and the Codex chat-turn bodies are identical on both. Details: openclaw#196641.

Closes openclaw#196617. Thanks @Marvinthebored for the report.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. security-sensitive-changed size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex isolated completions send temperature to models that reject it, so Activity recaps 400 on gpt-6-luna

1 participant