Skip to content

macOS Desktop hides Remote setup when ChatGPT login coexists with an env_key custom provider #36879

Open
caozhiyuan/copilot-api
#418

Description

@zhyuzhyu

Summary

On macOS ChatGPT/Codex Desktop, a ChatGPT-managed login can coexist with a custom model provider authenticated through env_key: CLI and Desktop model requests use the custom provider successfully, while codex login status reports Logged in using ChatGPT.

These credentials serve two separate paths:

  • Remote pairing, device registration, push, and other ChatGPT control-plane requests should use the stored ChatGPT OAuth session.
  • Model inference, including inference started from a Remote client and executed on the Mac host, should use the host's configured custom provider and its env_key credential.

The mobile client and ChatGPT Remote control plane do not need access to the custom-provider API key. Remote should relay the task to the host, where the existing provider configuration and environment are available.

However, Desktop Remote setup is hidden because the Desktop shell does not attach the stored ChatGPT access token to the Remote control-plane authorization request. The same ChatGPT account and workspace on Android shows Remote and can open the QR scanner, but the Mac has no Set up Remote sidebar entry and no Control this Mac section under Settings > Connections. Settings search finds Remote control, but selecting it leaves the SSH-only Connections page visible.

The Desktop logs show that the Remote gate is enabled but its ChatGPT authorization check fails before any Remote-triggered model inference occurs:

[remote-connections/window-context] refresh_local_remote_control_client_id_failed
errorMessage="Sign in to ChatGPT to check remote control authorization."

[remote-connections/gate-bridge] sync_failed
errorMessage="Sign in to ChatGPT to check remote control authorization."
remoteControlConnectionsEnabled=true

[electron-fetch-wrapper] desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
target="GET https://chatgpt.com/backend-api/settings/user"

Steps to reproduce

  1. Sign in through the managed ChatGPT browser flow.

  2. Verify the bundled CLI reports:

    Logged in using ChatGPT
    
  3. Configure an OpenAI-compatible custom Responses provider with a separate key:

    model = "gpt-5.6-sol"
    model_provider = "custom_provider"
    
    [model_providers.custom_provider]
    name = "Custom Provider"
    base_url = "https://redacted.example/v1"
    wire_api = "responses"
    env_key = "CUSTOM_PROVIDER_API_KEY"
    supports_websockets = false
  4. Restart ChatGPT Desktop.

  5. Confirm local CLI and Desktop model requests succeed through the custom provider.

  6. Open ChatGPT on Android with the same ChatGPT account/workspace and confirm Remote is available.

  7. On the Mac, inspect the sidebar and Settings > Connections.

  8. Search Settings for remote; observe that Remote control is indexed, but its host controls are not rendered.

Expected behavior

ChatGPT control-plane authentication and custom-provider model authentication should remain independent:

  • The stored ChatGPT OAuth session should authenticate Remote pairing, device registration, push notifications, plugins, and other ChatGPT-backed Desktop features.
  • CUSTOM_PROVIDER_API_KEY should authenticate model requests sent by the Mac host to the custom provider.
  • A model request initiated from Mobile Remote should be relayed to the Mac host and use the same host-side model_provider and env_key configuration as a local CLI or Desktop request.
  • The Mac should show Set up Remote / Control this Mac and allow QR pairing.

If Remote with an env_key custom provider is intentionally unsupported, Desktop should show a clear compatibility message and the limitation should be documented instead of treating the existing ChatGPT session as signed out.

Actual behavior

  • Custom-provider inference works in the local CLI and Desktop app.
  • ChatGPT login status is present.
  • Android Remote is available for the same account/workspace.
  • Mac Remote setup is absent.
  • Desktop reports remoteControlConnectionsEnabled=true, but a ChatGPT control-plane request has hadToken=false.
  • The failure occurs during Remote authorization/setup, before the system can test Remote-triggered inference through the host's custom provider.

This suggests that the Desktop Remote setup or eligibility path does not retrieve the separately stored managed ChatGPT OAuth token when the active model provider uses env_key. It does not indicate that Remote should use the custom-provider API key for its control-plane requests.

