{"record":{"id":"023a9cf757538875","repo":"zed-industries/zed","slug":"dap-returned-ipv6-host-addr-which-the-v0-6-0-ex","errorCode":null,"errorMessage":"DAP returned IPv6 host {addr}, which the v0.6.0 extension API cannot represent; the extension must be updated to v0.8.0 or later","messagePattern":"DAP returned IPv6 host (.+?), which the v0\\.6\\.0 extension API cannot represent; the extension must be updated to v0\\.8\\.0 or later","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs","lineNumber":434,"sourceCode":"        Self {\n            host: latest::dap::IpAddress::Ipv4((a, b, c, d)),\n            port: value.port,\n            timeout: value.timeout,\n        }\n    }\n}\n\nimpl TryFrom<latest::dap::TcpArguments> for dap::TcpArguments {\n    type Error = anyhow::Error;\n\n    fn try_from(value: latest::dap::TcpArguments) -> Result<Self> {\n        let host = match value.host {\n            latest::dap::IpAddress::Ipv4((a, b, c, d)) => {\n                std::net::Ipv4Addr::new(a, b, c, d).to_bits()\n            }\n            latest::dap::IpAddress::Ipv6((a, b, c, d, e, f, g, h)) => {\n                let addr = std::net::Ipv6Addr::new(a, b, c, d, e, f, g, h);\n                anyhow::bail!(\n                    \"DAP returned IPv6 host {addr}, which the v0.6.0 extension API cannot represent; the extension must be updated to v0.8.0 or later\"\n                );\n            }\n        };\n        Ok(Self {\n            host,\n            port: value.port,\n            timeout: value.timeout,\n        })\n    }\n}\n\nimpl From<dap::TcpArgumentsTemplate> for latest::dap::TcpArgumentsTemplate {\n    fn from(value: dap::TcpArgumentsTemplate) -> Self {\n        Self {\n            host: value.host.map(|host| {\n                let [a, b, c, d] = std::net::Ipv4Addr::from_bits(host).octets();\n                latest::dap::IpAddress::Ipv4((a, b, c, d))","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs#L416-L452","documentation":"Thrown when converting a debug adapter's TCP connection arguments from the current (latest) internal representation down to the v0.6.0 WIT type. The v0.6.0 dap::TcpArguments stores the host as a single u64 (IPv4 bits), so an IPv6 address — which the latest type represents as an IpAddress::Ipv6 variant — cannot round-trip. The host bails with a message telling the author the extension must target v0.8.0 or later, where TcpArguments carries the full IpAddress enum.","triggerScenarios":"A debug adapter (via latest::dap) returns host = IpAddress::Ipv6((...)) — e.g. \"::1\" or \"::\" — while the extension declares extension API v0.6.x/v0.7.x, forcing the TryFrom<latest::dap::TcpArguments> for dap::TcpArguments downconversion.","commonSituations":"A DAP server that listens on IPv6 localhost (common on Windows and on systems where localhost resolves to ::1), run under an extension pinned to an older extension_api_version.","solutions":["Update the extension: set extension_api_version to \"0.8.0\"+ (e.g. \"1\") so the host passes IpAddress through unchanged","Configure the debug adapter to use an IPv4 host (127.0.0.1) if the extension cannot be upgraded","If you maintain the adapter, default to 127.0.0.1 instead of ::/::1 when both stacks are available"],"exampleFix":"# before (extension.toml)\nextension_api_version = \"0.6.0\"\n# adapter returns host ::1 -> bail: DAP returned IPv6 host ...\n\n# after\nextension_api_version = \"1\"\n# v0.8.0+ TcpArguments.host is IpAddress, IPv6 passes through","handlingStrategy":"validation","validationCode":"// before converting latest DAP TCP args for an old-API extension\nif matches!(tcp_args.host, latest::dap::IpAddress::Ipv6(_)) {\n    // cannot be represented on v0.6.0: require a newer extension instead of failing at conversion\n    return Err(\"extension must target API v0.8.0+ for IPv6 debug adapters\".into());\n}","typeGuard":"fn is_representable_on_v0_6_0(host: &latest::dap::IpAddress) -> bool {\n    matches!(host, latest::dap::IpAddress::Ipv4(_))\n}","tryCatchPattern":"let tcp = match dap::TcpArguments::try_from(latest_tcp_args) {\n    Ok(args) => args,\n    Err(e) if e.to_string().contains(\"IPv6\") => { /* prompt extension update / use 127.0.0.1 */ return Ok(()); }\n    Err(e) => return Err(e),\n};","preventionTips":["Target the newest extension_api_version when your adapter may listen on IPv6","Default debug adapters to 127.0.0.1 rather than ::1"],"tags":["dap","debugger","ipv6","wasm","extension","zed","version-mismatch"],"backgroundTag":"api-version-mismatch","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"}