{"record":{"id":"9ddfd75e62d4a48b","repo":"xai-org/grok-build","slug":"arboard-read-worker-died","errorCode":null,"errorMessage":"arboard read worker died","messagePattern":"arboard read worker died","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shared/src/clipboard.rs","lineNumber":1338,"sourceCode":"    /// harmless while the lease keeps the shared backend alive.\n    const ARBOARD_READ_WAIT: std::time::Duration = std::time::Duration::from_secs(2);\n\n    fn arboard_read_with_deadline<T: Send + 'static>(\n        op: impl FnOnce(&mut arboard::Clipboard) -> anyhow::Result<T> + Send + 'static,\n    ) -> anyhow::Result<T> {\n        use std::sync::mpsc::RecvTimeoutError;\n        if arboard_wayland_bypassed() {\n            anyhow::bail!(\"arboard leg disabled (GROK_CLIPBOARD_NO_DATA_CONTROL)\");\n        }\n        let result = spawn_with_deadline(\"clipboard-read\", ARBOARD_READ_WAIT, move || {\n            arboard::Clipboard::new()\n                .map_err(anyhow::Error::from)\n                .and_then(|mut clipboard| op(&mut clipboard))\n        });\n        match result {\n            Ok(inner) => inner,\n            Err(RecvTimeoutError::Timeout) => Err(anyhow::anyhow!(\"arboard read timed out\")),\n            Err(RecvTimeoutError::Disconnected) => Err(anyhow::anyhow!(\"arboard read worker died\")),\n        }\n    }\n\n    fn arboard_get_text() -> anyhow::Result<Option<String>> {\n        arboard_read_with_deadline(|clipboard| match clipboard.get_text() {\n            Ok(text) if text.is_empty() => Ok(None),\n            Ok(text) => Ok(Some(text)),\n            Err(arboard::Error::ContentNotAvailable) => Ok(None),\n            Err(err) => Err(err.into()),\n        })\n    }\n\n    #[cfg(target_os = \"linux\")]\n    fn arboard_get_primary_text() -> anyhow::Result<Option<String>> {\n        use arboard::{GetExtLinux, LinuxClipboardKind};\n        arboard_read_with_deadline(|clipboard| {\n            match clipboard\n                .get()","sourceCodeStart":1320,"sourceCodeEnd":1356,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shared/src/clipboard.rs#L1320-L1356","documentation":"In arboard_read_with_deadline (crates/codegen/xai-grok-shared/src/clipboard.rs:1338), RecvTimeoutError::Disconnected means the read worker thread terminated without sending a result — i.e. it panicked (e.g. inside arboard or the closure) or was killed, rather than timing out. The library reports this as 'arboard read worker died'.","triggerScenarios":"arboard_get_text / arboard_get_primary_text / arboard_get_image / get_file_urls when the worker thread panics during Clipboard::new() or the op closure — e.g. an arboard platform bug or an unexpected Wayland/X11 protocol abort.","commonSituations":"Arboard version-specific panics on certain compositors; OOM kills of the worker thread; platform clipboard API misbehaving after display server restarts.","solutions":["Retry the read once — a transient panic after a display-server restart often clears.","Update the arboard dependency to the latest patch version for platform panic fixes.","Capture the worker panic message (panic hook/log) to identify the underlying platform error.","Fall back to OS CLI clipboard tools if worker deaths recur."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let mut attempts = 0;\nloop {\n    match arboard_get_text() {\n        Err(e) if e.to_string() == \"arboard read worker died\" && attempts < 2 => { attempts += 1; continue; }\n        other => break other,\n    }\n}","preventionTips":["Keep arboard updated to the latest version for platform panic fixes.","Install a panic hook to capture worker panic details.","Watch for repeated worker deaths after display server restarts."],"tags":["clipboard","arboard","panic","worker-thread"],"backgroundTag":"clipboard-worker-panic","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}