{"record":{"id":"76a3fae385150b85","repo":"Hmbown/CodeWhale","slug":"antigravity-cloud-code-sse-shape-is-unproven-fail","errorCode":null,"errorMessage":"Antigravity cloud-code SSE shape is unproven; failing closed","messagePattern":"Antigravity cloud-code SSE shape is unproven; failing closed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/client/cloud_code.rs","lineNumber":234,"sourceCode":"                        Ok(value) => value,\n                        Err(err) => {\n                            yield Err(anyhow::anyhow!(\n                                \"Antigravity cloud-code SSE is not JSON: {err}\"\n                            ));\n                            return;\n                        }\n                    };\n                    if let Some(error) = value.get(\"error\") {\n                        yield Ok(StreamEvent::Error {\n                            error: error.clone(),\n                        });\n                        return;\n                    }\n                    let Some(text) = extract_cloud_code_text(&value) else {\n                        if value.get(\"response\").is_some() || value.get(\"candidates\").is_some() {\n                            continue;\n                        }\n                        yield Err(anyhow::anyhow!(\n                            \"Antigravity cloud-code SSE shape is unproven; failing closed\"\n                        ));\n                        return;\n                    };\n                    if !started {\n                        started = true;\n                        yield Ok(StreamEvent::MessageStart {\n                            message: MessageResponse {\n                                id: \"agy\".to_string(),\n                                r#type: \"message\".to_string(),\n                                role: \"assistant\".to_string(),\n                                content: Vec::new(),\n                                model: String::new(),\n                                stop_reason: None,\n                                stop_sequence: None,\n                                container: None,\n                                usage: crate::models::Usage::default(),\n                            },","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/client/cloud_code.rs#L216-L252","documentation":"For each parsed JSON frame, extract_cloud_code_text looks for the known text-bearing shapes; frames carrying response or candidates keys are skipped as non-text envelope events. A frame that is valid JSON, carries no error, matches no known envelope, and yields no text means the assumed payload shape no longer holds - the adapter fails closed with 'shape is unproven' instead of guessing at field names.","triggerScenarios":"The Antigravity backend ships a payload revision (renamed text field, new wrapper key) the adapter has not modeled; a different Gemini-compatible gateway is pointed at the cloud-code route; an API version mismatch between the credential and the endpoint.","commonSituations":"Backend drift after provider updates; custom gateways approximating the cloud-code protocol; staging endpoints with newer shapes than the adapter knows.","solutions":["Update codewhale - adapter shapes are extended as the backend evolves.","Capture the frame that triggers it (log the raw data line) and compare it against the documented Antigravity response shape.","If a custom gateway is in play, align its payload to the modeled Gemini-style shape or use a supported provider route.","Report the redacted frame upstream so the shape can be proven and added."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust: on an unproven shape, fall back to a supported route and capture evidence\nErr(err) if err.to_string().contains(\"shape is unproven\") => {\n    capture_frame_for_report().await;\n    return run_via_chat_completions_route().await; // supported fallback\n}\n","preventionTips":["Update codewhale before backend cutover windows.","Keep recorded cloud-code payload fixtures in CI to detect drift early.","Prefer documented provider routes over experimental gateways for production work."],"tags":["cloud-code","antigravity","sse","api-drift","fail-closed"],"backgroundTag":"api-schema-drift","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}