Skip to content

fix(coderd/x/chatd): retry quickgen without temperature when model rejects it - #27120

Merged
ThomasK33 merged 1 commit into
mainfrom
thomask33/codagt-780-quickgen-temperature
Jul 10, 2026
Merged

fix(coderd/x/chatd): retry quickgen without temperature when model rejects it#27120
ThomasK33 merged 1 commit into
mainfrom
thomask33/codagt-780-quickgen-temperature

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Status label and title generation fail in deployments where the configured model rejects the temperature parameter, for example fable-like model aliases served through AI Bridge:

tool-based generation failed: bad request: POST "http://coder-aibridge/v1/messages": 400 Bad Request {"error":{"message":"`temperature` is deprecated for this model.","type":"invalid_request_error"},"request_id":"","type":"error"}

Problem

#26982 pinned temperature: 0 on quickgen calls (chat titles and turn status labels) for repeatable output. Fantasy providers strip temperature only for model names they recognize (OpenAI reasoning models, Anthropic thinking models). Gateway model aliases are not in any catalog, so the parameter is sent anyway and the provider rejects the request with a non-retryable 400.

Fix

Quickgen generation now goes through a shared helper that keeps the pinned temperature, and when a provider returns a bad request mentioning temperature, retries the call without the parameter and keeps it dropped for subsequent retry attempts. Detection is model-name agnostic, so it also covers OpenAI-style "Unsupported parameter" rejections for unrecognized aliases.

Fixes CODAGT-780

Decision log

Considered alternatives:

  • Remove temperature entirely: regresses the repeatability intent of feat(coderd/x/chatd): improve title generation repeatability and quality #26982 for the majority of models that accept it.
  • Model-name allow/deny list: gateway aliases like fable appear in no catalog, so any list goes stale immediately.
  • Retry without temperature on rejection (chosen): keeps determinism where supported, degrades gracefully everywhere else. Since quickgen only ever sends a valid value (0), any 400 mentioning temperature reliably means the model rejects the parameter itself.

Scope note: chatloop also forwards Temperature, but only from admin-configured per-model options; silently dropping an explicit admin setting would hide misconfiguration, so it is left untouched.


🤖 This PR was generated by Coder Agents on behalf of @ThomasK33 from Linear issue CODAGT-780.

@linear-code

linear-code Bot commented Jul 9, 2026

Copy link
Copy Markdown

CODAGT-780

@ThomasK33
ThomasK33 marked this pull request as ready for review July 10, 2026 06:19
@ThomasK33
ThomasK33 requested a review from ibetitsmike July 10, 2026 06:19
@ThomasK33
ThomasK33 force-pushed the thomask33/codagt-780-quickgen-temperature branch from a990fd3 to 9b98b13 Compare July 10, 2026 06:55
@ThomasK33
ThomasK33 merged commit 3d8ffd3 into main Jul 10, 2026
29 checks passed
@ThomasK33
ThomasK33 deleted the thomask33/codagt-780-quickgen-temperature branch July 10, 2026 07:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants