{"record":{"id":"b463486b9ff98d4d","repo":"zed-industries/zed","slug":"error-during-streamgeneratecontent-via-opencode-s","errorCode":null,"errorMessage":"error during streamGenerateContent via OpenCode, status code: {:?}, body: {}","messagePattern":"error during streamGenerateContent via OpenCode, status code: (.+?), body: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/opencode/src/opencode.rs","lineNumber":979,"sourceCode":"                        if let Some(line) = line.strip_prefix(\"data: \") {\n                            match serde_json::from_str(line) {\n                                Ok(response) => Some(Ok(response)),\n                                Err(error) => {\n                                    Some(Err(anyhow!(\"Error parsing JSON: {error:?}\\n{line:?}\")))\n                                }\n                            }\n                        } else {\n                            None\n                        }\n                    }\n                    Err(error) => Some(Err(anyhow!(error))),\n                }\n            })\n            .boxed())\n    } else {\n        let mut text = String::new();\n        response.body_mut().read_to_string(&mut text).await?;\n        Err(anyhow!(\n            \"error during streamGenerateContent via OpenCode, status code: {:?}, body: {}\",\n            response.status(),\n            text\n        ))\n    }\n}\n","sourceCodeStart":961,"sourceCodeEnd":986,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/opencode/src/opencode.rs#L961-L986","documentation":"The streamGenerateContent request completed at the HTTP layer but returned a non-success status code; the status and body are surfaced from the response. This indicates the provider rejected the request (auth, quota, or invalid payload) before streaming usable content.","triggerScenarios":"Thrown at crates/opencode/src/opencode.rs:979 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the status code: 401/403 means a bad API key, 429 means quota exhaustion, 400 means an invalid request payload","Verify the model name in the request is supported by the OpenCode endpoint","Retry after addressing the underlying cause; transient 5xx can simply be retried"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}