{"record":{"id":"273dd09ad4156baf","repo":"tonhowtf/omniget","slug":"grok-nao-respondeu-modelo-pode-nao-existir-mais-troque-nas","errorCode":null,"errorMessage":"Grok nao respondeu (modelo `{}` pode nao existir mais; troque nas opcoes)","messagePattern":"Grok nao respondeu \\(modelo `(.+?)` pode nao existir mais; troque nas opcoes\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/x/grok.rs","lineNumber":379,"sourceCode":"                            url: url.to_string(),\n                            title: w\n                                .get(\"title\")\n                                .and_then(|t| t.as_str())\n                                .unwrap_or(\"\")\n                                .to_string(),\n                        });\n                    }\n                }\n            }\n        }\n        if let Some(err) = r.get(\"error\").and_then(|e| e.as_str()) {\n            if text.is_empty() {\n                return Err(anyhow!(\"Grok: {}\", err));\n            }\n        }\n    }\n    if text.trim().is_empty() {\n        return Err(anyhow!(\n            \"Grok nao respondeu (modelo `{}` pode nao existir mais; troque nas opcoes)\",\n            model\n        ));\n    }\n    Ok(GrokAnswer {\n        text,\n        citations,\n        model,\n        backend: \"x\".into(),\n        input_tokens: 0,\n        output_tokens: 0,\n    })\n}\n","sourceCodeStart":361,"sourceCodeEnd":393,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/grok.rs#L361-L393","documentation":"After consuming the entire NDJSON response, if no assistant text was extracted (neither result.message nor result.response.token chunks), ask_x throws `Grok nao respondeu (modelo `{model}` pode nao existir mais; troque nas opcoes)`. The library explicitly suspects the configured x_model option id is retired, so the stream produced nothing usable.","triggerScenarios":"All NDJSON lines parsed but yielded no non-USER message and no token: the grokModelOptionId no longer matches any model X offers, Grok returned only error chunks with text already non-empty (skipped), or the response shape changed so the parsing paths miss the payload.","commonSituations":"X silently retiring model option ids like the default `grok-3` (the module header notes ids churn); stale grok.json holding a dead model id; upstream schema change in add_response NDJSON breaking token extraction.","solutions":["Change the model: set x_model in grok.json (or pass req.model) to a currently valid Grok model option id.","Inspect the raw NDJSON (temporarily log `raw`) to see whether chunks carry a new shape and update the parser paths (/result/message, /result/response/token).","Switch to the xai backend (configure xai_key) which uses the official API with stable model names.","Retry later if X's Grok service is degraded and returns empty streams."],"exampleFix":"// before\n\"grokModelOptionId\": \"grok-3\"  // retired id, empty stream -> nao respondeu\n// after\ncfg.x_model = \"grok-4\"         // current option id picked from x.com/i/grok","handlingStrategy":"fallback","validationCode":"// check the model id is current before calling\nif cfg.x_model != CURRENT_KNOWN_X_MODEL { return Err(\"x_model may be retired; update grok.json\"); }","typeGuard":null,"tryCatchPattern":"match grok::ask(req).await {\n    Ok(a) => use_answer(a),\n    Err(e) if e.to_string().contains(\"Grok nao respondeu\") => {\n        let new_model = pick_current_model_option_id();\n        let mut req2 = req.clone(); req2.model = new_model;\n        grok::ask(req2).await.or_else(|_| use_xai_backend(req))\n    }\n    Err(e) => log_error(e),\n}","preventionTips":["Periodically refresh x_model from the ids offered on x.com/i/grok","Log the raw NDJSON once to detect schema drift early","Configure xai_key so the xai backend can serve as fallback","Update the crate when X retires model option ids (ids churn often)"],"tags":["empty-response","x","grok","model"],"backgroundTag":"empty-api-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}