tonhowtf/omniget · error
Grok: nao consegui abrir uma conversa
Error message
Grok: nao consegui abrir uma conversa
What it means
ask_x (the X-session Grok backend) first creates a Grok conversation via the GraphQL endpoint CreateGrokConversation. If the response JSON does not contain data.create_grok_conversation.conversation_id as a string, this error is thrown, meaning X did not return a usable conversation — the session's access to Grok failed silently or the response shape changed.
Solutions
- Re-authenticate the X session (log in again so cookies are refreshed).
- Confirm the account can access Grok at x.com/i/grok in a browser.
- Capture the raw GraphQL response and check whether the schema path changed; update the pointer path in grok.rs if X renamed fields.
- Try the xai backend instead (set xai_key) which uses the official API.
- Retry later if X is rate limiting or having an incident.
Example fix
// before
let conversation_id = conv.pointer("/data/create_grok_conversation/conversation_id")...ok_or_else(|| anyhow!("Grok: nao consegui abrir uma conversa"))?;
// after
// inspect conv first to surface X's actual error
if let Some(errs) = conv.get("errors") {
return Err(anyhow!("Grok: conversa nao criada: {}", errs));
}
let conversation_id = conv.pointer("/data/create_grok_conversation/conversation_id")...ok_or_else(|| anyhow!("Grok: nao consegui abrir uma conversa"))?; Defensive patterns
Strategy: fallback
Validate before calling
// before calling ask_x backend, ensure session works
if !x_client.is_logged_in() { return Err("login to X before using the x backend"); }
if !account_has_grok_access() { return Err("account cannot use Grok"); } Type guard
fn conversation_id(v: &serde_json::Value) -> Option<&str> {
v.pointer("/data/create_grok_conversation/conversation_id").and_then(|c| c.as_str())
} Try / catch
match grok::ask(req).await {
Ok(a) => use_answer(a),
Err(e) if e.to_string().contains("nao consegui abrir uma conversa") => {
refresh_x_session();
grok::ask(req).await.unwrap_or_else(|_| use_xai_backend(req))
}
Err(e) => log_error(e),
} Prevention
- Keep the X session cookies refreshed; re-login periodically
- Verify Grok access (x.com/i/grok works) for the account
- Track X GraphQL schema changes; pin a fallback to the xai backend
- Prefer the xai backend when an API key is available
When it happens
Trigger: The GraphQL response lacks the conversation_id pointer: user is logged in but has no Grok access (region/account restriction), X changed the GraphQL schema, cookies/session are stale so a partial/unauthorized response is returned, or rate limiting returned an error body instead of the expected data.
Common situations: Expired X session cookies; account without Grok/ Premium+ eligibility; X rotating the CreateGrokConversation GraphQL operation or response shape; being blocked by X anti-bot defenses.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/3997e03cb487d0f2.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/x/grok.rs:296
output_tokens,
})
}
async fn ask_x(cfg: &GrokConfig, req: GrokRequest) -> anyhow::Result<GrokAnswer> {
let client = super::client::XClient::new()?;
client.require_login()?;
let model = if req.model.trim().is_empty() {
cfg.x_model.clone()
} else {
req.model.trim().to_string()
};
let conv = client
.gql_post("CreateGrokConversation", json!({}), None)
.await?;
let conversation_id = conv
.pointer("/data/create_grok_conversation/conversation_id")
.and_then(|c| c.as_str())
.ok_or_else(|| anyhow!("Grok: nao consegui abrir uma conversa"))?
.to_string();
let mut message = req.prompt.clone();
if !req.system.trim().is_empty() {
message = format!("{}\n\n{}", req.system.trim(), req.prompt);
}
let body = json!({
"responses": [{ "message": message, "sender": 1, "promptSource": "", "fileAttachments": [] }],
"systemPromptName": "",
"grokModelOptionId": model,
"conversationId": conversation_id,
"returnSearchResults": true,
"returnCitations": true,
"promptMetadata": { "promptSource": "NATURAL", "action": "INPUT" },
"imageGenerationCount": 4,
"requestFeatures": { "eagerTweets": true, "serverHistory": true },
"enableSideBySide": true,
"toolOverrides": {},
"isDeepsearch": false,View on GitHub (pinned to 8600b91f42)