{"record":{"id":"60a97827c05761c2","repo":"github/copilot-sdk","slug":"invalid-cliurl-format-url-expected-host-port","errorCode":null,"errorMessage":"Invalid cliUrl format: ${url}. Expected \"host:port\", \"[ipv6]:port\", \"http://host:port\", or \"port\"","messagePattern":"Invalid cliUrl format: (.+?)\\. Expected \"host:port\", \"\\[ipv6\\]:port\", \"http://host:port\", or \"port\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/client.ts","lineNumber":783,"sourceCode":"        // the existing parser behavior for other inputs.\n        const ipv6Match = cleanUrl.match(/^\\[([^\\]]+)\\]:(\\d+)$/);\n        if (ipv6Match) {\n            const host = ipv6Match[1];\n            if (!isIPv6(host)) {\n                throw new Error(`Invalid cliUrl format: ${url}`);\n            }\n\n            const port = parseInt(ipv6Match[2], 10);\n            if (isNaN(port) || port <= 0 || port > 65535) {\n                throw new Error(`Invalid port in cliUrl: ${url}`);\n            }\n            return { host, port };\n        }\n\n        // Parse host:port format\n        const parts = cleanUrl.split(\":\");\n        if (parts.length !== 2) {\n            throw new Error(\n                `Invalid cliUrl format: ${url}. Expected \"host:port\", \"[ipv6]:port\", \"http://host:port\", or \"port\"`\n            );\n        }\n\n        const host = parts[0] || \"localhost\";\n        const port = parseInt(parts[1], 10);\n\n        if (isNaN(port) || port <= 0 || port > 65535) {\n            throw new Error(`Invalid port in cliUrl: ${url}`);\n        }\n\n        return { host, port };\n    }\n\n    private validateSessionFsConfig(config: SessionFsConfig): void {\n        if (!config.initialCwd) {\n            throw new Error(\"sessionFs.initialCwd is required\");\n        }","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/client.ts#L765-L801","documentation":"Terminal fallback of parseCliUrl: the input matched none of the accepted shapes (bare port, bracketed IPv6, host:port with a valid port). This generic guard fires after all specific parsing branches fail, so the fault is the overall cliUrl string format — typically a missing port, extra slashes, or a scheme the regex does not strip.","triggerScenarios":"Thrown at nodejs/src/client.ts:783 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reformat the cliUrl as 'host:port' (e.g. 'localhost:8080'), '[ipv6]:port', 'http://host:port', or a bare port number","Ensure a port is actually present — a bare hostname without ':port' is rejected","Trim whitespace and remove stray protocol/suffix characters before passing the value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}