Hmbown/CodeWhale · error
{err}
Error message
{err} What it means
On the Antigravity cloud-code route, a complete SSE line failed strict UTF-8 decode in `take_sse_line` (`InvalidSseUtf8` carrying valid_up_to/error_len). Consistent with the #5374 fail-closed policy, invalid bytes abort the stream instead of being replaced with U+FFFD.
Source
Thrown at crates/tui/src/client/cloud_code.rs:202
yield Err(anyhow::anyhow!(stream_entry::idle_timeout_message(
stream_idle_timeout,
bytes_received,
stream_start.elapsed(),
last_chunk_at.elapsed(),
)));
return;
}
};
bytes_received += chunk.len();
last_chunk_at = std::time::Instant::now();
buffer.extend_from_slice(&chunk);
loop {
let line = match super::take_sse_line(&mut buffer) {
Ok(Some(line)) => line,
Ok(None) => break,
Err(err) => {
yield Err(anyhow::anyhow!("{err}"));
return;
}
};
if line.is_empty() || line.starts_with(':') {
continue;
}
let Some(data) = super::extract_sse_data_value(&line) else {
continue;
};
if data == "[DONE]" {
break;
}
let value: Value = match serde_json::from_str(data) {
Ok(value) => value,
Err(err) => {
yield Err(anyhow::anyhow!(
"Antigravity cloud-code SSE is not JSON: {err}"
));View on GitHub (pinned to 8880682c63)
Solutions
- Retry once — transient corruption usually clears
- Bypass proxies between client and the cloud-code endpoint
- If deterministic, capture raw bytes and report upstream
Defensive patterns
Strategy: try-catch
Type guard
fn is_invalid_sse_utf8(err: &anyhow::Error) -> bool {
err.to_string().contains("SSE line is not valid UTF-8")
} Try / catch
match stream.next().await {
Some(Err(e)) if is_invalid_sse_utf8(&e) => {
backoff_retry().await; // corruption is usually transient
}
Some(Err(e)) => return Err(e),
other => { /* forward */ }
} Prevention
- Keep strict UTF-8 handling on the cloud-code route; never substitute U+FFFD
- Bypass transcoding intermediaries
- Capture and report deterministically corrupt payloads
When it happens
Trigger: Corrupt bytes delivered by a proxy/CDN; a non-UTF-8 body on the endpoint; intermediary rewriting the stream.
Common situations: MITM transcoding; provider emitting a mis-encoded frame; corrupted transfer.
Related errors
- Antigravity cloud-code SSE is not JSON: {err}
- Antigravity cloud-code SSE shape is unproven; failing closed
- Antigravity cloud-code is stream-only; blocking create_messa
- {err}
- {err}
AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16).
Data as JSON: /api/errors/da3e0816426bbf0e.
Report an issue: GitHub.