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
- 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.
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
- 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.
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
- {err}
- Antigravity cloud-code SSE is not JSON
- SSE stream idle timeout after
- Stream read error
- Antigravity cloud-code accepts text parts only; non-text…
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)