zeroclaw-labs/zeroclaw · error · anyhow::Error
temperature unsupported by Grok CLI model provider
Error message
temperature unsupported by Grok CLI model provider: {temperature}. Supported values: 0.7 or 1.0 (not forwarded; CLI has no sampling flag) What it means
The Grok CLI exposes no sampling flag, so the provider accepts only 0.7 and 1.0 (compared with TEMP_EPSILON) as validated no-ops and rejects every other finite value so silent divergence cannot go unnoticed. The message records the offending value. Validation runs per request, before the CLI is spawned.
Solutions
- Set temperature to 0.7 or 1.0, or omit it (None falls back to the provider default)
- Remove per-agent temperature overrides when the agent moves to grok_cli
- If you need real sampling control, use an API-based provider (e.g. xAI or an OpenAI-compatible endpoint) instead of the local CLI wrapper
Example fix
# before [agents.coder] temperature = 0.3 # after [agents.coder] temperature = 0.7
Defensive patterns
Strategy: validation
Validate before calling
fn grok_temperature_ok(t: Option<f64>) -> bool {
t.map(|v| (v - 0.7).abs() < 1e-9 || (v - 1.0).abs() < 1e-9).unwrap_or(true)
} Type guard
fn is_supported_grok_temperature(t: f64) -> bool {
(t - 0.7).abs() < 1e-9 || (t - 1.0).abs() < 1e-9
} Try / catch
match provider.chat(req, model, temp).await {
Err(e) if e.to_string().contains("temperature unsupported by Grok CLI") =>
provider.chat(req, model, Some(0.7)).await, // fall back to supported value
other => other,
} Prevention
- Do not carry temperature overrides across provider switches
- Keep grok_cli agents at the default or pin 0.7/1.0
- Remember the value is never forwarded — tuning it against the CLI is pointless
When it happens
Trigger: chat/chat_with_system on a grok_cli provider with temperature = 0.0, 0.2, 1.5, or any value outside epsilon of {0.7, 1.0}; an agent profile tuned for an OpenAI-style provider (arbitrary floats accepted) reused with model_provider = grok_cli.
Common situations: Switching an existing agent to grok_cli without revisiting its temperature override; shared per-agent config applied across heterogeneous providers; temperature-sweep scripts run against all providers.
Related errors
- Grok CLI model provider received a non-finite temperature…
- temperature unsupported by KiloCLI
- Gemini CLI model_provider received non-finite temperature…
- grok_cli env_passthrough entry
- grok_cli extra_args accepts long flags only and must not…
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/df39cd6724748611.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-providers/src/grok_cli.rs:655
}
fn should_forward_model(model: &str) -> bool {
let trimmed = model.trim();
!trimmed.is_empty() && trimmed != DEFAULT_MODEL_MARKER
}
fn supports_temperature(temperature: f64) -> bool {
GROK_CLI_SUPPORTED_TEMPERATURES
.iter()
.any(|value| (temperature - value).abs() < TEMP_EPSILON)
}
fn validate_temperature(temperature: f64) -> anyhow::Result<()> {
if !temperature.is_finite() {
anyhow::bail!("Grok CLI model provider received a non-finite temperature value");
}
if !Self::supports_temperature(temperature) {
anyhow::bail!(
"temperature unsupported by Grok CLI model provider: {temperature}. \
Supported values: 0.7 or 1.0 (not forwarded; CLI has no sampling flag)"
);
}
Ok(())
}
/// Build the documented ACP invocation. Permission and tool overrides are
/// accepted only through explicit per-alias `extra_args`.
fn build_cli_args(model: &str, extra_args: &[String]) -> Vec<String> {
let mut args = Vec::with_capacity(16 + extra_args.len());
args.push("--no-auto-update".to_string());
args.push("--no-plan".to_string());
if !Self::extra_args_set_any(extra_args, &["--sandbox"]) {
args.push("--sandbox".to_string());
args.push(DEFAULT_SANDBOX_PROFILE.to_string());
}View on GitHub (pinned to 88bb9c8533)