{"record":{"id":"6a619124752c988b","repo":"github/copilot-sdk","slug":"in-process-runtime-unavailable-build-with-the-bun","errorCode":null,"errorMessage":"in-process runtime unavailable: build with the bundled embedded runtime or set COPILOT_CLI_PATH to a compatible runtime package","messagePattern":"in-process runtime unavailable: build with the bundled embedded runtime or set COPILOT_CLI_PATH to a compatible runtime package","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/client.go","lineNumber":2273,"sourceCode":"}\n\n// startInProcess loads the native runtime library and wires the JSON-RPC client\n// to its FFI byte streams.\nfunc (c *Client) startInProcess(ctx context.Context) error {\n\tif !inProcessAvailable {\n\t\treturn errors.New(\"in-process transport unavailable: rebuild with -tags copilot_inprocess on a supported platform\")\n\t}\n\n\tcliEntrypoint := c.cliPath\n\tif cliEntrypoint == \"\" {\n\t\tcliEntrypoint = getEnvValue(c.options.Env, \"COPILOT_CLI_PATH\")\n\t}\n\truntimePath := cliEntrypoint\n\tif runtimePath == \"\" {\n\t\truntimePath = embeddedcli.RuntimePath()\n\t}\n\tif runtimePath == \"\" {\n\t\treturn errors.New(\"in-process runtime unavailable: build with the bundled embedded runtime or set COPILOT_CLI_PATH to a compatible runtime package\")\n\t}\n\n\tconfig := c.inProcessHostConfig()\n\n\thost, err := createInProcessHost(runtimePath, cliEntrypoint, config)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Own the host before the blocking handshake so a cancelled or failed start\n\t// leaves it disposable by Stop/ForceStop rather than leaking (host.Start runs\n\t// on its own goroutine and cannot be interrupted once the native call begins).\n\tc.ffiHost = host\n\n\terrCh := make(chan error, 1)\n\tgo func() { errCh <- host.Start() }()\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {","sourceCodeStart":2255,"sourceCodeEnd":2291,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/client.go#L2255-L2291","documentation":"startInProcess found no runtime library to load: no explicit entrypoint was configured, no COPILOT_CLI_PATH was set, and embeddedcli.RuntimePath() returned empty (no bundled embedded runtime in this build). The in-process host cannot be created without a runtime path.","triggerScenarios":"Calling startInProcess with an empty cliPath, unset COPILOT_CLI_PATH, and a build without the embedded runtime bundle.","commonSituations":"Custom builds that did not embed the runtime; running from a workspace without the bundled runtime files; environments where COPILOT_CLI_PATH is stripped (sanitized env in services/containers).","solutions":["Set COPILOT_CLI_PATH to a compatible runtime package directory","Build with the bundled embedded runtime so embeddedcli.RuntimePath() is non-empty","Pass an explicit runtime path through the client options"],"exampleFix":"// before\nos.Unsetenv(\"COPILOT_CLI_PATH\")\n// after\nos.Setenv(\"COPILOT_CLI_PATH\", \"/opt/copilot/runtime\")","handlingStrategy":"fallback","validationCode":"if os.Getenv(\"COPILOT_CLI_PATH\") == \"\" && embeddedcli.RuntimePath() == \"\" {\n    return fmt.Errorf(\"no in-process runtime available\")\n}","typeGuard":null,"tryCatchPattern":"if err := client.StartInProcess(ctx); err != nil && strings.Contains(err.Error(), \"runtime unavailable\") {\n    os.Setenv(\"COPILOT_CLI_PATH\", runtimePath)\n    return client.StartInProcess(ctx)\n}","preventionTips":["Ship a build with the embedded runtime or always set COPILOT_CLI_PATH","Avoid env sanitization that strips COPILOT_CLI_PATH in services","Check runtimePath availability before selecting in-process mode"],"tags":["go","runtime","embedded","environment"],"backgroundTag":"missing-env-var","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"}