jlcodes99/cockpit-tools · error

[WakeupGateway] 官方 LS LanguageServerStarted 解析失败: {}

Error message

[WakeupGateway] 官方 LS LanguageServerStarted 解析失败: {}

What it means

Parse guard in the official LS extension RPC bridge: a request whose path matches the LanguageServerStarted method failed parse_official_ls_started_request, so the payload does not conform to the expected started-notification shape. The failure is logged and answered with a 400 'Bad Request' text response, closing the extension request rather than dispatching it to the waiting sender.

Source

Thrown at crates/cockpit-core/src/modules/wakeup_gateway.rs:1188

            "text/plain; charset=utf-8",
        ));
    }

    if path_matches_rpc_method(&path, "LanguageServerStarted") {
        match parse_official_ls_started_request(&parsed.body) {
            Ok(started) => {
                if let Ok(mut guard) = state.started_sender.lock() {
                    if let Some(tx) = guard.take() {
                        let _ = tx.send(started);
                    }
                }
                return OfficialLsExtensionAction::Close(extension_unary_response(
                    &content_type,
                    &[],
                ));
            }
            Err(err) => {
                crate::modules::logger::log_error(&format!(
                    "[WakeupGateway] 官方 LS LanguageServerStarted 解析失败: {}",
                    err
                ));
                return OfficialLsExtensionAction::Close(text_response(
                    400,
                    "Bad Request",
                    &err,
                    "text/plain; charset=utf-8",
                ));
            }
        }
    }

    if path_matches_rpc_method(&path, "SubscribeToUnifiedStateSyncTopic") {
        let topic = match parse_subscribe_topic_from_connect_body(&parsed.body) {
            Ok(v) => v,
            Err(err) => {
                crate::modules::logger::log_error(&format!(

View on GitHub (pinned to 1ed8b77992)

Solutions

  1. Compare the request body against the expected LanguageServerStarted schema (missing/renamed fields)
  2. Check whether an updated official LS version changed the payload shape and update the parser
  3. Inspect the interpolated parse error for the exact field that failed
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/cockpit-core/src/modules/wakeup_gateway.rs:1188 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05). Data as JSON: /api/errors/95428398375365b4. Report an issue: GitHub.