Skip to content

Custom model providers (COPILOT_PROVIDERS_CONFIG / COPILOT_PROVIDER_*) are ignored in --host-environment and --server modes #5371

Open

Description

@qwert666

Describe the bug

Custom BYOK model providers configured via COPILOT_PROVIDERS_CONFIG (providers.json) or COPILOT_PROVIDER_* environment variables work in interactive TUI and -p prompt modes, but are ignored when running copilot --experimental --host-environment <name> or copilot --server. Remote sessions created from GitHub Mobile/Web only expose and use built-in GitHub Copilot models instead of the configured custom provider.

Affected version

@github/copilot 1.0.106-9 (Linux ARM64 / x64)

Steps to reproduce the behavior

  1. Configure a custom OpenAI-compatible provider in /tmp/providers.json:
    {
      "providers": [{ "name": "gateway", "type": "openai", "baseUrl": "https://gateway.example.com/v1", "wireApi": "responses", "apiKey": "..." }],
      "models": [{ "id": "my-model", "provider": "gateway", "modelId": "my-model" }]
    }
  2. Verify it works in prompt/interactive mode:
    COPILOT_PROVIDERS_CONFIG=/tmp/providers.json copilot --experimental --model gateway/my-model -p "1+1"
    (Succeeds and routes to https://gateway.example.com/v1 with isByok: true in ~/.copilot/session-state/<id>/events.jsonl.)
  3. Start a remote environment host with the exact same configuration:
    COPILOT_PROVIDERS_CONFIG=/tmp/providers.json COPILOT_MODEL=gateway/my-model copilot --experimental --host-environment my-host
  4. Create a session on my-host from GitHub Mobile/Web and send a prompt.
  5. Check ~/.copilot/session-state/<id>/events.jsonl: gateway/my-model is never listed in the model picker, and turns execute against "providerId": "copilot" instead of the custom provider.

Expected behavior

--host-environment and --server modes should load COPILOT_PROVIDERS_CONFIG / COPILOT_PROVIDER_* into created sessions so custom provider models appear in the remote session model picker and are used for inference.

Additional context

Setting COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, and COPILOT_MODEL via environment variables exhibits the same behavior: respected in interactive/-p mode, ignored in --host-environment and --server modes.

Activity

  1. added theissue type on Nov 6, 2026
  2. added
    area:modelsModel selection, availability, switching, rate limits, and model-specific behavior
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    on Nov 7, 2026
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

    area:modelsModel selection, availability, switching, rate limits, and model-specific behaviorarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions