Hmbown/CodeWhale · error

Antigravity cloud-code SSE shape is unproven; failing closed

Error message

Antigravity cloud-code SSE shape is unproven; failing closed

What it means

The cloud-code SSE payload parsed as JSON, carried no `error` key, `extract_cloud_code_text` could not pull a text part from it, and it had neither a `response` nor `candidates` wrapper (the known ignorable shapes). Because the Antigravity protocol is reverse-engineered and its shape unproven, the client deliberately fails closed instead of silently dropping a possibly meaningful frame.

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 8880682c63)

Solutions

  1. Update the client — new shapes get mapped as they are confirmed
  2. Capture the failing payload and report it so the shape can be proven and mapped
  3. Retry after updating; do not retry unchanged — the same frame will fail again
Defensive patterns

Strategy: try-catch

Type guard

fn is_unproven_shape_error(err: &anyhow::Error) -> bool {
    err.to_string().contains("SSE shape is unproven")
}

Try / catch

match stream.next().await {
    Some(Err(e)) if is_unproven_shape_error(&e) => {
        // Deliberate fail-closed: unknown frame may carry meaning. Upgrade client, report payload.
        return Err(e.context("cloud-code protocol changed; client mapping outdated"));
    }
    other => { /* forward */ }
}

Prevention

When it happens

Trigger: Antigravity ships a new event shape not yet mapped by the client; an intermediate informational frame the client has never seen; the endpoint's response format drifts.

Common situations: Provider-side protocol evolution outpacing the client; beta endpoints with undocumented frame types.

Related errors


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