Hmbown/CodeWhale · error · anyhow::Error

Antigravity cloud-code SSE shape is unproven; failing closed

Error message

Antigravity cloud-code SSE shape is unproven; failing closed

What it means

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.

Solutions

  1. Update codewhale - adapter shapes are extended as the backend evolves.
  2. Capture the frame that triggers it (log the raw data line) and compare it against the documented Antigravity response shape.
  3. If a custom gateway is in play, align its payload to the modeled Gemini-style shape or use a supported provider route.
  4. Report the redacted frame upstream so the shape can be proven and added.
Defensive patterns

Strategy: fallback

Try / catch

// Rust: on an unproven shape, fall back to a supported route and capture evidence
Err(err) if err.to_string().contains("shape is unproven") => {
    capture_frame_for_report().await;
    return run_via_chat_completions_route().await; // supported fallback
}

Prevention

When it happens

Trigger: 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.

Common situations: Backend drift after provider updates; custom gateways approximating the cloud-code protocol; staging endpoints with newer shapes than the adapter knows.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/76a3fae385150b85. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/client/cloud_code.rs:234

                        Ok(value) => value,
                        Err(err) => {
                            yield Err(anyhow::anyhow!(
                                "Antigravity cloud-code SSE is not JSON: {err}"
                            ));
                            return;
                        }
                    };
                    if let Some(error) = value.get("error") {
                        yield Ok(StreamEvent::Error {
                            error: error.clone(),
                        });
                        return;
                    }
                    let Some(text) = extract_cloud_code_text(&value) else {
                        if value.get("response").is_some() || value.get("candidates").is_some() {
                            continue;
                        }
                        yield Err(anyhow::anyhow!(
                            "Antigravity cloud-code SSE shape is unproven; failing closed"
                        ));
                        return;
                    };
                    if !started {
                        started = true;
                        yield Ok(StreamEvent::MessageStart {
                            message: MessageResponse {
                                id: "agy".to_string(),
                                r#type: "message".to_string(),
                                role: "assistant".to_string(),
                                content: Vec::new(),
                                model: String::new(),
                                stop_reason: None,
                                stop_sequence: None,
                                container: None,
                                usage: crate::models::Usage::default(),
                            },

View on GitHub (pinned to 0c42157ee5)