{"record":{"id":"9330afeaa3dd0723","repo":"github/copilot-sdk","slug":"copilot-runtime-wrapper-at-wrapper-is-missing","errorCode":null,"errorMessage":"Copilot runtime wrapper at '{wrapper}' is missing its adjacent runtime.node at '{runtimeNode}'.","messagePattern":"Copilot runtime wrapper at '(.+?)' is missing its adjacent runtime\\.node at '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Client.cs","lineNumber":2506,"sourceCode":"            && !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            {\n                File.SetUnixFileMode(wrapper, mode | executeBits);\n            }\n        }\n#endif","sourceCodeStart":2488,"sourceCodeEnd":2524,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/dotnet/src/Client.cs#L2488-L2524","documentation":"The Copilot runtime wrapper exists, but its required adjacent `runtime.node` native module (expected in the same directory) is missing. The wrapper cannot run without this companion binary, so validation throws before launch.","triggerScenarios":"File.Exists(runtimeNode) is false at Client.cs:2506, where runtimeNode = <wrapper directory>/runtime.node, during ValidateRuntimePair prior to launching the runtime.","commonSituations":"Copying only the wrapper file when distributing the app and forgetting runtime.node; packaging rules (e.g. csproj/pack globs) that exclude *.node native binaries; antivirus or deployment tooling stripping native binaries; a wrapper copied out of its original directory.","solutions":["Ensure runtime.node sits in the same directory as the wrapper (copy both together).","Fix build/packaging globs so *.node files are included in output (e.g. csproj CopyToOutputDirectory for native assets).","Reinstall the runtime package if the native module was deleted or quarantined by antivirus.","Verify with `ls <wrapper-dir>` that both wrapper and runtime.node exist before launching."],"exampleFix":"// before (csproj)\n<None Include=\"runtime\\wrapper.js\" CopyToOutputDirectory=\"PreserveNewest\" />\n\n// after (csproj)\n<None Include=\"runtime\\**\\*\" CopyToOutputDirectory=\"PreserveNewest\" /> <!-- includes runtime.node -->","handlingStrategy":"validation","validationCode":"var wrapperDir = Path.GetDirectoryName(Path.GetFullPath(options.WrapperPath!));\nif (!File.Exists(Path.Combine(wrapperDir!, \"runtime.node\")))\n    throw new FileNotFoundException($\"runtime.node missing next to wrapper at '{wrapperDir}'\");","typeGuard":"static bool RuntimePairExists(string? wrapper) =>\n    wrapper is { Length: > 0 } &&\n    File.Exists(wrapper) &&\n    File.Exists(Path.Combine(Path.GetDirectoryName(Path.GetFullPath(wrapper))!, \"runtime.node\"));","tryCatchPattern":"try\n{\n    await client.StartAsync();\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"runtime.node\"))\n{\n    logger.LogError(ex, \"runtime.node missing adjacent to the runtime wrapper\");\n}","preventionTips":["Copy the whole runtime directory, never individual files.","Include *.node files in packaging globs (csproj None/CopyToOutputDirectory).","Check deployment tooling/antivirus logs for stripped native binaries."],"tags":["file-not-found","runtime","native-module","packaging"],"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"}