{"record":{"id":"a59b846c9be97cb1","repo":"github/copilot-sdk","slug":"copilot-runtime-wrapper-not-found-at-wrapper","errorCode":null,"errorMessage":"Copilot runtime wrapper not found at '{wrapper}'.","messagePattern":"Copilot runtime wrapper not found at '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Client.cs","lineNumber":2502,"sourceCode":"        var directory = Path.GetDirectoryName(searchedWrapper)!;\n        var runtimeNode = Path.Combine(directory, \"runtime.node\");\n        var explicitCliMarker = Path.Combine(directory, ExplicitBundledCliMarker);\n        if (!File.Exists(searchedWrapper)\n            && !File.Exists(runtimeNode)\n            && File.Exists(explicitCliMarker)\n            && GetBundledCliPath(out _) is { } explicitCli)\n        {\n            return new RuntimeLaunch(explicitCli, \"Bundled explicit CLI\");\n        }\n        return ValidateRuntimePair(searchedWrapper, \"Bundled runtime\");\n    }\n\n    private static RuntimeLaunch ValidateRuntimePair(string wrapper, string source)\n    {\n        var runtimeNode = Path.Combine(Path.GetDirectoryName(Path.GetFullPath(wrapper))!, \"runtime.node\");\n        if (!File.Exists(wrapper))\n        {\n            throw new InvalidOperationException($\"Copilot runtime wrapper not found at '{wrapper}'.\");\n        }\n        if (!File.Exists(runtimeNode))\n        {\n            throw new InvalidOperationException(\n                $\"Copilot runtime wrapper at '{wrapper}' is missing its adjacent runtime.node at '{runtimeNode}'.\");\n        }\n        if (new FileInfo(wrapper).Length == 0 || new FileInfo(runtimeNode).Length == 0)\n        {\n            throw new InvalidOperationException(\"Copilot runtime wrapper and adjacent runtime.node must both be non-empty.\");\n        }\n#if NET8_0_OR_GREATER\n        if (!OperatingSystem.IsWindows())\n        {\n            var mode = File.GetUnixFileMode(wrapper);\n            const UnixFileMode executeBits =\n                UnixFileMode.UserExecute | UnixFileMode.GroupExecute | UnixFileMode.OtherExecute;\n            if ((mode & executeBits) == 0)\n            {","sourceCodeStart":2484,"sourceCodeEnd":2520,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/dotnet/src/Client.cs#L2484-L2520","documentation":"ValidateRuntimePair checks that a Copilot runtime wrapper file exists before launching it. The wrapper executable (e.g. the Node script/entrypoint that loads runtime.node) was not found at the configured path, so launch is refused.","triggerScenarios":"File.Exists(wrapper) is false at Client.cs:2502 when the client validates the runtime wrapper path during launch setup (ValidateRuntimePair), typically from a path supplied via CopilotClientOptions.","commonSituations":"Typo or wrong casing in the wrapper path in options; pointing at a directory instead of the wrapper file; the runtime assets were never downloaded/installed; the package was partially copied and the wrapper omitted; path computed relative to a working directory that differs at runtime.","solutions":["Verify the wrapper path in your options points to an existing file (use an absolute path).","Reinstall/restore the Copilot runtime assets (nuget restore / package reinstall) so the wrapper is present.","Check for typos, wrong casing, or pointing at a directory instead of the wrapper file.","If the path is derived at runtime, resolve it relative to AppContext.BaseDirectory or the assembly location instead of the current working directory."],"exampleFix":"// before\noptions.WrapperPath = \"copilot-runtime/wrapper.js\"; // relative to CWD\n\n// after\noptions.WrapperPath = Path.Combine(AppContext.BaseDirectory, \"copilot-runtime\", \"wrapper.js\");","handlingStrategy":"validation","validationCode":"if (options.WrapperPath is null || !File.Exists(options.WrapperPath))\n    throw new FileNotFoundException($\"Copilot runtime wrapper not found at '{options.WrapperPath}'\");","typeGuard":"static bool WrapperExists(string? p) => p is { Length: > 0 } && File.Exists(p);","tryCatchPattern":"try\n{\n    await client.StartAsync();\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"wrapper not found\"))\n{\n    logger.LogError(ex, \"Runtime wrapper missing at configured path\");\n}","preventionTips":["Use absolute paths built from AppContext.BaseDirectory for runtime assets.","Verify runtime assets are included in build output and deployment artifacts.","Reinstall the package after any partial copy or restore failure."],"tags":["file-not-found","runtime","path"],"backgroundTag":"file-not-found","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}