Skip to content

Issue Summary: Copilot CLI Session Resume Fails Due to Inconsistent Model Name Prefix Handling #4282

Open

Description

@YH20250922

Describe the bug

When attempting to resume a previous session that used a custom endpoint model (e.g., a locally hosted LM Studio model qwen3.6-35b-a3b) in VS Code’s Copilot CLI, the CLI fails to restore the session because of an inconsistency in the model name prefix. The session metadata stores a prefixed name, but the actual API call uses the unprefixed name, leading to a non‑JSON error response and a subsequent parsing failure.

Affected version

GitHub Copilot CLI 1.0.74.

Steps to reproduce the behavior

1.Configure a custom endpoint in VS Code pointing to a local LM Studio server with the model qwen3.6-35b-a3b.

2.Start a new session using that model and complete a conversation successfully. The session is saved normally.

3.End the session (e.g., by closing the conversation or letting it finish).

4.Attempt to resume the session from the VS Code Copilot history panel.

5.Observe the error – the CLI logs show model fallback warnings and eventually an API call failure.

Expected behavior

When resuming a session, the Copilot CLI should:

Maintain model name consistency – either store the unprefixed name in the session metadata, or use the full name (including the customendpoint/ prefix) when making the API call.

Provide clearer error messaging – when a model name mismatch occurs, the CLI should give an explicit, actionable error instead of a cryptic JSON parsing failure.

Additional context

