{"record":{"id":"df39cd6724748611","repo":"zeroclaw-labs/zeroclaw","slug":"temperature-unsupported-by-grok-cli-model-provider","errorCode":null,"errorMessage":"temperature unsupported by Grok CLI model provider: {temperature}. Supported values: 0.7 or 1.0 (not forwarded; CLI has no sampling flag)","messagePattern":"temperature unsupported by Grok CLI model provider: (.+?)\\. Supported values: 0\\.7 or 1\\.0 \\(not forwarded; CLI has no sampling flag\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/grok_cli.rs","lineNumber":655,"sourceCode":"    }\n\n    fn should_forward_model(model: &str) -> bool {\n        let trimmed = model.trim();\n        !trimmed.is_empty() && trimmed != DEFAULT_MODEL_MARKER\n    }\n\n    fn supports_temperature(temperature: f64) -> bool {\n        GROK_CLI_SUPPORTED_TEMPERATURES\n            .iter()\n            .any(|value| (temperature - value).abs() < TEMP_EPSILON)\n    }\n\n    fn validate_temperature(temperature: f64) -> anyhow::Result<()> {\n        if !temperature.is_finite() {\n            anyhow::bail!(\"Grok CLI model provider received a non-finite temperature value\");\n        }\n        if !Self::supports_temperature(temperature) {\n            anyhow::bail!(\n                \"temperature unsupported by Grok CLI model provider: {temperature}. \\\n                 Supported values: 0.7 or 1.0 (not forwarded; CLI has no sampling flag)\"\n            );\n        }\n        Ok(())\n    }\n\n    /// Build the documented ACP invocation. Permission and tool overrides are\n    /// accepted only through explicit per-alias `extra_args`.\n    fn build_cli_args(model: &str, extra_args: &[String]) -> Vec<String> {\n        let mut args = Vec::with_capacity(16 + extra_args.len());\n        args.push(\"--no-auto-update\".to_string());\n        args.push(\"--no-plan\".to_string());\n\n        if !Self::extra_args_set_any(extra_args, &[\"--sandbox\"]) {\n            args.push(\"--sandbox\".to_string());\n            args.push(DEFAULT_SANDBOX_PROFILE.to_string());\n        }","sourceCodeStart":637,"sourceCodeEnd":673,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/grok_cli.rs#L637-L673","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n[agents.coder]\ntemperature = 0.3\n\n# after\n[agents.coder]\ntemperature = 0.7","handlingStrategy":"validation","validationCode":"fn grok_temperature_ok(t: Option<f64>) -> bool {\n    t.map(|v| (v - 0.7).abs() < 1e-9 || (v - 1.0).abs() < 1e-9).unwrap_or(true)\n}","typeGuard":"fn is_supported_grok_temperature(t: f64) -> bool {\n    (t - 0.7).abs() < 1e-9 || (t - 1.0).abs() < 1e-9\n}","tryCatchPattern":"match provider.chat(req, model, temp).await {\n    Err(e) if e.to_string().contains(\"temperature unsupported by Grok CLI\") =>\n        provider.chat(req, model, Some(0.7)).await, // fall back to supported value\n    other => other,\n}","preventionTips":["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"],"tags":["grok-cli","temperature","sampling","validation"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}