{"record":{"id":"5708a67ae00676cd","repo":"github/copilot-sdk","slug":"telemetry-is-not-supported-with-runtimeconnection-5708a6","errorCode":null,"errorMessage":"telemetry is not supported with RuntimeConnection.for_inprocess(): telemetry configuration is lowered to environment variables read by native runtime code running in the shared host process, so per-client telemetry cannot be honored in-process. Configure telemetry via the host process environment, or use a child-process transport.","messagePattern":"telemetry is not supported with RuntimeConnection\\.for_inprocess\\(\\): telemetry configuration is lowered to environment variables read by native runtime code running in the shared host process, so per-client telemetry cannot be honored in-process\\. Configure telemetry via the host process environment, or use a child-process transport\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/copilot/client.py","lineNumber":1497,"sourceCode":") -> None:\n    \"\"\"Validate env/telemetry/working-directory options against the transport.\n\n    Per-client environment is only representable for child-process transports\n    (each client owns its own OS process). The in-process (FFI) transport loads\n    the native runtime into the shared host process, whose single environment\n    block and process-global working directory cannot carry per-client values,\n    so options that lower to them are rejected there (fail loud, not silent).\n    \"\"\"\n    if isinstance(connection, InProcessRuntimeConnection):\n        if options.env is not None:\n            raise ValueError(\n                \"env is not supported with RuntimeConnection.for_inprocess(): the \"\n                \"in-process transport loads the native runtime into the shared host \"\n                \"process, whose single environment block cannot carry per-client \"\n                \"values. Set the variables on the host process environment instead.\"\n            )\n        if options.telemetry is not None:\n            raise ValueError(\n                \"telemetry is not supported with RuntimeConnection.for_inprocess(): \"\n                \"telemetry configuration is lowered to environment variables read by \"\n                \"native runtime code running in the shared host process, so per-client \"\n                \"telemetry cannot be honored in-process. Configure telemetry via the \"\n                \"host process environment, or use a child-process transport.\"\n            )\n        if options.working_directory is not None:\n            raise ValueError(\n                \"working_directory is not supported with RuntimeConnection.for_inprocess(): \"\n                \"the native runtime shares the host process working directory, so a \"\n                \"per-client working directory cannot be honored in-process. Use a \"\n                \"child-process \"\n                \"transport, or set the process working directory before creating the client.\"\n            )\n        return\n\n    if (\n        isinstance(connection, ChildProcessRuntimeConnection)","sourceCodeStart":1479,"sourceCodeEnd":1515,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/python/copilot/client.py#L1479-L1515","documentation":"Telemetry settings are lowered to environment variables consumed by native runtime code; in the in-process transport that code runs in the shared host process, so per-client telemetry cannot be honored. Passing options.telemetry with an in-process connection raises ValueError.","triggerScenarios":"Creating CopilotClient with RuntimeConnection.for_inprocess() and a non-None telemetry option in _CopilotClientOptions.","commonSituations":"Enabling/disabling telemetry programmatically after migrating from stdio transport to in-process; shared telemetry config in a wrapper library that always sets telemetry.","solutions":["Configure telemetry via the host process environment variables and remove options.telemetry","Use a child-process transport (for_stdio) if programmatic per-client telemetry is needed"],"exampleFix":"// before\nclient = CopilotClient(connection=RuntimeConnection.for_inprocess(), telemetry={\"enabled\": False})\n// after\nos.environ[\"COPILOT_TELEMETRY_ENABLED\"] = \"0\"\nclient = CopilotClient(connection=RuntimeConnection.for_inprocess())","handlingStrategy":"validation","validationCode":"if isinstance(conn, InProcessRuntimeConnection) and opts.telemetry is not None:\n    raise ValueError(\"telemetry is unsupported for in-process; use host env\")","typeGuard":"def supports_client_telemetry(conn) -> bool:\n    return not isinstance(conn, InProcessRuntimeConnection)","tryCatchPattern":"try:\n    client = CopilotClient(connection=conn, telemetry=tel)\nexcept ValueError as e:\n    if \"telemetry is not supported\" in str(e):\n        os.environ.update(telemetry_to_env(tel)); tel = None\n        client = CopilotClient(connection=conn)","preventionTips":["Configure telemetry only via host environment when embedding in-process","Centralize transport-specific option filtering","Guard wrapper libraries that unconditionally set telemetry"],"tags":["python","in-process","telemetry","configuration"],"backgroundTag":"unsupported-operation","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"}