{"record":{"id":"892126df18007693","repo":"zed-industries/zed","slug":"failed-to-add-stream-output-message","errorCode":null,"errorMessage":"failed to add stream output {message:?}","messagePattern":"failed to add stream output (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macos/src/screen_capture.rs","lineNumber":142,"sourceCode":"            let _: id = msg_send![configuration, setWidth: meta.resolution.width.0 as i64];\n            let _: id = msg_send![configuration, setHeight: meta.resolution.height.0 as i64];\n            let stream: id = msg_send![stream, initWithFilter:filter configuration:configuration delegate:delegate];\n\n            // Stream contains filter, configuration, and delegate internally so we release them here\n            // to prevent a memory leak when steam is dropped\n            let _: () = msg_send![filter, release];\n            let _: () = msg_send![configuration, release];\n            let _: () = msg_send![delegate, release];\n\n            let (tx, rx) = oneshot::channel();\n\n            let mut error: id = nil;\n            let _: () = msg_send![stream, addStreamOutput:output type:SCStreamOutputTypeScreen sampleHandlerQueue:0 error:&mut error as *mut id];\n            if error != nil {\n                let message: id = msg_send![error, localizedDescription];\n                let _: () = msg_send![stream, release];\n                let _: () = msg_send![output, release];\n                tx.send(Err(anyhow!(\"failed to add stream output {message:?}\")))\n                    .ok();\n                return rx;\n            }\n\n            let tx = Rc::new(RefCell::new(Some(tx)));\n            let handler = ConcreteBlock::new({\n                move |error: id| {\n                    let result = if error == nil {\n                        let stream = MacScreenCaptureStream {\n                            meta: meta.clone(),\n                            sc_stream: stream,\n                            sc_stream_output: output,\n                        };\n                        Ok(Box::new(stream) as Box<dyn ScreenCaptureStream>)\n                    } else {\n                        let _: () = msg_send![stream, release];\n                        let _: () = msg_send![output, release];\n                        let message: id = msg_send![error, localizedDescription];","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_macos/src/screen_capture.rs#L124-L160","documentation":"Guard in MacScreenCaptureSource::stream: SCStream.addStreamOutput(_:type:sampleHandlerQueue:) returned an error, so the capture stream has no frame receiver attached and cannot deliver frames. {message:?} is the NSError from ScreenCaptureKit; commonly a delegate/queue or content-filter problem.","triggerScenarios":"Thrown at crates/gpui_macos/src/screen_capture.rs:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the SCContentFilter and SCStreamConfiguration are valid before addStreamOutput","Ensure the sample-handler queue is non-nil and the delegate retained for the stream lifetime","Check ScreenCaptureKit authorization (CGPreflightScreenCaptureAccess) before creating streams"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}