{"record":{"id":"da3e0816426bbf0e","repo":"Hmbown/CodeWhale","slug":"err-da3e08","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/client/cloud_code.rs","lineNumber":202,"sourceCode":"                        yield Err(anyhow::anyhow!(stream_entry::idle_timeout_message(\n                            stream_idle_timeout,\n                            bytes_received,\n                            stream_start.elapsed(),\n                            last_chunk_at.elapsed(),\n                        )));\n                        return;\n                    }\n                };\n                bytes_received += chunk.len();\n                last_chunk_at = std::time::Instant::now();\n                buffer.extend_from_slice(&chunk);\n\n                loop {\n                    let line = match super::take_sse_line(&mut buffer) {\n                        Ok(Some(line)) => line,\n                        Ok(None) => break,\n                        Err(err) => {\n                            yield Err(anyhow::anyhow!(\"{err}\"));\n                            return;\n                        }\n                    };\n                    if line.is_empty() || line.starts_with(':') {\n                        continue;\n                    }\n                    let Some(data) = super::extract_sse_data_value(&line) else {\n                        continue;\n                    };\n                    if data == \"[DONE]\" {\n                        break;\n                    }\n                    let value: Value = match serde_json::from_str(data) {\n                        Ok(value) => value,\n                        Err(err) => {\n                            yield Err(anyhow::anyhow!(\n                                \"Antigravity cloud-code SSE is not JSON: {err}\"\n                            ));","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/client/cloud_code.rs#L184-L220","documentation":"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.","triggerScenarios":"Corrupt bytes delivered by a proxy/CDN; a non-UTF-8 body on the endpoint; intermediary rewriting the stream.","commonSituations":"MITM transcoding; provider emitting a mis-encoded frame; corrupted transfer.","solutions":["Retry once — transient corruption usually clears","Bypass proxies between client and the cloud-code endpoint","If deterministic, capture raw bytes and report upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_invalid_sse_utf8(err: &anyhow::Error) -> bool {\n    err.to_string().contains(\"SSE line is not valid UTF-8\")\n}","tryCatchPattern":"match stream.next().await {\n    Some(Err(e)) if is_invalid_sse_utf8(&e) => {\n        backoff_retry().await; // corruption is usually transient\n    }\n    Some(Err(e)) => return Err(e),\n    other => { /* forward */ }\n}","preventionTips":["Keep strict UTF-8 handling on the cloud-code route; never substitute U+FFFD","Bypass transcoding intermediaries","Capture and report deterministically corrupt payloads"],"tags":["antigravity","cloud-code","sse","utf-8"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}