2026-07-28T11:50:21.747Z [INFO] Proxy configuration: HTTP_PROXY=(not set), HTTPS_PROXY=(not set), NO_PROXY=192.168.1.101,localhost,127.0.0.1
2026-07-28T11:50:21.748Z [INFO] Running in offline mode. GitHub features are unavailable.
2026-07-28T11:50:21.748Z [INFO] Shell completions: no supported shell detected, skipping
2026-07-28T11:50:21.748Z [INFO] Starting CLI in server mode (stdio)
2026-07-28T11:50:21.749Z [INFO] Starting CLI in stdio mode (Rust JSON-RPC engine)
2026-07-28T11:50:21.749Z [INFO] CLI server ready (stdio mode, Rust JSON-RPC engine)
2026-07-28T11:50:21.749Z [INFO] Server started, waiting for requests
2026-07-28T11:50:22.651Z [INFO] Workspace initialized: 59d2872e-c098-4f97-872d-e2ee57464169 (checkpoints: 0)
2026-07-28T11:50:22.666Z [INFO] [managedSettings] applied: bypass-permissions mode DISABLED by enterprise policy (fail-closed: policy could not be determined) — /allow-all and permission escalation are now blocked
2026-07-28T11:50:22.666Z [INFO] [managedSettings] self-fetch starting for account https://github.com/YH20250922
2026-07-28T11:50:22.666Z [INFO] [managedSettings] device MDM: no policy present on this device
2026-07-28T11:50:23.538Z [INFO] [managedSettings] server policy: none for this account (404/empty) from https://github.com
2026-07-28T11:50:23.538Z [INFO] [managedSettings] effective policy resolved: source=none, bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:23.538Z [INFO] [managedSettings] applied: no bypass restriction in force (managed policy absent)
2026-07-28T11:50:23.538Z [INFO] [managedSettings] self-fetch complete for https://github.com/YH20250922: bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:23.551Z [INFO] Resumed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:23.561Z [INFO] Retrieved 17 events from session 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.665Z [WARNING] Model 'customendpoint/qwen3.6-35b-a3b' from CLI argument is not available. Falling back to next option.
2026-07-28T11:50:31.665Z [WARNING] Model 'customendpoint/qwen3.6-35b-a3b' from session is not available. Falling back to next option.
2026-07-28T11:50:31.665Z [INFO] Using default model: gpt-5.4
2026-07-28T11:50:31.673Z [INFO] Closing session 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.678Z [INFO] Destroyed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.688Z [INFO] Workspace initialized: 59d2872e-c098-4f97-872d-e2ee57464169 (checkpoints: 0)
2026-07-28T11:50:31.691Z [INFO] [managedSettings] applied: bypass-permissions mode DISABLED by enterprise policy (fail-closed: policy could not be determined) — /allow-all and permission escalation are now blocked
2026-07-28T11:50:31.691Z [INFO] [managedSettings] self-fetch starting for account https://github.com/YH20250922
2026-07-28T11:50:31.691Z [INFO] [managedSettings] device MDM: no policy present on this device
2026-07-28T11:50:32.114Z [INFO] [managedSettings] server policy: none for this account (404/empty) from https://github.com
2026-07-28T11:50:32.114Z [INFO] [managedSettings] effective policy resolved: source=none, bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:32.114Z [INFO] [managedSettings] applied: no bypass restriction in force (managed policy absent)
2026-07-28T11:50:32.114Z [INFO] [managedSettings] self-fetch complete for https://github.com/YH20250922: bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:32.125Z [INFO] Resumed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:32.129Z [ERROR] Starting remote MCP client for GitHub with url: https://api.githubcopilot.com/mcp/
2026-07-28T11:50:32.129Z [ERROR] Connecting MCP client for GitHub...
2026-07-28T11:50:32.130Z [ERROR] Starting remote MCP client for unreal-mcp with url: http://127.0.0.1:8000/mcp
2026-07-28T11:50:32.130Z [ERROR] Connecting MCP client for unreal-mcp...
2026-07-28T11:50:32.970Z [ERROR] [rust:rmcp::transport::worker] worker quit with fatal: Transport channel closed, when AuthRequired(AuthRequiredError { www_authenticate_header: "******"invalid_request", error_description="No access token was provided in this request", resource_metadata="https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/\"" })
2026-07-28T11:50:32.971Z [ERROR] Server GitHub requires authentication, initiating OAuth flow
2026-07-28T11:50:33.773Z [ERROR] OAuth authentication required for GitHub
2026-07-28T11:50:34.149Z [ERROR] [rust:rmcp::transport::worker] worker quit with fatal: Transport channel closed, when Client(reqwest::Error { kind: Request, url: "http://127.0.0.1:8000/mcp", source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", 127.0.0.1:8000, Os { code: 10061, kind: ConnectionRefused, message: "由于目标计算机积极拒绝,无法连接。" })) })
2026-07-28T11:50:34.149Z [ERROR] Failed to start MCP client for remote server unreal-mcp: Error: failed to initialize MCP client: Send message error Transport [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkermcp::client::RawCapturingReqwestClient>] error: Client error: error sending request for url (http://127.0.0.1:8000/mcp), when send initialize request (code=GenericFailure)
2026-07-28T11:50:34.149Z [ERROR] Recorded failure for server unreal-mcp: failed to initialize MCP client: Send message error Transport [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkermcp::client::RawCapturingReqwestClient>] error: Client error: error sending request for url (http://127.0.0.1:8000/mcp), when send initialize request
2026-07-28T11:50:34.337Z [INFO] Using custom provider: type=openai, baseUrl=http://127.0.0.1:62659/v/customendpoint, wireApi=completions
2026-07-28T11:50:34.337Z [INFO]
2026-07-28T11:50:34.337Z [INFO] --- Start of group: Custom provider configured settings: ---
2026-07-28T11:50:34.337Z [INFO] --- End of group ---
2026-07-28T11:50:34.399Z [INFO] --- Start of group: Completion request configuration: ---
2026-07-28T11:50:34.399Z [INFO] --- End of group ---

session log

First conversation (successful):
{"type":"session.start","data":{"selectedModel":"customendpoint/qwen3.6-35b-a3b",...}}
{"type":"assistant.turn_start","data":{"model":"qwen3.6-35b-a3b",...}} // prefix dropped during actual call

Resume attempt (failure):
{"type":"session.resume","data":{"selectedModel":"customendpoint/qwen3.6-35b-a3b",...}}
{"type":"assistant.turn_start","data":{"model":"qwen3.6-35b-a3b",...}} // still unprefixed
// Repeated model_call errors follow
{"type":"session.error","data":{"errorType":"query","message":"non-streaming response body was not valid JSON: expected value at line 1 column 1"}}

Activity

  1. added theissue type on Jul 28, 2026
  2. added
    area:modelsModel selection, availability, switching, rate limits, and model-specific behavior
    area:sessionsSession management, resume, history, session picker, and session state
    and removed on Jul 29, 2026
  3. Tari-sk commented on Aug 6, 2026

    @Tari-sk

    I can reproduce a very similar issue on GitHub Copilot CLI 1.0.78 when using a BYOK OpenAI-compatible provider. This may be related to #4282, although my setup does not use LM Studio and the exact failure mode may differ. 【1-ace694】

    What works

    Fresh conversations work correctly:

    copilot -p "Say hello"

    The configured model is available and can be used successfully for new sessions.

    What fails

    Resuming a conversation fails:

    copilot --resume=<session-id>

    The CLI reports a model resolution error similar to:

    Model '<model-name>' not found on provider
    

    Why this seems related to #4282

    The model and provider configuration are valid:

    • New conversations work correctly.
    • The model is available.
    • Only session resume fails.
    • The failure occurs during session restoration, not during normal conversation startup.

    This looks very similar to the issue described here where resume appears to use model/session metadata differently from a fresh conversation. 【1-ace694】

    Question for maintainers:

    Is #4282 intended to track all BYOK/custom-provider resume failures, or only the specific customendpoint/... model prefix mismatch described in the original report?

    If useful, I can provide additional logs from a reproducible setup on CLI 1.0.78.

  4. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the report. We've shipped fixes in this area since this was filed, and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

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:sessionsSession management, resume, history, session picker, and session statemore-info-needed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions