Repository navigation
fix(agents): omit temperature on native isolated completions for models that reject it - #196641
Conversation
…ls that reject it
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesOmit 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherActivity 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests -1. Total +5 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 10, 2026, 6:39 AM ET / 11:39 UTC. |
|
Landed in 8fe5701. Thanks @Marvinthebored for the report. |
…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]>
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 exampleopenai/gpt-6-luna) fail with HTTP 400 every time when the utility model runs on the native Codex runtime. The recap passestemperature: 0.2, the request goes out with it, and OpenAI answersUnsupported 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.temperatureinto the Responses body as is (extensions/codex/src/app-server/inference-context.ts, theregistration.streamParamsblock). Codex itself never sends a temperature: itsResponsesApiRequesthas no such field (codex-rs/codex-api/src/common.rs,ResponsesApiRequest, checked at openai/codexce0323f2), 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
resolveIsolatedStreamParamsalready fits the isolated stream params to the prepared model (the output-token clamp). It now also dropstemperaturewhensupportsOpenAITemperature(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 main66f7455cabefand from this PReda90ca19d70, run in one secretlessnode:24.22.1Docker container with the real Codex app-server binary (@openai/codex0.164.0, linux-arm64). Theopenaiprovider keeps its officialhttps://api.openai.com/v1route with a synthetic API key, so routing matches the report. A local stand-in endpoint answersapi.openai.comthroughHTTPS_PROXYwith a proof-only CA. It returns the issue's exact HTTP 400 body when agpt-6-lunarequest containstemperature, and passes everything else to the stockscripts/e2e/mock-openai-server.mjs. Each run sends one chat turn onopenai/gpt-6-luna(Codex runtime), then triggers the Activity recap throughsessions.activitySummary.ensure.Recap request bodies seen by the endpoint (Codex request,
tool_choice: "none"):temperaturein bodymax_output_tokens0.2Unsupported parameter: 'temperature'…unavailable, deferred with that error)current, text returned0.2current0.2currentMain 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 withouttemperature.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
temperaturein either), and the turn completes on both.Regression: the
gpt-6-lunarow inisolated-completion.budget.test.ts(fits the answer budget to model capabilities) fails on main and passes here.isolated-completion.budget,isolated-completionand the Codexisolated-completion.api-boundarytests pass.