fix(providers): no per-model temperature guard — 'only 1 is allowed' errors
Bug Report
Description
Certain models (e.g. kimi-k2.6) only accept temperature: 1 (or no temperature param). The LLM provider layer sends whatever temperature the agent/user configured, causing 400 errors.
Sentry issues:
- OPENHUMAN-TAURI-HB — invalid temperature: only 1 is allowed for this model (146 events)
Combined impact: 146 events across users in China. Every agent turn using kimi-k2.6 via custom_openai fails — the model is completely broken for these users.
Error
{"error":{"message":"invalid temperature: only 1 is allowed for this model","type":"invalid_request_error"}}
- Platform: Windows x86_64 (10.0.26200)
- Model:
kimi-k2.6viacustom_openaiprovider - Version: [email protected]
- Environment: production
Root Cause Analysis
The LLM provider dispatch path sends a user/agent-configured temperature (typically 0.7 or similar) to upstream endpoints without checking model-specific constraints. Some models (Kimi K2.6, certain reasoning models) only accept temperature: 1 or reject the parameter entirely.
The routing layer (src/openhuman/inference/provider/router.rs) maps tier names to provider models but does not carry per-model parameter constraints (allowed temperature values, required param omissions).
Proposed Fix
- Add a per-model (or per-provider) parameter constraint map — models that restrict temperature get it clamped or omitted
- When a model rejects a parameter with a clear error like this, consider auto-retrying with the constraint applied
- Known models to handle:
kimi-k2.6(temp must be 1), reasoning models with similar constraints
Labels
sentry-traced-bug, os:windows, bug, priority: high, area: core