{"record":{"id":"a1a1aaaaecdd4046","repo":"github/copilot-sdk","slug":"copilotclientoptions-optionname-is-not-supporte","errorCode":null,"errorMessage":"CopilotClientOptions.${optionName} is not supported with RuntimeConnection.forInProcess(): the in-process runtime shares the host process, so per-client values cannot be honored; ${remedy}.","messagePattern":"CopilotClientOptions\\.(.+?) is not supported with RuntimeConnection\\.forInProcess\\(\\): the in-process runtime shares the host process, so per-client values cannot be honored; (.+?)\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/main/java/com/github/copilot/CopilotClient.java","lineNumber":423,"sourceCode":"     */\n    private static void validateEnvironmentOptions(CopilotClientOptions options, RuntimeConnection connection) {\n        if (!(connection instanceof InProcessRuntimeConnection)) {\n            return;\n        }\n\n        rejectInProcessOption(\"Environment\", options.getEnvironment() != null && !options.getEnvironment().isEmpty(),\n                \"set the variables on the host process environment instead\");\n        rejectInProcessOption(\"Telemetry\", options.getTelemetry() != null,\n                \"configure telemetry through the host process environment instead\");\n        rejectInProcessOption(\"Cwd\", options.getCwd() != null,\n                \"set the process working directory before creating the client instead\");\n        rejectInProcessOption(\"CliArgs\", options.getCliArgs() != null && options.getCliArgs().length > 0,\n                \"use the typed client options instead\");\n    }\n\n    private static void rejectInProcessOption(String optionName, boolean present, String remedy) {\n        if (present) {\n            throw new IllegalArgumentException(\"CopilotClientOptions.\" + optionName\n                    + \" is not supported with RuntimeConnection.forInProcess(): the in-process runtime shares the host\"\n                    + \" process, so per-client values cannot be honored; \" + remedy + \".\");\n        }\n    }\n\n    /**\n     * Duplex streams of an in-process runtime, together with the resource that owns\n     * its lifetime.\n     *\n     * @param receiveStream\n     *            stream carrying messages from the runtime\n     * @param sendStream\n     *            stream carrying messages to the runtime\n     * @param host\n     *            resource closed when the client stops\n     */\n    record InProcessTransport(InputStream receiveStream, OutputStream sendStream, AutoCloseable host) {\n    }","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/main/java/com/github/copilot/CopilotClient.java#L405-L441","documentation":"With RuntimeConnection.forInProcess(), the runtime shares the host process, so per-client options like CliArgs cannot be honored (there is no separate CLI process to receive them). validateEnvironmentOptions calls rejectInProcessOption for each such option present and throws IllegalArgumentException including a remedy hint.","triggerScenarios":"new CopilotClient(...) where the resolved/supplied connection is RuntimeConnection.forInProcess() and options set a per-client value such as non-empty CliArgs.","commonSituations":"Defaults from a shared options builder applied to an embedded in-process client; setting CLI tuning flags expecting them to affect the in-process runtime.","solutions":["Remove the unsupported option (e.g. clear CliArgs)","Follow the remedy in the message — use the typed client options or in-process equivalents","Use a stdio/TCP connection instead if you genuinely need per-process CLI arguments"],"exampleFix":"// before\noptions.setConnection(RuntimeConnection.forInProcess());\noptions.setCliArgs(new String[]{\"--verbose\"});\n// after\noptions.setConnection(RuntimeConnection.forInProcess()); // no per-process options\n// configure via typed client options instead","handlingStrategy":"validation","validationCode":"if (connection.isInProcess() && options.getCliArgs() != null && options.getCliArgs().length > 0) throw new IllegalStateException(\"CliArgs unsupported with forInProcess()\");","typeGuard":null,"tryCatchPattern":"try { new CopilotClient(options); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"not supported with RuntimeConnection.forInProcess()\")) { /* remove the named option */ } else throw e; }","preventionTips":["For in-process mode, keep CopilotClientOptions minimal and use typed client options","Skip CLI-process-tuning options when no CLI process exists"],"tags":["java","in-process","configuration","unsupported-option"],"backgroundTag":"unsupported-config-value","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}