Environment

  • macOS: 26.5.2 (25F84)
  • ChatGPT Desktop: 26.727.51351 (build 6119)
  • Bundle ID: com.openai.codex
  • Bundled Codex CLI: 0.146.0-alpha.9.2
  • Login: ChatGPT managed OAuth
  • Model provider: custom Responses provider with env_key

Related issues

Official documentation

  • Remote connections says setup starts from Set up Remote on a Desktop host signed into the same ChatGPT account/workspace, that Remote uses the host's credentials and local setup, and that the connected host provides the environment used by remote work.
  • Advanced Configuration: Custom model providers documents env_key as the provider-specific authentication mechanism.
  • Authentication documents ChatGPT managed login for Desktop and CLI.

No API key, provider URL, account identifier, OAuth token, or private local path is included in this report.

Activity

  1. added
    bug
    app
    auth
    custom-model
    on Aug 4, 2026
  2. juneleung commented on Sep 18, 2026

    @juneleung

    Same issue here with the custom provider, and control of this device ui disappears.

  3. JuanJo-RC commented on Sep 23, 2026

    @JuanJo-RC

    Correction — October 1, 2026: configuration-only solution in my Windows/Azure setup

    My earlier comment overemphasized a source patch. I have since found that adding requires_openai_auth = true under the existing [model_providers.azure] table is sufficient in my setup, keeping Azure selected, its existing env_key credential configuration, and a separate valid ChatGPT sign-in.

    I now report the affected functions working without our patched build. The active Windows desktop is 26.928.3736.0, engine 0.159.2; the running engine's SHA-256 matches the official engine bundled with the installed app. This is manual user validation, not a new instrumented test of each Remote pairing, registration, push, or inference path.

    For this Azure + env_key + ChatGPT configuration, I no longer recommend compiling or maintaining our patch. I should have tested this setting before proposing it. Full correction and configuration details: central report.

    This does not prove the original macOS reproduction is fixed, does not establish operation without a ChatGPT session, and has not been revalidated on the older versions in the historical report. Do not duplicate the provider table or replace the rest of its configuration.

    The official configuration reference documents the setting, but the command-auth instructions prohibit combining it with a provider auth command. This is therefore not a general workaround for every custom provider.

    Historical patched-build experiment — superseded recommendation, retained for context

    Adding a related Windows / Azure + ChatGPT-login validation: I have now manually tested Remote with our locally corrected build, and it works while Azure remains selected as the model provider.

    The source-level diagnosis and full validation are in this comment on #45060. This is not just a proposed Remote fix: there is now a successful manual Remote test on the patched Windows installation, in addition to the browser tests described there. We have not reproduced your exact macOS setup or separately instrumented each pairing, registration, push, and remote-inference path.

    The experiment addresses the shared identity boundary described in this issue: getAuthStatus must not hide a valid stored ChatGPT identity merely because the inference provider has requires_openai_auth=false; account/read must also preserve the ChatGPT account/workspace for app services when the provider has no account of its own. Azure continues to use its own credential, and requiresOpenaiAuth remains false.

    Test environment: Windows desktop 26.917.6896.0, locally compiled engine based on rust-v0.155.0-alpha.16, Azure provider, and an existing valid ChatGPT login. 48 account/auth/workspace tests and 4 provider credential-isolation tests passed on each of Windows and Linux/WSL. Those automated tests do not exercise Remote end to end; the Remote success is my manual test.

    No Remote-specific UI patch, credential copying, URL-policy bypass, or security-check removal was needed. The implementation retains token opt-in, refresh-failure handling, host-owned credential restrictions, and workspace ownership/residency checks.

    Together with successful browser and selected connector checks, this suggests the change benefits services sharing the ChatGPT app-service identity, not only Browser Use. It is not a claim that every service/provider combination is fixed, and it does not add support without a valid ChatGPT session. Related connector-auth report: #40610.

    Could maintainers assess whether this account/provider separation is the appropriate supported approach for the Remote failure described here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appauthbugcustom-modelremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions