Description
In packages/opencode/src/session/llm.ts:172 the temperature is resolved as:
input.agent.temperature ?? ProviderTransform.temperature(input.model)
The built-in title agent hard-codes temperature: 0.5 (packages/opencode/src/agent/agent.ts:253), so ?? short-circuits and the agent default is used.
For model families that the provider strictly requires a specific temperature for (kimi-k2., glm-4.6/4.7, minimax-m2, gemini, qwen), ProviderTransform.temperature exists to encode that. Moonshot kimi-k2. returns HTTP 400 invalid temperature: only 1 is allowed for this model when 0.5 is sent.
Steps to reproduce
- Configure Moonshot kimi-k2.6 as the provider/model.
- Trigger a session that runs the title agent (any new session).
- Moonshot rejects the request:
400 invalid temperature: only 1 is allowed for this model.
Suggested fix
Swap the operands so the model-aware transform wins, with agent preference as fallback:
ProviderTransform.temperature(input.model) ?? input.agent.temperature
For models without a transform entry (claude, openai, etc.) the function returns undefined and the agent preference still applies via ??.
Description
In
packages/opencode/src/session/llm.ts:172the temperature is resolved as:The built-in
titleagent hard-codestemperature: 0.5(packages/opencode/src/agent/agent.ts:253), so??short-circuits and the agent default is used.For model families that the provider strictly requires a specific temperature for (kimi-k2., glm-4.6/4.7, minimax-m2, gemini, qwen),
ProviderTransform.temperatureexists to encode that. Moonshot kimi-k2. returnsHTTP 400 invalid temperature: only 1 is allowed for this modelwhen 0.5 is sent.Steps to reproduce
400 invalid temperature: only 1 is allowed for this model.Suggested fix
Swap the operands so the model-aware transform wins, with agent preference as fallback:
For models without a transform entry (claude, openai, etc.) the function returns
undefinedand the agent preference still applies via??.